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
tests: webui: Address several issues #6690
Conversation
https://peter.sh/experiments/chromium-command-line-switches/#allow-file-access-from-files > By default, file:// URIs cannot read other file:// URIs. This is an override for developers who need the old behavior for testing. Fixes webui tests on CI: ``` Testing test/all_tests.html Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. Access to XMLHttpRequest at 'file:///__w/freeipa/freeipa/install/ui/test/qunit.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-untrusted, https. Failed to load resource: net::ERR_FAILED Access to XMLHttpRequest at 'file:///__w/freeipa/freeipa/install/ui/test/data/i18n_messages.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-untrusted, https. Failed to load resource: net::ERR_FAILED >> Error: Error: Couldn't receive translations ``` Related: https://pagure.io/freeipa/issue/9329 Signed-off-by: Stanislav Levin <[email protected]>
6ec7887
to
b3ac2d4
Compare
|
The tests are broken with recent
and there was no produced tests report. |
webui unit tests fail with grunt-contrib-qunit: ``` Testing test/all_tests.html >> Error: Error: QUnit has already been defined. >> at exportQUnit (file:///home/test/freeipa/install/ui/js/qunit.js:2475:12) >> at file:///home/test/freeipa/install/ui/js/qunit.js:2946:3 >> at file:///home/test/freeipa/install/ui/js/qunit.js:5061:2 >> Error: TypeError: Cannot set properties of undefined (setting 'reorder') >> at <anonymous>:175:24 >> at runFactory (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:17157) >> at execModule (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:19541) >> at file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:20002 >> at guardCheckComplete (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:19707) >> at checkComplete (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:19854) >> at onLoadCallback (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:22296) >> at HTMLScriptElement.onLoad (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:26209) ``` Load `qunit` with `dojo.require` that among other useful things helps > Preventing loading Dojo packages twice. dojo.require will simply return if the package is already loaded. See also https://github.com/gruntjs/grunt-contrib-qunit#loading-qunit-with-amd Related: https://pagure.io/freeipa/issue/9329 Signed-off-by: Stanislav Levin <[email protected]>
It's helpful for debugging regressions. Related: https://pagure.io/freeipa/issue/9329 Signed-off-by: Stanislav Levin <[email protected]>
Updated qunit to latest supported version from https://code.jquery.com/qunit. See https://qunitjs.com/intro/#release-channels for details. Related: https://pagure.io/freeipa/issue/9329 Signed-off-by: Stanislav Levin <[email protected]>
b3ac2d4
to
35c57a2
Compare
There are several unrelated to this PR warnings/errors in FF/Chromium, but I think it's ok as it is. |
@stanislavlevin
|
@flo-renaud, thank you! |
Related: https://pagure.io/freeipa/issue/9329