-
-
Notifications
You must be signed in to change notification settings - Fork 33
Running smoke tests in docker #266
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
Conversation
.github/workflows/elixir_test.yml
Outdated
| - name: Run Tests in Docker | ||
| run: bin/run-tests-in-docker.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should both the step name and the bin filename mention that those are smoke tests only, not all tests?
| # Example: | ||
| # ./bin/run-tests-in-docker.sh | ||
|
|
||
| set -e # Make script exit when a command fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 (sanity check: the script fails when either the first or the second stage of the docker build fails, which was the problem Erik wanted to address)
bin/smoke_test.sh
Outdated
| # Temporarily disable -e mode | ||
| set +e | ||
| for solution in test_data/*/* ; do | ||
| slug=$(basename $(dirname $solution)) | ||
| # run analysis | ||
| bin/run.sh $slug $solution $solution | ||
| # check result | ||
| bin/check_files.sh $solution | ||
| done | ||
| set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I mess up with one of the expected results (e.g. change the emoji in test_data/lasagna/failing_solution/expected_analysis.json) to simulate a failure, running ./bin/run-tests-in-docker.sh still has an exit code 0. I think that means the CI won't really report smoke test failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch.
I guess using set +e in this way is inappropriate.
This reverts commit 552a826.
|
Sorry for the mess.
The reason for failure was that the script didn't have permission to write the output file. I did however have the right to write to I'm not too sure what I could have done for reason 1, I'm not too experienced with docker, but I thought the whole point was to have reproducible behavior... |
|
I think ideally the tests run in Docker would use the same docker run flags as in production, and the same as other tooling in their tests, for example: There's no network, file-read only filesystem, but also mounting a temporary write filesystem to |
|
According to Erik, they don't use read-only yet, but according to his next 7 words, they might in the future. |
angelikatyborska
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Now we will know in CI if something goes wrong with the Docker container.
I've added a
bin/run-tests-in-docker.shin the CI that runs the analyzer on the exercises intest_datain docker.I adapted
bin/smoke_test.shandbin/check_files.shfromelixir-test-runner.They work by running the analyzer in every folder in
test_dataand comparing the result to expected results (that I added as well).