Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#34053 closed Cleanup/optimization (needsinfo)

JS tests depend on Cloudflare CDN for every run

Reported by: Hugo Herter Owned by: nobody
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Claude Paroz, Daniel Hahler Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Running the Javascript tests requires an internet connection to https://cdnjs.cloudflare.com .

This makes the tests dependent on an extra third party, provides that third party with the IP address of developers and test runners, and prevents developers from running the tests without a connection to Cloudflare.

The relevant line is in js_tests/tests.html:

<script src='https://cdnjs.cloudflare.com/ajax/libs/ol3/4.6.5/ol.js'></script>

How to reproduce

  1. Install the dependencies using npm

git clone https://github.com/django/django.git
cd django/
npm install

  1. Serve the page via a web server and open in in a browser

python3 -m http.server --bind 127.0.0.1

Open http://localhost:8000 with the network inspector open.

Change History (3)

comment:1 by Hugo Herter, 2 years ago

Summary: JS tests don't work without an internet connectionJS tests depend on Cloudflare CDN for every run

comment:2 by Mariusz Felisiak, 2 years ago

Cc: Claude Paroz Daniel Hahler added
Easy pickings: unset
Resolution: needsinfo
Status: newclosed
Type: BugCleanup/optimization

This was intentionally changed in b1d6b0a7b121eec860b518b4903d7c8c74f7773b (see also #26098). I'm not sure what kind of alternative you're proposing, we definitely don't want to copy OpenLayers.js to the Django repository. It's also documented that cdnjs.cloudflare.com is used for OpenLayersWidget.

comment:3 by Claude Paroz, 2 years ago

I'm not very happy, too, to have this connection on test runs, but as Mariusz said, we do not have satisfying alternatives yet. I hope that in the future, we might have some way of local caching of such external dependencies.

Note: See TracTickets for help on using tickets.
Back to Top