Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 476246

Summary: URL-shim breaks URLs
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: mamacdon, Silenio_Quarti, simon_kaegi
Version: 10.0   
Target Milestone: 10.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
unit test none

Description Michael Rennie CLA 2015-08-31 12:13:52 EDT
While working on cross-file unit tests, I was trying to use orion/xhr.

Once I imported it in to my test file, the test worker would fail to load. The reason being is that oriron/xhr sucks in URL-shim, which is breaking URLs.

For example, I use the following URL to start the worker:

new URL("../../javascript/plugins/ternWorker.js", window.location.href);

in the most common case (running the suite itself) window.location.href will be:

"http://mrennie-unit-tests.orion.eclipse.org:9000"

sometimes if running a particular set of tests it can be something like:

"http://mrennie-unit-tests.orion.eclipse.org:9000/JsMochaSuite.html?grep=Cross-file%20Tests".

Without orion/xhr (and URL-shim) this works 100% across all browsers.

With orion/xhr (and URL-shim) you only get this failure:

"before all" hook: Message the server for warm up on cross file tests ‣
Error: Failed to construct 'Worker': 'http://mrennie-unit-tests.orion.eclipse.org:9000javascript/plugins/ternWorker.js' is not a valid URL.
    at Error (native)
    at new WrappedWorker (http://mrennie-unit-tests.orion.eclipse.org:9000/js-tests/javascript/testingWorker.js:41:21)
    at Object.instance (http://mrennie-unit-tests.orion.eclipse.org:9000/js-tests/javascript/testingWorker.js:95:20)
    at Context.<anonymous> (http://mrennie-unit-tests.orion.eclipse.org:9000/js-tests/javascript/crossFileTests.js:171:28)
    at Hook.Runnable.run (http://mrennie-unit-tests.orion.eclipse.org:9000/mocha/mocha.js:4311:15)
    at next (http://mrennie-unit-tests.orion.eclipse.org:9000/mocha/mocha.js:4613:10)
    at http://mrennie-unit-tests.orion.eclipse.org:9000/mocha/mocha.js:4630:5
    at timeslice (http://mrennie-unit-tests.orion.eclipse.org:9000/mocha/mocha.js:5761:27)

Notice the URL is missing a '/' after the port.
Comment 1 Mark Macdonald CLA 2015-08-31 12:27:01 EDT
Created attachment 256268 [details]
unit test

Here's a unit test showing the failure
Comment 2 Simon Kaegi CLA 2015-09-01 12:10:43 EDT
Fixed in Master.