Skip to content

[testing][docs] Encourage splitting up large test files, in the testing documentation #181819

Description

@navaronbracke

Per an offline discussion, I think it might be beneficial to set up https://github.com/flutter/flutter/blob/master/packages/flutter/dart_test.yaml

in a way that it allows a test pattern for multiple related tests, insofar that we can avoid one big test file.

I had a look at https://github.com/flutter/flutter/blob/master/docs/contributing/testing/Writing-Effective-Tests.md
and it seems to only slightly mention the phrase: "That said, a higher number of shorter tests will tend to be a safer bet than a smaller number of longer tests."

but does not mention splitting up test files that end up getting bigger.

Proposal

Encourage splitting up test files that tend to reach a given line limit. (What that limit is, is to be decided, but maybe something that works well with the test runners?) We can put this in the docs for writing effective tests?

We should also configure https://github.com/flutter/flutter/blob/master/packages/flutter/dart_test.yaml with https://github.com/dart-lang/test/blob/master/pkgs/test/doc/configuration.md#filename

I think packages/flutter/test can benefit from it mainly, but this also applies to other parts of the test suite, so there might be other dart_test.yaml's that need it.

cc @Piinks

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsc: contributor-productivityTeam-specific productivity, code health, technical debt.c: tech-debtTechnical debt, code quality, testing, etc.d: docs/flutter/flutter/docs, for contributorsframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions