Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove faulty MockaHooks.afterAll() code from E2E typescript tests #22977

Merged
merged 5 commits into from
May 22, 2024

Conversation

dmytro-ndp
Copy link
Contributor

@dmytro-ndp dmytro-ndp commented May 21, 2024

What does this PR do?

It is removing faulty MockaHook.afterAll() code:

  1. deleteAllWorkspacesOnFinish() is a redundant workspace clean up after all test run, and it's producing multiple error messages Failed to send log. Error: Item with tempId "undefined" not found in the test execution log:
14:23:46  Failed to send log. Error: Item with tempId "undefined" not found
14:23:46      at RPClient.sendLogWithoutFile (/tmp/e2e/node_modules/@reportportal/client-javascript/lib/report-portal-client.js:686:9)
14:23:46      at RPClient.sendLog (/tmp/e2e/node_modules/@reportportal/client-javascript/lib/report-portal-client.js:666:17)
14:23:46      at ReportportalAgent.sendLog (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/mochaReporter.js:124:39)
14:23:46      at ReportportalAgent.sendTestItemLog (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/mochaReporter.js:116:10)
14:23:46      at process.emit (node:events:513:28)
14:23:46      at process.emit (node:domain:489:12)
14:23:46      at process.emit.sharedData.processEmitHook.installedValue [as emit] (/tmp/e2e/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
14:23:46      at Function.addLog (/tmp/e2e/node_modules/@reportportal/client-javascript/lib/publicReportingAPI.js:45:13)
14:23:46      at Object.log (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/publicReportingAPI.js:23:30)
14:23:46      at Object.trace (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/publicReportingAPI.js:26:48)
14:23:46      at Function.trace (/tmp/e2e/utils/Logger.ts:108:10)
14:23:46      at Context.deleteAllWorkspacesOnFinish (/tmp/e2e/specs/MochaHooks.ts:134:13)
14:23:46      at callFn (/tmp/e2e/node_modules/mocha/lib/runnable.js:366:21)
14:23:46      at Hook.Runnable.run (/tmp/e2e/node_modules/mocha/lib/runnable.js:354:5)
14:23:46      at next (/tmp/e2e/node_modules/mocha/lib/runner.js:510:10)
14:23:46      at Immediate.<anonymous> (/tmp/e2e/node_modules/mocha/lib/runner.js:571:5)
14:23:46      at processImmediate (node:internal/timers:466:21)

Actually, E2E typescript tests have already had workspace clean up step, e.g. https://github.com/eclipse-che/che/blob/main/tests/e2e/specs/dashboard-samples/RecommendedExtensions.spec.ts#L217:

18:04:18    2) Check if recommended extensions installed for Java Lombok 
18:04:18         "after all" hook: Stop and delete the workspace by API for "Check if extensions are installed and enabled":
18:04:18       Error: Request failed with status code 404
18:04:18        at createError (/tmp/e2e/node_modules/axios/lib/core/createError.js:16:15)
18:04:18        at settle (/tmp/e2e/node_modules/axios/lib/core/settle.js:17:12)
18:04:18        at IncomingMessage.handleStreamEnd (/tmp/e2e/node_modules/axios/lib/adapters/http.js:312:11)
18:04:18        at IncomingMessage.emit (node:events:529:35)
18:04:18        at IncomingMessage.emit (node:domain:489:12)
18:04:18        at endReadableNT (node:internal/streams/readable:1400:12)
18:04:18        at processTicksAndRejections (node:internal/process/task_queues:82:21)

Test run of fixed code: https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/Testing/job/e2e/job/basic/job/typescript-tests/22454/console

  1. removeTheDriver() makes no sense at the end, IMHO, and it throws an error NoSuchSessionError: Unable to find session, e.g. https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/Testing/job/e2e/job/basic/job/typescript-tests/22468/console
19:38:32    1) Create predefined workspace and check it 
19:38:32         Create test DevWorkspace and verify its creation within the predefined namespace:
19:38:32       AssertionError: expected '' to include 'condition met'
19:38:32        at Context.<anonymous> (/tmp/e2e/specs/miscellaneous/PredefinedNamespace.spec.ts:79:72)
19:38:32        at callFn (/tmp/e2e/node_modules/mocha/lib/runnable.js:366:21)
19:38:32        at Test.Runnable.run (/tmp/e2e/node_modules/mocha/lib/runnable.js:354:5)
19:38:32        at Runner.runTest (/tmp/e2e/node_modules/mocha/lib/runner.js:678:10)
19:38:32        at /tmp/e2e/node_modules/mocha/lib/runner.js:801:12
19:38:32        at next (/tmp/e2e/node_modules/mocha/lib/runner.js:593:14)
19:38:32        at /tmp/e2e/node_modules/mocha/lib/runner.js:603:7
19:38:32        at next (/tmp/e2e/node_modules/mocha/lib/runner.js:486:14)
19:38:32        at Immediate._onImmediate (/tmp/e2e/node_modules/mocha/lib/runner.js:571:5)
19:38:32        at processImmediate (node:internal/timers:476:21)
19:38:32  
19:38:32    2) "after each" hook: deleteWorkspaceOnFailedTest for "Create test DevWorkspace and verify its creation within the predefined namespace":
19:38:32       Error: Could not obtain _oauth_proxy cookie from chromedriver, browser session may have been killed. No stored token present!
19:38:32        at CheMultiuserAuthorizationHeaderHandler.get (/tmp/e2e/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts:41:11)
19:38:32        at processTicksAndRejections (node:internal/process/task_queues:95:5)
19:38:32        at async CheApiRequestHandler.get (/tmp/e2e/utils/request-handlers/CheApiRequestHandler.ts:97:57)
19:38:32        at async ApiUrlResolver.obtainUserNamespace (/tmp/e2e/utils/workspace/ApiUrlResolver.ts:41:46)
19:38:32        at async ApiUrlResolver.getWorkspacesApiUrl (/tmp/e2e/utils/workspace/ApiUrlResolver.ts:33:29)
19:38:32        at async ApiUrlResolver.getWorkspaceApiUrl (/tmp/e2e/utils/workspace/ApiUrlResolver.ts:29:13)
19:38:32        at async TestWorkspaceUtil.stopWorkspaceByName (/tmp/e2e/utils/workspace/TestWorkspaceUtil.ts:71:39)
19:38:32        at async TestWorkspaceUtil.stopAndDeleteWorkspaceByName (/tmp/e2e/utils/workspace/TestWorkspaceUtil.ts:139:3)
19:38:32        at async Context.deleteWorkspaceOnFailedTest (/tmp/e2e/specs/MochaHooks.ts:124:6)
19:38:32  
19:38:32    3) "after all" hook: stopTheDriver in "{root}":
19:38:32       NoSuchSessionError: Unable to find session with ID: 0c1e7902dcc65894356cac59199ebc5c
19:38:32  Build info: version: '4.18.1', revision: 'b1d3319b48'
19:38:32  System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-513.24.1.el8_9.x86_64', java.version: '11.0.21'
19:38:32  Driver info: driver.version: unknown
19:38:32        at Object.throwDecodedError (/tmp/e2e/node_modules/selenium-webdriver/lib/error.js:524:15)
19:38:32        at parseHttpResponse (/tmp/e2e/node_modules/selenium-webdriver/lib/http.js:587:13)
19:38:32        at Executor.execute (/tmp/e2e/node_modules/selenium-webdriver/lib/http.js:515:28)
19:38:32        at processTicksAndRejections (node:internal/process/task_queues:95:5)
19:38:32        at async thenableWebDriverProxy.execute (/tmp/e2e/node_modules/selenium-webdriver/lib/webdriver.js:741:17)
19:38:32        at async Object.thenFinally [as finally] (/tmp/e2e/node_modules/selenium-webdriver/lib/promise.js:100:5)
19:38:32        at async DriverHelper.quit (/tmp/e2e/utils/DriverHelper.ts:749:3)
19:38:32        at async Context.stopTheDriver (/tmp/e2e/specs/MochaHooks.ts:148:5)
19:38:32  
19:38:32  
19:38:32  
19:38:32  Failed to send log. Error: Item with tempId "undefined" not found
19:38:32      at RPClient.sendLogWithoutFile (/tmp/e2e/node_modules/@reportportal/client-javascript/lib/report-portal-client.js:686:9)
19:38:32      at RPClient.sendLog (/tmp/e2e/node_modules/@reportportal/client-javascript/lib/report-portal-client.js:666:17)
19:38:32      at ReportportalAgent.sendLog (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/mochaReporter.js:124:39)
19:38:32      at ReportportalAgent.sendTestItemLog (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/mochaReporter.js:116:10)
19:38:32      at process.emit (node:events:517:28)
19:38:32      at process.emit (node:domain:489:12)
19:38:32      at process.emit.sharedData.processEmitHook.installedValue [as emit] (/tmp/e2e/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
19:38:32      at Function.addLog (/tmp/e2e/node_modules/@reportportal/client-javascript/lib/publicReportingAPI.js:45:13)
19:38:32      at Object.log (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/publicReportingAPI.js:23:30)
19:38:32      at Object.error (/tmp/e2e/node_modules/@reportportal/agent-js-mocha/lib/publicReportingAPI.js:30:48)
19:38:32      at Function.error (/tmp/e2e/utils/Logger.ts:26:10)
19:38:32      at Runner.<anonymous> (/tmp/e2e/utils/CheReporter.ts:126:11)

Test run of fixed code: https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/Testing/job/e2e/job/basic/job/typescript-tests/22492/console

Functional test run: https://main-jenkins-csb-crwqe.apps.ocp-c1.prod.psi.redhat.com/job/Testing/job/e2e/job/complex/job/latest/job/functional-tests/1355/console

Screenshot/screencast of this PR

What issues does this PR fix or reference?

#22648

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@dmytro-ndp dmytro-ndp marked this pull request as draft May 21, 2024 18:20
@dmytro-ndp dmytro-ndp changed the title Che 22648 Fix ReportPortal library error: 'Item with tempId "undefined" not found' May 21, 2024
@dmytro-ndp dmytro-ndp changed the title Fix ReportPortal library error: 'Item with tempId "undefined" not found' Remove faulty MockaHooks.afterAll() code from E2E typescript tests May 21, 2024
@dmytro-ndp dmytro-ndp marked this pull request as ready for review May 21, 2024 21:06
@dmytro-ndp dmytro-ndp merged commit 173d01d into main May 22, 2024
5 checks passed
@dmytro-ndp dmytro-ndp deleted the che-22648 branch May 22, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants