Description
The VITEST_RUN_E2E environment variable is used to control whether e2e tests are excluded from the test run, but this mechanism appears redundant given actual usage.
Current Implementation:
vitest.config.js:6-8 - Conditionally excludes e2e-*.test.?(m)js files based on VITEST_RUN_E2E
.github/workflows/scripts/linkcheck.sh:45 - Sets VITEST_RUN_E2E=true when running the e2e test
Why it's unnecessary:
- The e2e test is always run explicitly by filename -
linkcheck.sh directly invokes vitest run scripts/tests/e2e-link-validation.test.mjs, which means Vitest is told exactly which file to run.
- There's only ONE e2e test file -
e2e-link-validation.test.mjs is the only file matching the e2e-*.test.?(m)js pattern
- The test workflow already separates concerns -
.github/workflows/test.yml:57-62 runs unit tests separately from link validation (lines 64-68).
- The npm scripts already handle separation -
package.json:21 runs vitest run scripts/tests/ (unit tests) then npm run linkcheck (e2e)
Related Files
https://github.com/defenseunicorns/pepr-docs/blob/main/vitest.config.js
https://github.com/defenseunicorns/pepr-docs/blob/main/.github/workflows/scripts/linkcheck.sh
Definition of Done
Verify the above observations and remove the VITEST_RUN_E2E envar if we can confirm it's unnecessary. During review of #160 we noticed that
the environment variable might be solving a problem that doesn't exist.
Description
The
VITEST_RUN_E2Eenvironment variable is used to control whether e2e tests are excluded from the test run, but this mechanism appears redundant given actual usage.Current Implementation:
vitest.config.js:6-8- Conditionally excludese2e-*.test.?(m)jsfiles based onVITEST_RUN_E2E.github/workflows/scripts/linkcheck.sh:45- SetsVITEST_RUN_E2E=truewhen running the e2e testWhy it's unnecessary:
linkcheck.shdirectly invokes vitest runscripts/tests/e2e-link-validation.test.mjs, which means Vitest is told exactly which file to run.e2e-link-validation.test.mjsis the only file matching thee2e-*.test.?(m)jspattern.github/workflows/test.yml:57-62runs unit tests separately from link validation (lines 64-68).package.json:21runsvitest run scripts/tests/(unit tests) thennpm run linkcheck(e2e)Related Files
https://github.com/defenseunicorns/pepr-docs/blob/main/vitest.config.js
https://github.com/defenseunicorns/pepr-docs/blob/main/.github/workflows/scripts/linkcheck.sh
Definition of Done
Verify the above observations and remove the
VITEST_RUN_E2Eenvar if we can confirm it's unnecessary. During review of #160 we noticed thatthe environment variable might be solving a problem that doesn't exist.