-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Description / Steps to reproduce / Feature proposal
Current TestSandbox uses the same folder the user provides for tests. If a file put in the sandbox is required, it gets cached by it. A workaround for clearing the cache was introduced in #1391 but as per the comments, #1391 (comment), decaching has it's own challenges.
Current Behavior
- Before PR fix(testlab): decache files in TestSandbox when resetting it #1391, files get cached -- can break tests. Issues with multiple tests running in parallel.
- After PR fix(testlab): decache files in TestSandbox when resetting it #1391, files are decached but not a robust implementation. Multiple tests in parallel still an issue.
Expected Behavior
TestSandbox should create a random folder in the given path (can be considered a basepath). When the sandbox is reset, instead of decaching -- we delete the old random folder and create a new one for the user. Similar behaviour as used in loopback-boot, see comment #1391 (comment)
Acceptance Criteria
- Given a path for a TestSandbox (like present) - the instance should create a random folder inside that for the test
- When the TestSandbox instance is reset, the randomly generated folder should be deleted. A new random folder should be generated -- prevent issues with caching and parallel tests.
- Provide convenience methods on TestSandbox instance such as
sandbox.resolve(),sandbox.existsFile(),sandbox.existsDir(), etc. -- to make working with sandbox easier as we now have random folders being generated -- this should be an abstraction from the user of TestSandbox. - Tests
- Docs (TestSandbox is currently lacking documentation).
See Reporting Issues for more tips on writing good issues
shimks