Closed fungjj92 closed 4 years ago
Standby. I am in the middle of fixing auth test issues in this branch, I realized there were some errors I was making in encoding/decoding.
Alright this is ready to be looked at.
Ran 1115 tests in 297.171s
FAILED (failures=25, errors=125, skipped=23)
I had been clobbering the basic auth tests with unwanted layers of encoding & decoding. I'm not sure how these failures didn't arise earlier, but alas. I was tipped off by the lack of output at the regex parsers; no surprise but regex is great at preserving and communicating its desired data format, which was helpful in figuring out how the auth data should look.
I did provision a fresh app
VM and got the same results
FAILED (failures=25, errors=264, skipped=23)
Thank you for the well-considered rounds of reviews. Onward! Merging.
Overview
This PR is a first go at fixing the failing tests from the Py2->3 upgrade. The tests should be fixed for the
exporter
app 🎉 One down.I touched tests / code across the django apps
api, exporter, importer, treemap
. Except forexporter
, they continue to have errors. I'm not sure how the test runner selects the order of tests to run because it skipped around these 4 apps when running./scripts/manage.py test --failfast
Most of the changes thus far have been about unicode/byte - string translation. The celery and Django-tinsel upgrades were to fix test-related errors, see commit https://github.com/OpenTreeMap/otm-core/commit/df782b1e40ab988e27bede383616c0587344a2c2
Notes
In retrospect, I would have worked on one app's tests at a time. My advice to parallelize this work moving forward is just that:
./scripts/manage.py test <app_name> --failfast
It's impossible to linearly compare progress for various reasons. But anyway, we're making progress!
Before:
And this is what remains after related-PRs 😳
Testing
In the app VM, pip install the new python dependencies:
vagrant ssh app -c 'cd /opt/app/core && envdir /etc/otm.d/env pip3 install -r ./requirements.txt'
Checkout the otm-addons companion branch https://github.com/OpenTreeMap/otm-addons/pull/1566
I suppose you'll want to test each of the apps that was touched and check if any still failling tests are a result of lines of codes touched in this PR.
./scripts/manage.py test <app_name>
Also ensure that the changes don't chip away important context just to get tests to work.