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

Bug 444131

Summary: uiTests suite hangs from auth redirect
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: RelengAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 6.0   
Target Milestone: 7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2014-09-15 10:54:52 EDT
Recent conversions of the unit tests to mocha have caused the uiTests suite to time out and fail. It began in build #466 [1].

To reproduce:
1. Open an Incognito window and load http://[orion-server]/js-tests/ui/uiTest.html 
2. You get redirected to the login page. I expected to see the tests load and run.

The redirect causes a failure at test time, since the test runner doesn't provide the login page, nor the auth back-end, nor any way to fill in the login form.

What is happening, in detail:

1. A test case calls startup() from bootstrap.js
 -> Culprit is probably i18nTests.js, see test "I18nService"
2. bootstrap creates Plugin Registry, default plugins are loaded
3. bootstrap asks auth provider (authenticationPlugin) if user is logged in
4. authenticationPlugin calls POST /login to check

At this point the behavior differs a bit between servers: a real Orion server will send 401 Unauthorized, which causes a redirect to LoginWindow.html. The test server doesn't have a /login handler, so just returns a generic 404, which causes an unhandled rejection to the getUser() service call. In both cases the end result is the same: tests hang until timeout.

Anyway, this must be fixed. The tests cannot depend on the back end. At present this means they cannot load bootstrap.js.

[1] https://hudson.eclipse.org/orion/job/orion-client-dev/466/
Comment 1 Mark Macdonald CLA 2014-09-15 11:25:16 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=bc804c6

Should be fixed
Comment 2 Mark Macdonald CLA 2014-09-15 12:28:52 EDT
Wasn't enough. Have to remove the i18n tests completely, they are just inherently broken.
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=b226b0a