Skip to content

Remove Unnecessary VITEST_RUN_E2E Environment Variable #185

Description

@samayer12

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions