mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-08 23:28:10 -05:00
chore: restructure tests (#7793)
Follow up to https://github.com/ChainSafe/lodestar/pull/7610 with a few restructuring suggestions, see comments below for detailed changes, revives constants tests we are no longer running in CI and makes each package executable separately again, ie. `cd packages/<package-name>` into `yarn test:unit` works for all packages again. One major change is that unit tests default should be written with `mainnet` preset in mind as I noticed that makes a lot more sense for a bunch of existing tests, eg. we have tests that depend on external fixtures, like api spec tests for events and those are not compatible with `minimal` preset. Also there doesn't seem to be much downside in most cases for unit tests to use `mainnet` preset as it does not run through all the epoch, like for example a e2e or sim test does. So overall, it allows us to use mainnet fixtures / more "real world" data which seems better with little to no downside. Time comparison running unit tests on `unstable` vs. this branch **unstable**  **nflaig/restructure-tests**  There is just a difference of 2 seconds (might be a fluke) in a 6 minute run, this seems acceptable to me considering the benefits of using `mainnet` preset noted above.
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import path from "node:path";
|
||||
import {defineConfig} from "vitest/config";
|
||||
import {browserTestProject} from "./configs/vitest.config.browser.js";
|
||||
import {e2eMainnetProject, e2eProject} from "./configs/vitest.config.e2e.js";
|
||||
import {e2eMainnetProject, e2eMinimalProject} from "./configs/vitest.config.e2e.js";
|
||||
import {specProjectMainnet, specProjectMinimal} from "./configs/vitest.config.spec.js";
|
||||
import {typesTestProject} from "./configs/vitest.config.types.js";
|
||||
import {unitTestMainnetProject, unitTestProject} from "./configs/vitest.config.unit.js";
|
||||
import {unitTestMainnetProject, unitTestMinimalProject} from "./configs/vitest.config.unit.js";
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
workspace: [
|
||||
{
|
||||
extends: true,
|
||||
...unitTestProject,
|
||||
...unitTestMinimalProject,
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
@@ -23,7 +23,7 @@ export default defineConfig({
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
...e2eProject,
|
||||
...e2eMinimalProject,
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
|
||||
Reference in New Issue
Block a user