Skip to content

Commit

Permalink
Split the config files for each package
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Jan 16, 2024
1 parent 61fa9df commit 937df77
Show file tree
Hide file tree
Showing 46 changed files with 164 additions and 53 deletions.
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit && yarn test:e2e",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit && yarn test:e2e",
"test:unit:minimal": "vitest --run --segfaultRetry 3 --dir test/unit/ --coverage",
"test:unit:minimal": "vitest --run --segfaultRetry 3 --dir test/unit/",
"test:unit:mainnet": "LODESTAR_PRESET=mainnet vitest --run --dir test/unit-mainnet",
"test:unit": "wrapper() { yarn test:unit:minimal $@ && yarn test:unit:mainnet $@; }; wrapper",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --segfaultRetry 3 --poolOptions.threads.singleThread true --dir test/e2e",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --segfaultRetry 3 --config vitest.config.e2e.ts --dir test/e2e",
"test:sim": "vitest --run test/sim/**/*.test.ts",
"test:sim:merge-interop": "vitest --run test/sim/merge-interop.test.ts",
"test:sim:mergemock": "vitest --run test/sim/mergemock.test.ts",
Expand Down
11 changes: 11 additions & 0 deletions packages/beacon-node/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.e2e.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
10 changes: 1 addition & 9 deletions packages/beacon-node/vitest.config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.spec.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
testTimeout: 60_000,
passWithNoTests: true,
pool: "threads",
poolOptions: {
threads: {
isolate: false,
},
},
},
})
);
2 changes: 1 addition & 1 deletion packages/beacon-node/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:e2e": "vitest --run --poolOptions.threads.singleThread true --dir test/e2e/",
"test:unit": "vitest --run --dir test/unit/",
"test:e2e": "vitest --run --config vitest.config.e2e.ts --dir test/e2e/",
"test:sim:multifork": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/multi_fork.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",
Expand Down
11 changes: 11 additions & 0 deletions packages/cli/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.e2e.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
2 changes: 1 addition & 1 deletion packages/cli/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lint": "eslint --color --ext .ts src/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:unit": "yarn vitest --run --dir test/unit/ --coverage",
"test:unit": "yarn vitest --run --dir test/unit/",
"check-readme": "typescript-docs-verifier"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/config/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/db/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/flare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"lint": "eslint --color --ext .ts src/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"check-readme": "typescript-docs-verifier"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/flare/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/fork-choice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/fork-choice/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/light-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit && yarn test:e2e",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
Expand Down
2 changes: 1 addition & 1 deletion packages/light-client/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:electron": "echo 'Electron tests will be introduced back in the future as soon vitest supports electron.'",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --dir test/e2e",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --config vitest.config.e2e.ts --dir test/e2e",
"check-readme": "typescript-docs-verifier"
},
"types": "lib/index.d.ts",
Expand Down
11 changes: 11 additions & 0 deletions packages/logger/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.e2e.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
2 changes: 1 addition & 1 deletion packages/logger/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/params/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"test": "yarn run check-types",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:electron": "echo 'Electron tests will be introduced back in the future as soon vitest supports electron.'",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --dir test/e2e/",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --config vitest.config.e2e.ts --dir test/e2e/",
"check-readme": "typescript-docs-verifier"
},
"repository": {
Expand Down
11 changes: 11 additions & 0 deletions packages/params/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.e2e.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
2 changes: 1 addition & 1 deletion packages/params/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/prover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit && yarn test:e2e",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:electron": "echo 'Electron tests will be introduced back in the future as soon vitest supports electron.'",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --poolOptions.threads.singleThread true --dir test/e2e",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --config vitest.config.e2e.ts --dir test/e2e",
"check-readme": "typescript-docs-verifier",
"generate-fixtures": "node --loader ts-node/esm scripts/generate_fixtures.ts"
},
Expand Down
11 changes: 11 additions & 0 deletions packages/prover/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.e2e.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
2 changes: 1 addition & 1 deletion packages/prover/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/reqresp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test": "yarn test:unit",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"check-readme": "typescript-docs-verifier"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/reqresp/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/spec-test-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:unit": "vitest --run --passWithNoTests --dir test/unit/ --coverage",
"test:e2e": "vitest --run --dir test/e2e/",
"test:unit": "vitest --run --passWithNoTests --dir test/unit/",
"test:e2e": "vitest --run --config vitest.config.e2e.ts --dir test/e2e/",
"check-readme": "typescript-docs-verifier"
},
"repository": {
Expand Down
11 changes: 11 additions & 0 deletions packages/spec-test-util/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.e2e.config";

export default mergeConfig(
vitestConfig,
defineConfig({
test: {
globalSetup: ["./test/globalSetup.ts"],
},
})
);
2 changes: 1 addition & 1 deletion packages/spec-test-util/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"check-types": "tsc",
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit/",
"check-readme": "typescript-docs-verifier"
},
"types": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
6 changes: 3 additions & 3 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
"check-types": "tsc",
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"test:constants:minimal": "LODESTAR_PRESET=minimal vitest --run --dir test/constants/ --coverage",
"test:constants:mainnet": "LODESTAR_PRESET=mainnet vitest --run --dir test/constants/ --coverage",
"test:unit": "wrapper() { yarn test:constants:minimal $@ && yarn test:constants:mainnet $@ && vitest --run --dir test/unit/ --coverage $@; }; wrapper",
"test:constants:minimal": "LODESTAR_PRESET=minimal vitest --run --dir test/constants/",
"test:constants:mainnet": "LODESTAR_PRESET=mainnet vitest --run --dir test/constants/ --coverage.enabled=false",
"test:unit": "wrapper() { yarn test:constants:minimal $@ && yarn test:constants:mainnet $@ && vitest --run --dir test/unit/ $@; }; wrapper",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:unit": "vitest --run --dir test/unit/ --coverage",
"test:unit": "vitest --run --dir test/unit",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "../../vitest.base.config";
import vitestConfig from "../../vitest.base.unit.config";

export default mergeConfig(
vitestConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
"test:unit": "vitest --run --dir test/unit --coverage",
"test:unit": "vitest --run --dir test/unit/",
"test": "yarn test:unit",
"test:spec": "vitest --run --config vitest.config.spec.ts --dir test/spec/",
"test:e2e": "LODESTAR_PRESET=mainnet vitest --run --poolOptions.threads.singleThread true --dir test/e2e",
"test:e2e": "LODESTAR_PRESET=mainnet vitest --run --config vitest.config.e2e.ts --dir test/e2e",
"download-spec-tests": "node --loader=ts-node/esm test/spec/downloadTests.ts",
"coverage": "codecov -F lodestar-validator",
"check-readme": "typescript-docs-verifier"
Expand Down
Loading

0 comments on commit 937df77

Please sign in to comment.