Skip to content

Commit

Permalink
ci: enable mixed beacon-validator sim tests (#5940)
Browse files Browse the repository at this point in the history
* Enable mixed client sim tests

* Add host.docker.internal as host

* Fix typo in lodestar

* Rename multi client to mixed client sim tests
  • Loading branch information
nflaig authored Sep 8, 2023
1 parent b79e9ba commit 0f38c05
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/test-sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ jobs:
run: yarn test:sim:backup_eth_provider
working-directory: packages/cli

# Enable these tests after fixing the following issue
# https://github.com/ChainSafe/lodestar/issues/5553
# - name: Sim tests multi client
# run: DEBUG='${{github.event.inputs.debug}}' yarn test:sim:multiclient
# working-directory: packages/cli
- name: Sim tests mixed client
run: DEBUG='${{github.event.inputs.debug}}' yarn test:sim:mixedclient
working-directory: packages/cli

- name: Upload debug log test files for "packages/cli"
if: ${{ always() }}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:unit": "nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'",
"test:e2e": "mocha --timeout 30000 'test/e2e/**/*.test.ts'",
"test:sim:multifork": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/multi_fork.test.ts",
"test:sim:multiclient": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/multi_client.test.ts",
"test:sim:mixedclient": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/mixed_client.test.ts",
"test:sim:endpoints": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/endpoints.test.ts",
"test:sim:deneb": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/deneb.test.ts",
"test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/backup_eth_provider.test.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const ttd = getEstimatedTTD({

const env = await SimulationEnvironment.initWithDefaults(
{
id: "multi-clients",
logsDir: path.join(logFilesDir, "multi-clients"),
id: "mixed-clients",
logsDir: path.join(logFilesDir, "mixed-clients"),
chainConfig: {
ALTAIR_FORK_EPOCH: altairForkEpoch,
BELLATRIX_FORK_EPOCH: bellatrixForkEpoch,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/test/utils/simulation/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export type SimulationOptions = {
};

export enum BeaconClient {
Lodestar = "beacon_loadstar",
Lodestar = "beacon_lodestar",
Lighthouse = "beacon_lighthouse",
}

export enum ValidatorClient {
Lodestar = "validator_loadstar",
Lodestar = "validator_lodestar",
Lighthouse = "validator_lighthouse",
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/utils/simulation/runner/DockerRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class DockerRunner implements RunnerEnv<RunnerType.Docker> {
}

create(jobOption: Omit<JobOptions<RunnerType.Docker>, "children">): Job {
const jobArgs = ["run", "--rm", "--name", jobOption.id];
const jobArgs = ["run", "--rm", "--name", jobOption.id, "--add-host", "host.docker.internal:host-gateway"];

if (jobOption.options.dockerNetworkIp) {
jobArgs.push("--network", dockerNetworkName);
Expand Down

0 comments on commit 0f38c05

Please sign in to comment.