-
Notifications
You must be signed in to change notification settings - Fork 78
feat(FR-1885): Replace hardcoded e2e test credentials with environment variables #4987
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
Conversation
|
|
1 similar comment
|
|
yomybaby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces hardcoded E2E test credentials and endpoints with environment variables, enabling configuration for different testing environments while maintaining backward compatibility through fallback defaults.
Key Changes:
- E2E test utilities now read from environment variables with fallback to original defaults
- New sample environment file documents all 12 configurable variables
- README documentation updated with environment configuration instructions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
e2e/utils/test-util.ts |
Replaced hardcoded endpoints and user credentials with environment variable lookups (using process.env.E2E_*) with fallback defaults |
e2e/envs/.env.playwright.sample |
Added comprehensive documentation for all 12 environment variables (2 endpoints + 10 user credentials) |
README.md |
Added "Environment Configuration" section under Playwright test with setup instructions and variable descriptions |
.claude/commands/create-jira-issue.md |
Removed "feat(FR-XXXX):" prefix from example description (appears unrelated to main PR purpose) |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
nowgnuesLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge activity
|
…t variables (#4987) Resolves #4993 ([FR-1885](https://lablup.atlassian.net/browse/FR-1885)) E2E test utilities had hardcoded endpoints and user credentials, preventing configuration for different testing environments. All values now use environment variables with fallback defaults. ## Changes **`e2e/utils/test-util.ts`** - Endpoints use `E2E_WEBUI_ENDPOINT` and `E2E_WEBSERVER_ENDPOINT` env vars - User credentials (admin, user, user2, monitor, domainAdmin) use `E2E_*_EMAIL` and `E2E_*_PASSWORD` env vars - All values fall back to original defaults when env vars unset **`e2e/envs/.env.playwright.sample`** - Documents all 12 environment variables with defaults **`README.md`** - Adds Environment Configuration section under Playwright test ## Example ```typescript // Before export const webuiEndpoint = 'http://127.0.0.1:9081'; export const userInfo = { admin: { email: '[email protected]', password: '-------', } }; // After export const webuiEndpoint = process.env.E2E_WEBUI_ENDPOINT || 'http://127.0.0.1:9081'; export const userInfo = { admin: { email: process.env.E2E_ADMIN_EMAIL || '[email protected]', password: process.env.E2E_ADMIN_PASSWORD || '-------', } }; ``` ## Usage Local development continues to work without changes. For custom environments: ```bash cp e2e/envs/.env.playwright.sample e2e/envs/.env.playwright # Edit .env.playwright with custom values ``` CI/CD can inject via environment: ```yaml env: E2E_WEBUI_ENDPOINT: ${{ secrets.TEST_WEBUI_ENDPOINT }} E2E_ADMIN_EMAIL: ${{ secrets.TEST_ADMIN_EMAIL }} ``` <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> e2e 테스트에서 사용하는 이 파일에 user에 대한 정보가 하드코딩되어 있다. 이를 환경변수가 지정되어 있는 경우 해당 값을 사용하고 없을 경우 기본 값을 사용하도록 개선해주세요. 뿐만아니라 webuiEndpoint 와 webServerEndpoint 도 e2e 실행하는 환경의 환경변수를 이용하도록 해주세요. The user has attached the following file paths as relevant context: - .github/instructions/e2e.instructions.md - .github/instructions/i18n.instructions.md - .github/copilot-instructions.md <analysis> [Chronological Review: The conversation began with the user requesting modifications to the `test-util.ts` file to replace hardcoded user information with environment variables. The user specified that if environment variables are not set, default values should be used. The user also requested that `webuiEndpoint` and `webServerEndpoint` be configured to use environment variables for the e2e testing environment. The user then canceled a previous command to delegate the task to a cloud agent.] [Intent Mapping: - User Request 1: "e2e 테스트에서 사용하는 이 파일에 user에 대한 정보가 하드코딩되어 있다. 이를 환경변수가 지정되어 있는 경우 해당 값을 사용하고 없을 경우 기본 값을 사용하도록 개선해주세요." - User Request 2: "뿐만아니라 webuiEndpoint 와 webServerEndpoint 도 e2e 실행하는 환경의 환경변수를 이용하도록 해주세요." - User Request 3: "Cancel: 'Delegate to cloud agent'"] [Technical Inventory: - File: `/Users/codejong/Workspace/lablup/webui/e2e/utils/test-util.ts` - Concepts: Environment variables, hardcoding, e2e testing configuration.] [Code Archaeology: - The user is focused on modifying the `test-util.ts` file, specifically lines 5 to 44, to implement the requested changes regarding user information and endpoints.] [Progress Assessment: - Completed: User has specified the need for changes to the `test-util.ts` file. - Pending: Implementation of the changes to use environment variables instead of hardcoded values.] [Context Validation: All critical information for continuation is captured, including user requests and the specific file being modified.] [Recent Commands Analysis: - Last Agent Commands: The user requested modifications to the `test-util.ts` file and subsequently canceled a command to delegate the task to a cloud agent. - Tool Results Summary: No specific tool results were generated as the user canceled the delegation command. - Pre-Summary State: The agent was actively working on understanding and implementing the user's requests regarding the `test-util.ts` file when the token budget was exceeded. - Operation Context: The commands executed were directly related to the user's goal of improving the e2e testing setup by using environment variables.] </analysis> <summary> 1. Conversation Overview: - Primary Objectives: - "e2e 테스트에서 사용하는 이 파일에 user에 대한 정보가 하드코딩되어 있다. 이를 환경변수가 지정되어 있는 경우 해당 값을 사용하고 없을 경우 기본 값을 사용하도록 개선해주세요." - "뿐만아니라 webuiEndpoint 와 webServerEndpoint 도 e2e 실행하는 환경의 환경변수를 이용하도록 해주세요." - Session Context: The user is focused on modifying the `test-util.ts` file to enhance its configuration for e2e testing by replacing hardcoded values with environment variables. - User Intent Evolution: The user initially requested specific changes to the file and later canceled a command to delegate the task to a cloud agent, indicating a desire to handle the modifications directly. 2. Technical Foundation: - File: `/Users/codejong/Workspace/lablup/webui/e2e/utils/test-util.ts` - Purpose: This file is used for e2e testing and contains user information that needs to be configurable via environment variables. - Current State: The user has selected lines 5 to 44 for modification. 3. Codebase Status: - File Name: `test-util.ts` - Purpose: To provide utility functions for e2e testing. - Current State: The user intends to modify the file to replace hardcoded user information and endpoints with environment variable configurations. - Key Code Segments: Specific lines (5 to 44) are targeted for changes. - Dependencies: The file's functionality is tied to the overall e2e testing framework. 4. Problem Resolution: - Issues Encountered: Hardcoded values in the `test-util.ts` file. - Solutions Implemented: The user has proposed a solution to use environment variables instead. - Debugging Context: No ongoing troubleshooting efforts were mentioned. - Lessons Learned: The importance of configurability in testing environments. 5. Progress Tracking: - Completed Tasks: User has articulated the need for changes to the `test-util.ts` file. - Partially Complete Work: The implementation of the requested changes is pending. 6. Active Work State: - Current Focus: Modifying the `test-util.ts` file to implement user requests regarding environment variables. - Recent Context: The user has been focused on the specific lines of code that need modification. - Working Code: The user has not yet provided specific code snippets for modification. - Immediate Context: The user was preparing to implement changes to the file when the token budget was exceeded. 7. Recent Operations: - Last Agent Commands: User requested modifications to the `test-util.ts` file and canceled a command to delegate the task. - Tool Results Summary: No spec... </details> <!-- START COPILOT CODING AGENT SUFFIX --> Created from [VS Code](https://code.visualstudio.com/docs/copilot/copilot-coding-agent). <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. [FR-1885]: https://lablup.atlassian.net/browse/FR-1885?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
51e0a55 to
7957ac8
Compare

Resolves #4993 (FR-1885)
E2E test utilities had hardcoded endpoints and user credentials, preventing configuration for different testing environments. All values now use environment variables with fallback defaults.
Changes
e2e/utils/test-util.tsE2E_WEBUI_ENDPOINTandE2E_WEBSERVER_ENDPOINTenv varsE2E_*_EMAILandE2E_*_PASSWORDenv varse2e/envs/.env.playwright.sampleREADME.mdExample
Usage
Local development continues to work without changes. For custom environments:
cp e2e/envs/.env.playwright.sample e2e/envs/.env.playwright # Edit .env.playwright with custom valuesCI/CD can inject via environment:
Original prompt
e2e 테스트에서 사용하는 이 파일에 user에 대한 정보가 하드코딩되어 있다. 이를 환경변수가 지정되어 있는 경우 해당 값을 사용하고 없을 경우 기본 값을 사용하도록 개선해주세요. 뿐만아니라 webuiEndpoint 와 webServerEndpoint 도 e2e 실행하는 환경의 환경변수를 이용하도록 해주세요.
The user has attached the following file paths as relevant context:
- .github/instructions/e2e.instructions.md
- .github/instructions/i18n.instructions.md
- .github/copilot-instructions.md
[Chronological Review: The conversation began with the user requesting modifications to the `test-util.ts` file to replace hardcoded user information with environment variables. The user specified that if environment variables are not set, default values should be used. The user also requested that `webuiEndpoint` and `webServerEndpoint` be configured to use environment variables for the e2e testing environment. The user then canceled a previous command to delegate the task to a cloud agent.][Intent Mapping:
[Technical Inventory:
/Users/codejong/Workspace/lablup/webui/e2e/utils/test-util.ts[Code Archaeology:
test-util.tsfile, specifically lines 5 to 44, to implement the requested changes regarding user information and endpoints.][Progress Assessment:
test-util.tsfile.[Context Validation: All critical information for continuation is captured, including user requests and the specific file being modified.]
[Recent Commands Analysis:
test-util.tsfile and subsequently canceled a command to delegate the task to a cloud agent.test-util.tsfile when the token budget was exceeded.1. Conversation Overview: - Primary Objectives: - "e2e 테스트에서 사용하는 이 파일에 user에 대한 정보가 하드코딩되어 있다. 이를 환경변수가 지정되어 있는 경우 해당 값을 사용하고 없을 경우 기본 값을 사용하도록 개선해주세요." - "뿐만아니라 webuiEndpoint 와 webServerEndpoint 도 e2e 실행하는 환경의 환경변수를 이용하도록 해주세요." - Session Context: The user is focused on modifying the `test-util.ts` file to enhance its configuration for e2e testing by replacing hardcoded values with environment variables. - User Intent Evolution: The user initially requested specific changes to the file and later canceled a command to delegate the task to a cloud agent, indicating a desire to handle the modifications directly.- Technical Foundation:
- File:
- Purpose: This file is used for e2e testing and contains user information that needs to be configurable via environment variables.
- Current State: The user has selected lines 5 to 44 for modification.
- Codebase Status:
- File Name:
- Purpose: To provide utility functions for e2e testing.
- Current State: The user intends to modify the file to replace hardcoded user information and endpoints with environment variable configurations.
- Key Code Segments: Specific lines (5 to 44) are targeted for changes.
- Dependencies: The file's functionality is tied to the overall e2e testing framework.
- Problem Resolution:
- Issues Encountered: Hardcoded values in the
- Solutions Implemented: The user has proposed a solution to use environment variables instead.
- Debugging Context: No ongoing troubleshooting efforts were mentioned.
- Lessons Learned: The importance of configurability in testing environments.
- Progress Tracking:
- Completed Tasks: User has articulated the need for changes to the
- Partially Complete Work: The implementation of the requested changes is pending.
- Active Work State:
- Current Focus: Modifying the
- Recent Context: The user has been focused on the specific lines of code that need modification.
- Working Code: The user has not yet provided specific code snippets for modification.
- Immediate Context: The user was preparing to implement changes to the file when the token budget was exceeded.
- Recent Operations:
- Last Agent Commands: User requested modifications to the
- Tool Results Summary: No spec...
/Users/codejong/Workspace/lablup/webui/e2e/utils/test-util.tstest-util.tstest-util.tsfile.test-util.tsfile.test-util.tsfile to implement user requests regarding environment variables.test-util.tsfile and canceled a command to delegate the task.Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.