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

Some temporary directory handling changes #94

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ethomson
Copy link
Member

Some changes to temporary directory handling — general quality-of-life changes with an eye toward eventually supporting parallel execution (presumably with separate tempdirs per thread).

  • canonicalize temp sandbox directory everywhere
    We currently only canonicalize the temp sandbox directory on macOS,
    which is critical since /tmp is really /private/tmp. However, we
    should do it everywhere, so that tests can actually expect a consistent
    outcome by looking at clar_sandbox_path().

  • tempdir and sandboxes are now separate entities
    clar now has the concept of a temporary directory, which is the
    temporary directory for the entirety of a clar invocation (a set of
    test runs) and a sandbox, which is the temporary directory for a single
    test invocation.

    This allows us to ensure that a well-written test (that only writes into
    its sandbox) doesn't poison the well for future test invocations if it
    fails to clean up its sandbox.

We currently only canonicalize the temp sandbox directory on macOS,
which is critical since `/tmp` is really `/private/tmp`. However, we
should do it everywhere, so that tests can actually expect a consistent
outcome by looking at `clar_sandbox_path()`.
clar now has the concept of a _temporary directory_, which is the
temporary directory for the entirety of a `clar` invocation (a set of
test runs) and a sandbox, which is the temporary directory for a single
test invocation.

This allows us to ensure that a well-written test (that only writes into
its sandbox) doesn't poison the well for future test invocations if it
fails to clean up its sandbox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant