Skip to content

fix: pass required env variables for new driver#774

Merged
aslushnikov merged 2 commits intomicrosoft:mainfrom
aslushnikov:pass-env-everywhere
Jan 19, 2022
Merged

fix: pass required env variables for new driver#774
aslushnikov merged 2 commits intomicrosoft:mainfrom
aslushnikov:pass-env-everywhere

Conversation

@aslushnikov
Copy link
Copy Markdown
Contributor

@aslushnikov aslushnikov commented Jan 15, 2022

Fixes #772

APIResponse response = request.get(server.EMPTY_PAGE);
assertTrue(response.ok());
assertEquals(server.EMPTY_PAGE, response.url());
assertTrue(serverRequest.get().headers.get("user-agent").get(0).contains("java"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also check version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done


public static void setRequiredEnvironmentVariables(ProcessBuilder pb) {
if (!pb.environment().containsKey("PW_CLI_TARGET_LANG")) {
pb.environment().put("PW_CLI_TARGET_LANG", "java");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks like PW_CLI_TARGET_LANG /PW_CLI_TARGET_LANG_VERSION are used beyond just codegen, let's rename them (in separate pr) to PW_LANG / PW_LANG_VERSION before it's too late?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let's do this in a follow-up and on tip-of-tree only.

I filed an issue for myself regarding this: microsoft/playwright#11450

Copy link
Copy Markdown
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

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

Looks good, the test is failing though

@aslushnikov aslushnikov merged commit 6b30c0b into microsoft:main Jan 19, 2022
@aslushnikov aslushnikov deleted the pass-env-everywhere branch January 19, 2022 13:15
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.

internal: setup env variables when launching driver

2 participants