ArnaudBuchholz / ui5-test-runner

A test runner for UI5 applications enabling parallel execution of tests.
https://arnaudbuchholz.github.io/ui5-test-runner/
MIT License
22 stars 9 forks source link

Serialization issue on big job definition #92

Closed ArnaudBuchholz closed 5 months ago

ArnaudBuchholz commented 5 months ago
[ui5:test:executor] [████████░░]  87% http://localhost:8080/test/opaTests.qunit.html
[ui5:test:executor] [█████░░░░░]  50% ⠙ Executing test pages
[ui5:test:executor] 10:55 << http://localhost:8080/test/opaTests.qunit.html    (10:41) [tz33vWePi8M]
[ui5:test:executor]
[ui5:test:executor] 10:55 │ Generating reports
[ui5:test:executor] ──────┴───────────────────
[ui5:test:executor] ┌──────────────────────────────────────────────────────────────────────────────┐
[ui5:test:executor] │ UNEXPECTED ERROR                                                             │
[ui5:test:executor] ├──────────────────────────────────────────────────────────────────────────────┤
[ui5:test:executor] │ RangeError: Invalid string length                                            │
[ui5:test:executor] │     at JSON.stringify (<anonymous>)                                          │
[ui5:test:executor] │     at serialize (C:\SAPDevelop\git\record-service-ui\ui-recordService\node↵ │
[ui5:test:executor] │ _modules\ui5-test-runner\src\report.js:11:83)                                │
[ui5:test:executor] │     at save (C:\SAPDevelop\git\record-service-ui\ui-recordService\node_modu↵ │
[ui5:test:executor] │ les\ui5-test-runner\src\report.js:20:9)                                      │
[ui5:test:executor] │     at generate (C:\SAPDevelop\git\record-service-ui\ui-recordService\node_↵ │
[ui5:test:executor] │ modules\ui5-test-runner\src\report.js:40:11)                                 │
[ui5:test:executor] │     at process (C:\SAPDevelop\git\record-service-ui\ui-recordService\node_m↵ │
[ui5:test:executor] │ odules\ui5-test-runner\src\tests.js:127:9)                                   │
[ui5:test:executor] │     at async notifyAndExecuteTests (C:\SAPDevelop\git\record-service-ui\ui-↵ │
[ui5:test:executor] │ recordService\node_modules\ui5-test-runner\index.js:26:5)                    │
[ui5:test:executor] │     at async EventEmitter.<anonymous> (C:\SAPDevelop\git\record-service-ui\↵ │
[ui5:test:executor] │ ui-recordService\node_modules\ui5-test-runner\index.js:66:7)                 │
[ui5:test:executor] └──────────────────────────────────────────────────────────────────────────────┘
[ui5:test:executor] npm run ui5:test:executor exited with code 0

Qualification : the job's JSON is too big to be serialized with JSON.stringify

Alternatives :

heimwege commented 5 months ago

Can confirm that Opa5.assert.ok(ui5Control) was the root cause for this huge JSON

ArnaudBuchholz commented 5 months ago

I still believe the runner should filter out these unnecessary values from the job report.

ArnaudBuchholz commented 5 months ago

Actually, this is a problem with UI5 objects detection that does not work in OPA with iFrames (because the base class are not the same between the OPA window and the application window). Used a safer method based on UI5 object known members (getId, getMetadata)

ArnaudBuchholz commented 5 months ago

Closing the incident as the initial problem is solved. Being able to generate a bigger JSON could be interesting but would cause other problems (such as the report generator that must be able to load the serialized the JSON).