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

tests: Add target support to RepositorySimulator #1587

Merged
merged 2 commits into from
Sep 27, 2021

Conversation

jku
Copy link
Member

@jku jku commented Sep 21, 2021

  • Add very simple targets support into simulator
  • Add documentation for the simulator
  • Add an example targets test

This might need to be tweaked and/or extended as we add tests but the
implementation should give a good indication of how to extend it.

As an example, non-consistent targets (or metadata) are not yet supported, but
making fetch() check for the consistent_snapshot state and respond
accordingly should be easy.

Signed-off-by: Jussi Kukkonen jkukkonen@vmware.com


This should be useful to properly test consistent targets (#1576 ) and then implement good test coverage for updater in general.

CC @MVrachev, marking you a reviewer as I know you might want to use it. If you have any improvement ideas let me know. A potential one is a way for simulator to verify targets client has downloaded (a helper, so tests could say "assert that my target is correct"), but I figured we'd first write some tests and see where we duplicate code...

@jku jku requested a review from MVrachev September 21, 2021 10:22
Copy link
Collaborator

@MVrachev MVrachev left a comment

Choose a reason for hiding this comment

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

I tried it locally and it looks good to me.
For now, I don't have any concrete suggestions.

@jku jku force-pushed the tests-repo-sim-targets-support branch from 99c028c to c333ca6 Compare September 24, 2021 08:52
@coveralls
Copy link

coveralls commented Sep 24, 2021

Pull Request Test Coverage Report for Build 1269142426

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 98.248%

Totals Coverage Status
Change from base Build 1260939635: 0.02%
Covered Lines: 3741
Relevant Lines: 3774

💛 - Coveralls

Jussi Kukkonen added 2 commits September 24, 2021 13:41
* Add very simple targets support into simulator
* Add documentation for the simulator
* Add an example targets test

This might need to be tweaked and/or extended as we add tests but the
implementation should give a good indication of how to extend it.

As an example, non-consistent targets are not yet supported, but
making fetch() check for the consistent_snapshot state and respond
accordingly should be easy.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
The handling of consistent snapshot was not very clear: try to make
it more obvious what is supported and what is not.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
@jku jku force-pushed the tests-repo-sim-targets-support branch from c333ca6 to 59b0b99 Compare September 24, 2021 10:42
@jku
Copy link
Member Author

jku commented Sep 24, 2021

Modified based on feedback, rebased on develop

@jku jku merged commit e6787ae into theupdateframework:develop Sep 27, 2021
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.

4 participants