ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14k stars 3.42k forks source link

Failed to execute 'importScripts' on 'WorkerGlobalScope' while running cypress tests on mesh viz #11893

Closed tiagodread closed 2 years ago

tiagodread commented 2 years ago

Please confirm the following

Summary

After moving the mesh processing to a webworker, cypress tests started failing due to the fact that the application is throwing an uncaught exception error, by default, any uncaught exception break cypress tests:

979.b39b9098.chunk.js:1 Refused to load the script 'https://d3js.org/d3-collection.v1.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-RhtefIBH/OC8ec7IdpessssIQfFtsOmRs+HVUGGjhG0=' *.pendo.io". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

and

VM3 979.b39b9098.chunk.js:1 Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://d3js.org/d3-collection.v1.min.js' failed to load.
    at https://localhost:8043/static/js/979.b39b9098.chunk.js:1:1

Please, note @nixocio comment in the original issue refering to this issue https://github.com/ansible/awx/pull/11501#pullrequestreview-905962055

Note: QE is blocking by this error on merging the E2E test PR for mesh viz

AWX version

devel

Select the relevant components

Installation method

docker on linux

Modifications

no

Ansible version

No response

Operating system

No response

Web browser

Chrome

Steps to reproduce

Run any cypress test in the mesh screen

Expected results

Test should run until completition

Actual results

Tests are failing because of a CSP violation being identified and throwing an uncaught exception error

Additional information

No response

tiagodread commented 2 years ago

Fixed by #11897, cypress now can access the topology view page successfully