This PR is mostly the same as the original one FEATURE: Allow theme tests to be run in production by OsamaSayegh · Pull Request #12815 · discourse/discourse · GitHub with 3 new changes changes on top of the original PR (each new change is made as a new commit so they can be easily reviewed).
The new changes are:
/theme-qunit so it works on subfolder installs and fixing lazy-loaded assets so they’re loaded from the CDN instead of hitting the app server.
(2) Create new
theme_test_vendor.js and use them in
/theme-qunit instead of
test_helper.js. The reason for this change is
test_helper.js is very large and precompiling it is so expensive (takes about 40 seconds and 1GB of RAM) that it can make small servers run out of memory. This is why the original PR was reverted: Failed to bootstrap due to out of memory killer - #18 by Falco - bug - Discourse Meta.
unsafe-eval to CSP for