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

Fix and rework PredefinedNamespace test #22693

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Fix and rework PredefinedNamespace test #22693

merged 1 commit into from
Nov 28, 2023

Conversation

musienko-maxim
Copy link
Contributor

@musienko-maxim musienko-maxim commented Nov 24, 2023

What does this PR do?

  • This PR is removed using UI from the tests and works with API calls with oc/kubectl client and fixes logic errors (removing a Workspace from UI after deleting by API)

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-5345

How to test this PR?

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.

@che-bot che-bot added kind/bug Outline of a bug - must adhere to the bug report template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. target/branch Indicates that a PR will be merged into a branch other than master. labels Nov 24, 2023
@musienko-maxim musienko-maxim changed the title Fix and rework PredefinedNamespace Fix and rework PredefinedNamespace test Nov 24, 2023
@dmytro-ndp
Copy link
Contributor

dmytro-ndp commented Nov 24, 2023

IMHO, replacement of UI test with API test is too big change for the task to target issue: "fix test workspace removal after the test execution".
New test scenario is not actually covering Dashboard and Che server behavior when there is pre-defined user namespace.

What do you think about only removal of the next suites, which don't make sense after user workspace and namespace have been removed from cluster in previous suiteTeardown():

	suiteTeardown('Re-login with test user', async function (): Promise<void> {
		if (OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME !== userName) {
			await loginTests.logoutFromChe();
			await loginTests.loginIntoChe();
		}
	});

	suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
		await dashboard.openDashboard();
		await browserTabsUtil.closeAllTabsExceptCurrent();
	});

	suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
		await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
	});

?

P.S. Test screencast shows another problem - workspace failed to start:
Screenshot from 2023-11-24 19-14-02

output.32.webm

Did you try to reproduce the error manually?

@musienko-maxim
Copy link
Contributor Author

musienko-maxim commented Nov 24, 2023

I can't entirely agree with saving the UI part.
This test is not responsible for communicating with the dashboard. One reason for creating a workspace from the dashboard was the absence of the possibility generating DevFiles. The main goal of the test is to check that a DW object is created in the dedicated Openshift project.
About the error on the screencast, I ran the test on my latest instance manually: create the Predefined NS by oc client and create the Empty workspace from the Dashboard - this problem was not reproduced.
I can check it manually one more time - to make sure 100% that the problem on the screencast is not reproduced.

@dmytro-ndp
Copy link
Contributor

dmytro-ndp commented Nov 24, 2023

@musienko-maxim : the test was initially created to check user namespace provisioning using Dashboard.

@ibuziuk, @l0rd: could you, please, say if it would be enough to test user namespace provisioning at DevWorkspace level only not using Che Dashboard and Che Server?

Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

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

+1 to remove the UI logic and fallback on oc / kubect

@musienko-maxim musienko-maxim merged commit fcfd29d into main Nov 28, 2023
2 checks passed
@musienko-maxim musienko-maxim deleted the CRW-5345 branch November 28, 2023 04:42
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. target/branch Indicates that a PR will be merged into a branch other than master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants