Skip to content

[pigeon] Reorganize test pigeons #115168

Open

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 )

Activity

  1. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    packageflutter/packages repository. See also p: labels.
    p: pigeonrelated to pigeon messaging codegen tool
    P2Important issues not at the top of the work list
    on Nov 11, 2022
  2. stuartmorgan-g commented on Nov 18, 2022

    @stuartmorgan-g
    ContributorAuthor

    We also have special logic to rename some of the files when generating Java output, since the Java generator puts everything in a top-level class with the same name as the file (due to Java naming requirements), and in cases like the file called list.dart that ends up being problematic. We should remove the need for special mapping when we overhaul the file structure.

  3. self-assigned this
    on Nov 30, 2022
  4. flutter-triage-bot commented on Jul 9, 2023

    @flutter-triage-bot

    This issue is assigned but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  5. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Jul 30, 2023
  6. flutter-triage-bot commented on Jul 31, 2023

    @flutter-triage-bot

    This issue was assigned to @tarrinneal but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  7. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on Jul 31, 2023
  8. stuartmorgan-g commented on Aug 7, 2023

    @stuartmorgan-g
    ContributorAuthor

    Unassigning since I've landed the parts I was working on (remaining test harness consolidation); the pigeon files themselves still need to be consolidated.

  9. removed their assignment
    on Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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