-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
If we had the notion of a test output folder, tests would have the flexibility to not only write to stdout and stderr, but to write more helpful info, like the contents of adb logs, screenshots, etc.
Proposal
During flutter test, we have The Flutter tool create a temp folder before running any tests. For each test in the suite, the test harness will create a subfolder dedicated to that test and set the path of that subfolder into an environment variable (e.g. TEST_OUTPUT_DIR) before spawning the test.
When each test is done running, if it did not output anything into its folder, the test harness will delete the empty directory. When all tests are done running, if none of the tests wrote any output files, it'll delete the temp directory.
If any files were written during any of the tests, the Flutter tool will keep the temp directory intact and print a message to the caller that "test outputs are available at ..."