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

Bug 514368

Summary: 'Quick Fix Commands' tests are failing
Product: [ECD] Orion Reporter: Remy Suen <remy.suen>
Component: ClientAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: curtis.windatt.public, steve_northover
Version: 13.0   
Target Milestone: 15.0   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Remy Suen CLA 2017-03-29 01:29:02 EDT
They seem to have been failing for about half a year. I imagine this was originally caused by the fix for bug 496020?

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=78f112068abc894be1946e47cbaf0f31773371cb

A change was made so that a command invocation's user data was extended to be more than simply an annotation model.

https://github.com/eclipse/orion.client/blob/2e69ff0f911935032e07f4c463a2d9e044a19720/bundles/org.eclipse.orion.client.ui/web/orion/commands.js#L301

However, the two quick fix tests were never updated.

https://github.com/eclipse/orion.client/blob/3f256ab112f1d3f127b674a8da63eee671e57e8a/bundles/org.eclipse.orion.client.ui/web/js-tests/ui/commands/commandsTests.js#L567

https://github.com/eclipse/orion.client/blob/3f256ab112f1d3f127b674a8da63eee671e57e8a/bundles/org.eclipse.orion.client.ui/web/js-tests/ui/commands/commandsTests.js#L589

--------------------------

Test commands

Quick Fix Commands

Render a quickfix button
TypeError: Cannot read property 'data' of undefined
    at Object.createQuickfixItem (http://localhost:8081/orion/commands.js:249:44)
    at http://localhost:8081/orion/commandRegistry.js:1302:29
    at Array.forEach (native)
    at CommandRegistry._render (http://localhost:8081/orion/commandRegistry.js:1077:21)
    at CommandRegistry.renderCommands (http://localhost:8081/orion/commandRegistry.js:1018:10)
    at http://localhost:8081/orion/commandRegistry.js:1012:12
    at Selection.getSelections (http://localhost:8081/orion/selection.js:57:5)
    at CommandRegistry.renderCommands (http://localhost:8081/orion/commandRegistry.js:1011:23)
    at Context.<anonymous> (http://localhost:8081/js-tests/ui/commands/commandsTests.js:567:22)
    at callFn (http://localhost:8081/mocha/mocha.js:4338:21)

Render a quickfix button with fix all 1
Error: Uncaught TypeError: Cannot read property 'data' of undefined (http://localhost:8081/orion/commands.js:249)
    at global.onerror (http://localhost:8081/mocha/mocha.js:5736:10)
Comment 1 Curtis Windatt CLA 2017-03-29 15:04:40 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=d17208d0a36fdb404cb97e1dcdb2df891d02181e
Fixed in master

I forgot about writing tests for the quickfix rendering as we have much more complete test suites on the language tooling side. All of the relevant user data should be inside an annotation object.