Skip to content

test(e2e): load secret from env#196

Open
duyhungtnn wants to merge 2 commits intomasterfrom
fix/load-secret-from-env
Open

test(e2e): load secret from env#196
duyhungtnn wants to merge 2 commits intomasterfrom
fix/load-secret-from-env

Conversation

@duyhungtnn
Copy link
Copy Markdown
Collaborator

@duyhungtnn duyhungtnn commented Apr 13, 2026

This pull request updates how environment variables are managed for E2E (end-to-end) tests by switching from hardcoded configuration in the test config file to using a .env file and the dotenv package. It also updates the documentation to reflect these changes and makes some minor adjustments to dependencies in package.json.

fix #193

Copy link
Copy Markdown

Copilot AI left a 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 updates the E2E test setup to load required secrets from environment variables (optionally via a .env file) instead of hardcoding them in the AVA config, addressing issue #193.

Changes:

  • Load .env via dotenv and wire E2E config values from process.env.
  • Update README E2E instructions and add .env.example template.
  • Add dotenv to devDependencies and ignore local .env files.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ava-e2e.config.mjs Loads .env and passes env-derived secrets into AVA’s environmentVariables for E2E runs.
package.json Adds dotenv (dev dependency) and reorders some dependencies.
README.md Documents required env vars / .env usage for E2E testing.
.env.example Provides a template for required E2E environment variables.
.gitignore Prevents committing local .env secrets.
yarn.lock Locks dotenv dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ava-e2e.config.mjs Outdated
Comment thread README.md Outdated
@duyhungtnn
Copy link
Copy Markdown
Collaborator Author

Hi @cre8ivejp, please help me to take a look.
These changes were made because adding secrets to ava-e2e.config.mjs can easily lead to accidentally committing them and leaking secrets.

@duyhungtnn duyhungtnn marked this pull request as ready for review April 13, 2026 03:37
@duyhungtnn duyhungtnn requested a review from cre8ivejp as a code owner April 13, 2026 03:37
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.

should load API keys from .env file instead of manual putting in the ava config

2 participants