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

repository module: Add tests #2228

Open
jku opened this issue Dec 17, 2022 · 1 comment
Open

repository module: Add tests #2228

jku opened this issue Dec 17, 2022 · 1 comment

Comments

@jku
Copy link
Member

jku commented Dec 17, 2022

Once #2193 is merged, there is a repository module. The module is not really tested but should be.

It's entirely possible that the module can't really be effectively unit tested (as it's an ABC). But the repository example can be end-to-end tested and maybe even the SimpleRepository class within the example could be unit tested. I think testing the whole repository example is most critical.

I'm not sure what kind of things we should test but at least

  • refreshing a client, downloading a file from the repository
  • making sure the repository metadata actually changes, and that the updated metadata is correct (i.e. client that has metadata version N can successfully update to N+M)
@jku
Copy link
Member Author

jku commented Dec 27, 2022

This should include the uploader as well. The basic end-to-end test for all examples would be:

  1. run repository/repo in one process
  2. wait until http server is up
  3. run uploader/uploader (in another process) to initialize with trust-on-first-use, create a delegation and to add a target
  4. wait until upload has finished
  5. run client/client (in 3rd process or reusing the uploader process) to initialize with trust-on-first-use and download target

This would be useful even without any other checks (like checking which metadata versions are used): if the client can download the file and the contents are correct, that's a really good indication the examples are running pretty well.

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

No branches or pull requests

1 participant