Skip to content

Automates "start workspace using IntelliJ IDEA Editors" test#23765

Open
olkornii wants to merge 7 commits intoeclipse-che:mainfrom
olkornii:CRW-9410-final
Open

Automates "start workspace using IntelliJ IDEA Editors" test#23765
olkornii wants to merge 7 commits intoeclipse-che:mainfrom
olkornii:CRW-9410-final

Conversation

@olkornii
Copy link
Copy Markdown
Contributor

@olkornii olkornii commented Mar 5, 2026

olkornii added 4 commits March 4, 2026 14:01
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
@olkornii olkornii marked this pull request as draft March 5, 2026 14:07
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
@olkornii olkornii marked this pull request as ready for review March 5, 2026 18:47
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);

const titlexPath: string = '/html/body/h1';
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The XPath '/html/body/h1' of the title looks too common, as it doesn't contain any workspace- or editor-specific information to distinguish it from other regular HTML page.

What do you think about an XPath which checks for the presence of HTML code like h1>Workspace (workspace name) is running</h1>?

Copy link
Copy Markdown
Contributor Author

@olkornii olkornii Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'/html/body/h1' XPath is exactly an XPath of HTML code "h1>Workspace (workspace name) is running</h1". There is a check for exact text: https://github.com/eclipse-che/che/pull/23765/changes#diff-732c71179bfd939d6b555b70a9ce4b4f28264ba1f6bedc94a9b2756d48a2fe42R118

@dmytro-ndp
Copy link
Copy Markdown
Contributor

dmytro-ndp commented Mar 5, 2026

@olkornii: taking into account that the test script contains 104 separate test runs, it would be useful not to stop test execution if one of the tests fails, but rather continue running follow up test and then collect test failures to display at the end.
There is a setting "bail: false", which can help.

@dmytro-ndp
Copy link
Copy Markdown
Contributor

dmytro-ndp commented Mar 24, 2026

@olkornii: FYI: StartWorkspaceUsingIntellijIdeEditor test runs against online and airgap DS 3.27.0-RC.03.16 have passed.

Good job!

Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
@olkornii
Copy link
Copy Markdown
Contributor Author

@olkornii: taking into account that the test script contains 104 separate test runs, it would be useful not to stop test execution if one of the tests fails, but rather continue running follow up test and then collect test failures to display at the end. There is a setting "bail: false", which can help.

there is a parameter: "MOCHA_BAIL=false". It is what we need. Works as expected.

Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
editor: string,
sampleName: string,
xPath: string,
polling: number = TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

polling is the default delay between tries in milliseconds between tries

TS_SELENIUM_START_WORKSPACE_TIMEOUT is not suitable here

editor: string,
sampleUrl: string,
xPath: string,
polling: number = TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger.info('Delete DevWorkspace. After each test.');
if (currentTabHandle !== 'undefined') {
await browserTabsUtil.switchToWindow(currentTabHandle);
}
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When bail: false, if testWorkspaceStartup fails after opening a new tab but before the workspace name is captured, getWorkspaceName() returns 'undefined' and teardown skips deletion.

This leaves an orphaned running workspace. With 117+ test combinations and bail: false, multiple orphans could accumulate and exhaust cluster resources or cause cascading failures.

Consider using kubernetesCommandLineToolsExecutor in teardown to clean up by workspace name prefix or label as a fallback.

Suggested change
}
} else {
// fallback: delete DevWorkspace by CLI when name wasn't captured
Logger.warn('Workspace name was not captured. Attempting cleanup via CLI.');
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
}

@dmytro-ndp
Copy link
Copy Markdown
Contributor

It's interesting to see test failures when the parameter "MOCHA_BAIL=false" is set.

To simulate this situation, you can set a non-existent Git URL in the gitRepoUrlsToCheck variable, and a non-existent sample name.

@dmytro-ndp dmytro-ndp closed this Mar 29, 2026
@dmytro-ndp dmytro-ndp reopened this Mar 29, 2026
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