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

Add pytest automated testing #25

Merged
merged 31 commits into from
Aug 15, 2024
Merged

Add pytest automated testing #25

merged 31 commits into from
Aug 15, 2024

Conversation

Vincinator
Copy link
Contributor

This PR adds tests by using ZOT as local OCI registry.

🚧 Work in Progress

Notes

  • Requires zot to be installed
  • Requires poetry dependencies to be installed
  • run tests with pytest or poetry run pytest

@Vincinator Vincinator changed the title Add purest automated testing Add pytest automated testing Aug 12, 2024
@Vincinator Vincinator marked this pull request as ready for review August 14, 2024 06:11
@Vincinator Vincinator merged commit d005394 into main Aug 15, 2024
6 of 7 checks passed
@Vincinator Vincinator deleted the add-automated-testing branch August 15, 2024 06:52
Vincinator added a commit that referenced this pull request Aug 15, 2024
Adds Pytest setup that is run on GitHub actions, and can also run locally.

A local oci-registry is started for each test individually if required.
CLI commands from gl-oci are tested by utilising the click.testing.CliRunner.invoke[1],
so the actual user interface is tested.

ephemeral pub/priv key pair is generated per test session.

On test session teardown certs are removed again (useful for local development, does not matter in gh actions)
On test case teardown zot persistent state stored in output/zot is removed, which is required to start with a fresh zot registry for the next test (to avoid side-effects of tests affecting the next test)

[1] https://click.palletsprojects.com/en/7.x/api/#click.testing.CliRunner.invoke
Vincinator added a commit that referenced this pull request Aug 15, 2024
Adds Pytest setup that is run on GitHub actions, and can also run locally.

A local oci-registry is started for each test individually if required.
CLI commands from gl-oci are tested by utilising the click.testing.CliRunner.invoke[1],
so the actual user interface is tested.

ephemeral pub/priv key pair is generated per test session.

On test session teardown certs are removed again (useful for local development, does not matter in gh actions)
On test case teardown zot persistent state stored in output/zot is removed, which is required to start with a fresh zot registry for the next test (to avoid side-effects of tests affecting the next test)

[1] https://click.palletsprojects.com/en/7.x/api/#click.testing.CliRunner.invoke
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.

1 participant