-
Notifications
You must be signed in to change notification settings - Fork 17
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
Pytest Github Action #274
Pytest Github Action #274
Conversation
run: docker exec atn bash -c "make -f Makefile-docker update_deps" | ||
|
||
- name: Patch Django | ||
run: docker exec atn bash -c "sed -i 's/TX_ISOLATION = /transaction_isolation = /' /usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" |
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.
MySQL 8+ swaps TX_ISOLATION for transaction_isolation. This only breaks in tests because Django uses it to keep test runs clean iirc.
docker run --add-host host.docker.internal:host-gateway --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=verysecurepw -e MYSQL_DATABASE=test_olympia -d mysql:8.0 --default-authentication-plugin=mysql_native_password | ||
sleep 15 | ||
docker exec mysql mysql -P 3306 -u root -p"verysecurepw" -e "CREATE USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'verysecurepw';" | ||
docker exec mysql mysql -P 3306 -u root -p"verysecurepw" -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1';" |
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.
We could have probably used an empty password but I felt like it may cause unexpected issues, so I went with an extremely secure password.
It doesn't matter that is is exposed as it's just a test db that dies at the end of the run.
.github/workflows/ci-tests.yml
Outdated
run: docker exec atn bash -c "sed -i 's/TX_ISOLATION = /transaction_isolation = /' /usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" | ||
|
||
- name: Run tests | ||
run: docker exec atn bash -c "python -m pytest -m 'not es_tests' src/olympia/" |
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.
Run all test suites except for elasticsearch. Because we don't have one running here.
(This is supposed to fail for now.) |
Test Results5 481 tests 5 393 ✅ 27m 47s ⏱️ For more details on these failures, see this check. Results for commit 12d22c1. ♻️ This comment has been updated with latest results. |
fe81e14
to
ede53f3
Compare
Since the test suite is incredibly large and noisy I've added a github action to display the results from the xml report. |
25d656b
to
ef92fa6
Compare
Okay I had to add ES, but now the tests run without errors. There's still failures, but no errors! |
* Runs on master or PRs for master * Runs the full suite except for elasticsearch tests * Uses elasticsearch though... * Has to patch django to fix isolate transaction issue for mysql 8.0~ * Uses production image from dockerhub * Generates report * Displays report on Github PR
ef92fa6
to
12d22c1
Compare
This should help us keep an eye on the state of tests as we
break more thingsadd new features 😄