Skip to content

trycmd: Document fs.sandbox and working directory behavior #364

Open
@kpreid

Description

@kpreid

The documentation of trycmd makes a couple of references to fs.sandbox = true, but does not explain what that option does, nor what is done instead if it is false. It mentions the “full schema” but that has no specific documentation for fs.sandbox. The documentation doesn't answer these questions:

  • If fs.sandbox is not set and *.out/ does not exist, what is the CWD? From the misbehavior I was observing in my own tests, it almost seems like it is nondeterministic (perhaps inheriting a previous test's output directory?).
  • Does it mean just creating a temporary directory, or does it mean using actual OS features to constrain or redirect writes in some manner?

I think I now correctly understand that if the binary under test writes an output file to a relative path, and that output file is to be ignored rather than compared, then I should set fs.sandbox = true. But that was not obvious when I was setting up some of my tests, particularly since the output file usually went apparently nowhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trycmdArea: trycmd packageenhancementImprove the expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions