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

[Test] Update 'Factory' E2E test #23311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[Test] Update 'Factory' E2E test #23311

wants to merge 1 commit into from

Conversation

artaleks9
Copy link
Contributor

What does this PR do?

  • Updates the Factory E2E test to do checking test-cases of factory with gitlab server private repo when OAuth token is expired.
  • Adds new environment variable: DELETE_WORKSPACE_ON_SUCCESSFUL_TEST to tests/e2e/constants/BASE_TEST_CONSTANTS.ts
  • Adds new environment variable: IS_RESTART_EXISTING_WORKSPACE to tests/e2e/constants/BASE_TEST_CONSTANTS.ts

Screenshot/screencast of this PR

What issues does this PR fix or reference?

How to test this PR?

Run the Factory.spec.ts as usual

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.

@artaleks9 artaleks9 requested review from SkorikSergey and removed request for musienko-maxim January 10, 2025 12:26
@artaleks9 artaleks9 self-assigned this Jan 10, 2025
@artaleks9 artaleks9 added area/qe status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Jan 10, 2025
registerRunningWorkspace('');
});
} else {
suiteTeardown('Registering the running workspace', function (): void {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Jan 10, 2025

Choose a reason for hiding this comment

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

IMHO, this step is redundant and could be committed.

@@ -130,6 +132,16 @@ export const BASE_TEST_CONSTANTS: {
*/
DELETE_WORKSPACE_ON_FAILED_TEST: process.env.DELETE_WORKSPACE_ON_FAILED_TEST === 'true',

/**
* stop and remove workspace if a test is successful.
Copy link
Contributor

Choose a reason for hiding this comment

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

let's add the comment that , true by default to make it clear

DELETE_WORKSPACE_ON_SUCCESSFUL_TEST: process.env.DELETE_WORKSPACE_ON_SUCCESSFUL_TEST !== 'false',

/**
* restart existing workspace.
Copy link
Contributor

@dmytro-ndp dmytro-ndp Jan 10, 2025

Choose a reason for hiding this comment

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

More relevant comment could be Select opening an existing workspace instead of creating a new one if a duplicate workspace is created from the factory or sample list. This option is false by default.

/**
* restart existing workspace.
*/
IS_RESTART_EXISTING_WORKSPACE: process.env.IS_RESTART_EXISTING_WORKSPACE === 'true',
Copy link
Contributor

@dmytro-ndp dmytro-ndp Jan 10, 2025

Choose a reason for hiding this comment

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

IMHO, the more relevant constant name is SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW

@@ -88,6 +88,13 @@ suite(
});
}

if (BASE_TEST_CONSTANTS.IS_RESTART_EXISTING_WORKSPACE) {
test('Restart existing workspace', async function (): Promise<void> {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Jan 10, 2025

Choose a reason for hiding this comment

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

'Restart existing workspace' -> Select opening an existing workspace instead of creating a new one.

@artaleks9
Copy link
Contributor Author

@dmytro-ndp, I think that all comments need to be accepted.
Will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qe status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants