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

test/system: Refactor tests using bats-support and bats-assert #693

Merged

Conversation

HarryMichal
Copy link
Member

This has been split from #517.

The bats-support[0] and bats-assert[1] libraries extend the
capabilities of bats[2]. Mainly, bats-assert is very useful for clean
checking of values/outputs/return codes.

Apart from updating the cases to use the libraries, the test cases have
been restructured in a way that they don't depend on each other anymore.
This required major changes in the helpers.bats file.

Overall, the tests are cleaner to read and easier to extend due to the
test cases being independent.

There will be a follow up commit that will take care of downloading of
the tested images locally and caching them using Skopeo to speedup the
tests and try to resolve network problems when pulling the images that
we experienced in the past.

[0] https://github.com/bats-core/bats-support
[1] https://github.com/bats-core/bats-assert
[2] https://github.com/bats-core/bats-core

@HarryMichal HarryMichal added 3. Enhancement Improvement to an existing feature 6. Major Change May cause breakage 2. CI Automation of testing, analysis and other actions labels Feb 12, 2021
@HarryMichal HarryMichal force-pushed the refactor-tests-with-bats-libraries branch from d212317 to 81c63d3 Compare February 12, 2021 11:38
@softwarefactory-project-zuul
Copy link

Build failed.

The bats-support[0] and bats-assert[1] libraries extend the
capabilities of bats[2]. Mainly, bats-assert is very useful for clean
checking of values/outputs/return codes.

Apart from updating the cases to use the libraries, the test cases have
been restructured in a way that they don't depend on each other anymore.
This required major changes in the helpers.bats file.

Overall, the tests are cleaner to read and easier to extend due to the
test cases being independent.

Some slight changes were made to the test cases themselves. Should not
alter their final behaviour.

There will be a follow up commit that will take care of downloading of
the tested images locally and caching them using Skopeo to speedup the
tests and try to resolve network problems when pulling the images that
we experienced in the past.

[0] https://github.com/bats-core/bats-support
[1] https://github.com/bats-core/bats-assert
[2] https://github.com/bats-core/bats-core
@HarryMichal HarryMichal force-pushed the refactor-tests-with-bats-libraries branch from 81c63d3 to fe98a36 Compare February 12, 2021 12:51
@softwarefactory-project-zuul
Copy link

Build failed.

@HarryMichal
Copy link
Member Author

Fedora 34 was branched quite recently and GPG keys are not OK, yet. The rawhide test suite can be ignored for a little while.

@HarryMichal HarryMichal merged commit b27795a into containers:master Feb 12, 2021
@HarryMichal HarryMichal deleted the refactor-tests-with-bats-libraries branch March 31, 2021 09:52
HarryMichal added a commit to HarryMichal/toolbox that referenced this pull request May 26, 2021
The system test refactor[0] replaced the 'run_toolbox' helper function
with 'run toolbox', which is a normal invocation of Toolbox. This makes
it impossible to override Toolbox used during the tests using env var.

[0] containers#693
HarryMichal added a commit to HarryMichal/toolbox that referenced this pull request May 26, 2021
The system test refactor[0] replaced the 'run_toolbox' helper function
with 'run toolbox', which is a normal invocation of Toolbox. This makes
it impossible to override Toolbox used during the tests using env var.

[0] containers#693
HarryMichal added a commit that referenced this pull request May 26, 2021
The system test refactor[0] replaced the 'run_toolbox' helper function
with 'run toolbox', which is a normal invocation of Toolbox. This makes
it impossible to override Toolbox used during the tests using env var.

[0] #693
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. CI Automation of testing, analysis and other actions 3. Enhancement Improvement to an existing feature 6. Major Change May cause breakage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants