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: add .env.example file with its description to integration-tests Readme.md #58

Merged
merged 6 commits into from
Oct 19, 2023

Conversation

pcheremu
Copy link
Contributor

What ❔

env.example file with Readme description to integration-tests

Why ❔

To improve UX and avoid issues in preparing a local env

Checklist

  • env.example

  • Readme.md

  • [ + ] PR title corresponds to the body of PR (we generate changelog entries from PRs).

  • [ n\a ] Tests for the changes have been added / updated.

  • [ + ] Documentation comments have been added / updated.

@pcheremu pcheremu changed the title test: add an .env.example file with description to integration-tests test: add .env.example file with description to integration-tests Oct 18, 2023
@pcheremu pcheremu changed the title test: add .env.example file with description to integration-tests test: add .env.example file with its description to integration-tests Readme.md Oct 18, 2023
@github-actions
Copy link

github-actions bot commented Oct 18, 2023

API E2E Test Results

184 tests  ±0   184 ✔️ ±0   32s ⏱️ -7s
  12 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 6e62c51. ± Comparison against base commit ee9545a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 18, 2023

Unit Test Results

       3 files  ±0     237 suites  ±0   3m 50s ⏱️ +48s
1 808 tests ±0  1 807 ✔️ ±0  1 💤 ±0  0 ±0 
1 833 runs  ±0  1 832 ✔️ ±0  1 💤 ±0  0 ±0 

Results for commit 6e62c51. ± Comparison against base commit ee9545a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 18, 2023

Visit the preview URL for this PR (updated for commit 6e62c51):

(expires Thu, 26 Oct 2023 13:20:20 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e508f9012944951194447cb8885950b451a24403

@pcheremu pcheremu self-assigned this Oct 18, 2023

import type { HardhatUserConfig } from "hardhat/types";

const envFilePath = `${__dirname}/.env`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't do any file existence checks. We should just have a fallback to Wallets.richWalletPrivateKey. No logic is needed here in this file except loading dotenv.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fallback logic should be used in place where process.env.WALLET_PRIVATE_KEY is used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Romsters updated

@pcheremu pcheremu requested a review from Romsters October 19, 2023 11:03
Copy link
Contributor

@abilevych abilevych left a comment

Choose a reason for hiding this comment

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

I'm generally okay with the PR, but let's get here an approval from Roman since there were some comments


import type { HardhatUserConfig } from "hardhat/types";

if (!process.env.WALLET_PRIVATE_KEY) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for this check and reassigning env vars is a bad pattern. I meant you can add a fallback in the place where it is used.
Like:

const wallet = new Wallet(process.env.WALLET_PRIVATE_KEY || Wallets.richWalletPrivateKey);
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thank you. @Romsters

@pcheremu pcheremu merged commit 5e62c42 into integration-tests Oct 19, 2023
15 of 25 checks passed
@pcheremu pcheremu deleted the QA-451-add-envexample-logic branch October 19, 2023 13:28
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.

4 participants