Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running integration tests #143

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

lenkan
Copy link
Collaborator

@lenkan lenkan commented Nov 21, 2023

Here is a rough draft for creating and running integration tests in github actions.

The proposal is to move examples/integration-scripts one by one into the test-integration folder. We could just keep them as simple node.js script. But if we run them in a test runner we can get coverage reports, test results reporting and also group tests together more efficiently.

Currently they depend on me pushing images to docker hub. But if we just start to push images from keripy, keria and vLEI on every commit we can just use the images from there. Another option (very slow) is to pull the source or python packages for each dependency and build them here before running the tests. But then we probably have to add some sort of image caching to make it run reasonably fast.

The proposal is to rename the examples/integration-scripts with .test.ts suffix one-by-one. That way they will be picked up by the test runner.

Currently, the images are being pulled from my docker hub registry. This is because the images in WebOfTrust were not up to date. Once they are, we can simply swap out for example lenkan/keria => WebOfTrust/keria in docker-compose.yaml.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bcd83fc) 81.01% compared to head (e972f8f) 81.01%.

Additional details and impacted files
@@             Coverage Diff              @@
##           development     #143   +/-   ##
============================================
  Coverage        81.01%   81.01%           
============================================
  Files               46       46           
  Lines             4187     4187           
  Branches          1028     1028           
============================================
  Hits              3392     3392           
  Misses             763      763           
  Partials            32       32           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pfeairheller
Copy link
Member

I'd rather not start propagating KERIA dockerfiles to Signify client repos. Lets first get docker images published for KERA and reply on them in CI/CD for the clients otherwise we are going to have a mess of non-interoperable clients because they have their own "versions" of KERIA running.

test-integration/single-issuer-holder.test.ts Outdated Show resolved Hide resolved
images/keria/entrypoint.sh Outdated Show resolved Hide resolved
@lenkan
Copy link
Collaborator Author

lenkan commented Nov 21, 2023

@pfeairheller There are no additional images built for this. They are built from keria, keripy and vLEI respectively, without any modifications. See docker-compose.yaml where images are specified. They are just hosted in my docker hub registry because the WebOfTrust registry was not updated. The idea is that it would be swapped for WebOfTrust/keria.

The reason I added an entrypoint.sh script, and mounted it in the container, is to be able to set configuration on startup. There should be another way to do this. This does not change the image, just the container at runtime. I will comment on the specific line.

Edit: I have now removed the entrypoint.sh script and just specifying the entrypoint in the docker-compose file. This is probably less confusing. Ideally I would just be able to configure keria with environment variables or cli options to be able to run it inside a docker network. But at the moment I need to be able to set the hostname for keria within the docker network. Otherwise OOBI:ing won't work.

images/keria/entrypoint.sh Outdated Show resolved Hide resolved
@pfeairheller
Copy link
Member

I created and published the following docker images:

WebOfTrust/keri-witness-demo:1.1.0
WebOfTrust/keri:1.1.0
WebOfTrust/keria:0.1.0 (and latest)
gleif/vlei:0.2.0 (and latest)

@lenkan can you please update your compose file and see if they all work for integration? Thanks!

@lenkan
Copy link
Collaborator Author

lenkan commented Nov 22, 2023

I created and published the following docker images:

WebOfTrust/keri-witness-demo:1.1.0 WebOfTrust/keri:1.1.0 WebOfTrust/keria:0.1.0 (and latest) gleif/vlei:0.2.0 (and latest)

@lenkan can you please update your compose file and see if they all work for integration? Thanks!

Updated. It works 👍. I just used :latest for vlei and keria. Not sure what you think is the best strategy there. It is nice that it always pulls the latest stuff to ensure it works. But it can also cause a bit of a nuisance if keria upgrades and breaks integration tests for unrelated PRs at the client repo.

@lenkan lenkan marked this pull request as ready for review November 22, 2023 16:47
@pfeairheller
Copy link
Member

I created and published the following docker images:
WebOfTrust/keri-witness-demo:1.1.0 WebOfTrust/keri:1.1.0 WebOfTrust/keria:0.1.0 (and latest) gleif/vlei:0.2.0 (and latest)
@lenkan can you please update your compose file and see if they all work for integration? Thanks!

Updated. It works 👍. I just used :latest for vlei and keria. Not sure what you think is the best strategy there. It is nice that it always pulls the latest stuff to ensure it works. But it can also cause a bit of a nuisance if keria upgrades and breaks integration tests for unrelated PRs at the client repo.

I think getting the dev containers pushed on a regular basis will help us address this. So we can have dev builds use dev containers across the board and published versions rely on matching published versions.

Copy link
Member

@pfeairheller pfeairheller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@rodolfomiranda
Copy link
Collaborator

@lenkan , are we ready to merge this one, right?

@lenkan lenkan changed the title Draft for running integration tests running integration tests Nov 27, 2023
@lenkan
Copy link
Collaborator Author

lenkan commented Nov 27, 2023

@lenkan , are we ready to merge this one, right?

@rodolfomiranda It should be good to merge. I can help moving some of the remaining scripts to tests as well after this is merged. When KERIA images are being pushed on builds from KERIA repository with :latest tag, they will be picked up here.

@rodolfomiranda rodolfomiranda merged commit e5d39b9 into WebOfTrust:development Nov 27, 2023
5 checks passed
@lenkan lenkan deleted the test-integration branch December 4, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants