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: change the way to distinguish between prod and dev environment #1935

Closed
wants to merge 2 commits into from

Conversation

odockal
Copy link
Contributor

@odockal odockal commented Apr 4, 2023

What does this PR do?

Changes the way how to distinguish between PROD and DEV environment when running e2e tests.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

#1780

How to test this PR?

yarn 
yarn test:e2e -> watch for a properly initialized podman-desktop

We just make sure to run e2e tests properly, when we distinguish between prod and dev environment. Some icons were not loaded properly when playwright tests were executed and so the app never loaded up.

 - change statically replaced condition (import.meta.env.PROD) with a runtime node process variable
 - fixes mainly e2e tests
 - fixes containers#1780

Signed-off-by: Ondrej Dockal <odockal@redhat.com>
Signed-off-by: Ondrej Dockal <odockal@redhat.com>
@odockal odockal requested review from a team and benoitf as code owners April 4, 2023 12:01
@odockal odockal requested review from jeffmaury and lstocchi and removed request for a team April 4, 2023 12:01
@odockal
Copy link
Contributor Author

odockal commented Apr 4, 2023

I believe that test part will fail on #1908.

@odockal odockal changed the title Issue 1780 @odockal (fix): change the way to distinguish between prod and dev environment Apr 4, 2023
@odockal odockal changed the title @odockal (fix): change the way to distinguish between prod and dev environment (fix): change the way to distinguish between prod and dev environment Apr 4, 2023
@odockal odockal changed the title (fix): change the way to distinguish between prod and dev environment fix(: change the way to distinguish between prod and dev environment Apr 4, 2023
@odockal odockal changed the title fix(: change the way to distinguish between prod and dev environment fix: change the way to distinguish between prod and dev environment Apr 4, 2023
// in production mode, use the extensions locally
folders = await this.readProductionFolders(path.join(__dirname, '../../../extensions'));
} else {
if (process.env.NODE_ENV && (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to not have these lines. I need to investigate to be able to use meta.env

because we've a lot of meta.env usage in Podman Desktop

@benoitf
Copy link
Collaborator

benoitf commented May 25, 2023

closing as it was fixed by adding NODE_ENV=development MODE=development when executing e2e tests (and then not changing the Podman Desktop code)

@benoitf benoitf closed this May 25, 2023
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