Skip to content

Centralized location for test file output #17259

@tvolkert

Description

@tvolkert

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 ..."

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: tests"flutter test", flutter_test, or one of our teststeam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions