Today I killed the Jenkins test for a while. It was tricky to understand
what was going on.
Basically, the preferred approach we have is to compress offline (rather
than doing it on-the-fly). See settings/base.py (COMPRESS_OFFLINE=True).
If you choose this approach, it means that you need to first run
``./manage.py collectstatic --noinput && ./manage.py compress`` before
running tests.
Also, to be able to do that, the offline compressor goes through all
templates and picks up static files it can compress. Because we had an
obsolete template that referenced static files that no longer exists, it
was impossible to change the jenkins build script to run said commands
before starting the test runner.
All of this took me a long time to come to grips with and I ended up
force-landing two bustage fixes on "develop":
1.
https://github.com/mozilla/elmo/commit/0c5892c9e7b15849129ea6c31182c2e3aabaaf73
2.
https://github.com/mozilla/elmo/commit/22db88abee12312275f0bcc757c9ade56bc94957
Sorry :)
This lead me to look into running tests without having to collect and
compress first. That now wasn't possible because of the stupidity of our
handler500() view function. (arguable, it's stupid that our 500.html
depends on Django template code in the form of extending base.html)
To remedy this, I created this bug and uploaded a patch:
https://bugzilla.mozilla.org/show_bug.cgi?id=700521
Now it becomes possible to run the whole test suite with
COMPRESS_OFFLINE switched off.
Lastly, the current approach in
https://github.com/mozilla/elmo/blob/develop/scripts/build.sh#L54 is to
run the tests with compression being offline. That just feels better
because we're not using the compress-on-the-fly approach in production.
If we'd want to run tests with COMPRESS_OFFLINE=False, we'd first need
to apply the patch in #700521 mentioned above.
Peter