Add functional test infrastructure in CI #8
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a CI pipeline that run e2e functional test of the script generation
The functional test use the dry-run mode and compare the output with an expected output.
The test
The test receives two parameters:
It executes the scenario in dry-run mode and compare the results folder with the expected output folder, if any difference is found in one of the files, the test fails.
Note that the empty lines and commented lines (the ones that start with #) are not taken into account when computing the difference.
The workflow
The workflow uses a strategy matrix to define the tests it should run, every tests run in parallel.
Note that the python setup is cached and therefore will run only if the requirements-dev.txt file is changed.
Add a new test
To add a new test:
ci_tools/functional_tests/scenarios_expected_outputs/
named after the name of this test and fill it with the expected output of the scenario (you can copy the output of a valid dry run).github/workflows/functional_test.yml
), add your new test injobs.test.strategy.matrix.include
(see the comment saying "Add your new test here"), follow the syntax of the other tests