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 end to end tests with bats #490

Merged
merged 5 commits into from
Aug 13, 2024
Merged

tests: Add end to end tests with bats #490

merged 5 commits into from
Aug 13, 2024

Conversation

rumpelsepp
Copy link
Member

@rumpelsepp rumpelsepp commented Jan 2, 2024

This PR converts the CLI "tests" into bats tests. For now there is not much delta, since the gallia commands are just run as before. However, the information provided by bats in case of errors is already superior and more helpul. See screenshots below.

The next step would be checks for expected output of gallia, e.g. artifacts or similar. I hope this will be helpul to get gallia 2.0 over the finish line. @fkglr

The tests are in the .bats files and should be easy to understand. If a test function returns with an exit code != 0 then the stdout/stderr of all run commands are printed and an error is logged (see second screenshot). .bats is just a Bash script.

Bats 1.8 is used from debian stable, so I consider this tool as universally available.

image

Injected a return 1 for demonstration purposes:

image

Copy link

stale bot commented Jul 14, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 14, 2024
@rumpelsepp rumpelsepp force-pushed the testing branch 2 times, most recently from 1169462 to 2f3ae11 Compare August 12, 2024 08:57
@stale stale bot removed the stale label Aug 12, 2024
@rumpelsepp rumpelsepp marked this pull request as ready for review August 12, 2024 09:27
@rumpelsepp rumpelsepp force-pushed the testing branch 2 times, most recently from 1e46a6d to 14264b0 Compare August 12, 2024 09:35
@rumpelsepp rumpelsepp requested a review from fkglr August 12, 2024 09:36
@rumpelsepp rumpelsepp added this to the gallia 2.0 milestone Aug 12, 2024
@rumpelsepp rumpelsepp force-pushed the testing branch 11 times, most recently from 3f867ea to 70a8a49 Compare August 13, 2024 09:51
Those are covered now by a bats testsuite in gallia.
Piping data to stdin of `hr` was broken due to a faulty check. This was
discovered writing bats checks for `hr`.
@rumpelsepp rumpelsepp merged commit d97251e into master Aug 13, 2024
13 checks passed
@rumpelsepp rumpelsepp deleted the testing branch August 13, 2024 13:02
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.

2 participants