Skip to content

[pigeon] Reorganize test pigeons #115168

@stuartmorgan-g

Description

@stuartmorgan-g

The Pigeon API definitions used for tests are defined in a bunch of files in the pigeons/ directory. There are several problems with this:

  • They grew haphapzardly:
    • It's not always clear what any given file is intended to test (e.g., the original file is just called "message.dart" rather than having a usage-based name, and there are ambiguous cases like "enum.dart" vs "enum_args.dart")
    • Some have multiple APIs, some only one.
    • It's not clear when to make a new file vs. editing an existing one.
  • Each file is generated in its own pigeon invocation in the test script, and each invocation is slow. It takes quite a while, especially on Windows, to generate all of the output, because there are so many files, and each new file slows things down more.

We should consolidate this to a small number of files—very possibly that number being one—and clearly group things (with comments) within that file. E.g., Maybe we have one API that tests all permutations of arguments, or one that tests all permutations of enums (return value, direct arg, class field), even though they are in the same file. But we definitely don't need to have a lot of single-entry APIs like we currently have across the files.

Currently the native unit test files are mostly broken down matching the pigeons/ files; we would need to figure out how we want to groups those files instead. But we can certainly have multiple source files for the native unit tests even if we consolidate the API definition, if keeping file division is useful.

(This has been discussed in the past, but I didn't see an issue where we captured it. /cc @tarrinneal )

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.p: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions