Skip to content

Expose rich environment variables to tests #594

@MatthewMckee4

Description

@MatthewMckee4

Set useful environment variables that tests can read during execution:

  • KARVA_RUN_ID — unique identifier for this test run
  • KARVA_PROFILE — active profile name
  • KARVA_WORKSPACE_ROOT — project root path
  • KARVA_TEST_THREADS — configured worker count
  • KARVA_VERSION — karva version
  • KARVA_ATTEMPT — current retry attempt (1-indexed)

These help tests adapt their behavior (e.g. different logging in CI, unique temp dirs per run) without needing custom fixtures.

See: https://nexte.st/docs/configuration/env-vars/#environment-variables-nextest-sets

Metadata

Metadata

Assignees

No one assigned

    Labels

    test-runningRelated to running tests with karva

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions