-
-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: support .env.test to reuse env variables across the tests (#6408)
* Variables using .env file * Add env variable support to normal tests * Fix the order of variables * Update the order of jobs * Export the varible using actions toolkit * Update the workflow tasks * Fix the sim workflow * Add .env.test file support to tests * Fix the lint * Update the task description * Move lodestar preset to env file * Fix the directory path * newline * Update debugging spec tests section * Update the env variable for preset * Fix the path for setup files * Update code as per feedback * Fix the e2e variables * Update doc * Fix the bash script * Fix sim geth runne * Update the env file * Fix e2e tests * Update the script tasks * Update the script tasks * Add minimal for e2e tests * Add minimal for e2e tests * Update comments in preset tests * Downgrade nethermind version * Load env file in e2e env * Add the issue link in env variable * Update bash script for failsafe current dir * Fix the mistaken genesis extension for el nodes * Add missing capella wait for one test * Downgrade the geth version * Update .env.test --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com>
- Loading branch information
1 parent
1e67579
commit da0bcc8
Showing
26 changed files
with
115 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# We use these images during sim and e2e tests | ||
# TODO: Upgrade Geth once the Nethermind issue is resolved else it's causing following error | ||
# Rejected peer id=134e2c1a76745626 addr=192.168.0.3:9052 conn=staticdial err="useless peer" | ||
GETH_DOCKER_IMAGE=ethereum/client-go:v1.11.6 | ||
# Use either image or local binary for the testing | ||
GETH_BINARY_DIR= | ||
LIGHTHOUSE_DOCKER_IMAGE=sigp/lighthouse:v4.6.0-amd64-modern-dev | ||
# We can't upgrade nethermind further due to genesis hash mismatch with the geth | ||
# https://github.com/NethermindEth/nethermind/issues/6683 | ||
NETHERMIND_DOCKER_IMAGE=nethermind/nethermind:1.18.2 | ||
# We mostly use mainnet for unit testing | ||
# Changing this value may impact the tests which are written with mainnet in mind | ||
LODESTAR_PRESET=mainnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: "Setup env variables using .env file" | ||
description: "Load .env file from root of repo and setup for CI runner" | ||
runs: | ||
using: "node20" | ||
main: index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const fs = require("fs"); | ||
const core = require("@actions/core"); | ||
const dotEnv = require("dotenv"); | ||
const envFile = ".env.test"; | ||
|
||
if (!fs.existsSync(envFile)) { | ||
core.setFailed("File .env not found"); | ||
} | ||
|
||
const result = dotEnv.config({path: envFile}); | ||
if (result.error) { | ||
core.setFailed(result.error.message); | ||
} else { | ||
core.setOutput("env", result.parsed); | ||
core.info("Env file loaded"); | ||
core.info("Populating env variables..."); | ||
|
||
for (const key in result.parsed) { | ||
const value = result.parsed[key]; | ||
core.info(`${key}=${value}`); | ||
|
||
// Export variable | ||
core.exportVariable(key, value); | ||
|
||
// Set to output so it can be used in as the input for the next job/step | ||
core.setOutput(key, value); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import path from "node:path"; | ||
// It's a dev dependency | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import {config} from "dotenv"; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const __dirname = new URL(".", import.meta.url).pathname; | ||
|
||
config({path: path.join(__dirname, "../../../.env.test")}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
da0bcc8
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.
Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.
Full benchmark results