Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Default cacheDirectory to TEST_TMPDIR #230

Open
sallustfire opened this issue Jan 26, 2024 · 1 comment
Open

[FR]: Default cacheDirectory to TEST_TMPDIR #230

sallustfire opened this issue Jan 26, 2024 · 1 comment
Labels
enhancement New feature or request untriaged Requires traige

Comments

@sallustfire
Copy link
Contributor

What is the current behavior?

Jest provides a config option cacheDirectory which specifies where intermediate file system outputs are written such as transformations or haste map. If left unspecified, the default is approximately ${os.tmpdir()}/jest_${process.uid}. The contents of this directory are not deleted when jest exits and files are written even when --no-cache is set.

Describe the feature

Bazel's TEST_TMPDIR should be integrated to set the jest cacheDirectory in the generated configuration.

  • TEST_TMPDIR in Bazel is available to every test action as an ENV. The directory is writable, guaranteed to be empty, and unique to a given test target.
  • This enforces hermeticity at the file system level between different jest_test targets and brings rules_jest more in line with the bazel test specification.
  • TEST_TMPDIR can either be provided via CLI flag via "make variable" expansion or set in the generated config template by reading from process.env.
@sallustfire sallustfire added the enhancement New feature or request label Jan 26, 2024
@github-actions github-actions bot added the untriaged Requires traige label Jan 26, 2024
sallustfire added a commit to sallustfire/rules_jest that referenced this issue Jan 26, 2024
sallustfire added a commit to sallustfire/rules_jest that referenced this issue Jan 26, 2024
@gregmagolan
Copy link
Member

More context on Bazel Slack: https://bazelbuild.slack.com/archives/C04281DTLH0/p1706234301711269

gregmagolan pushed a commit that referenced this issue Jan 26, 2024
* feat: default cacheDirectory to TEST_TMPDIR

See #230

* use dedicated jest cache folder under TEST_TMPDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged Requires traige
Projects
Status: No status
Development

No branches or pull requests

2 participants