Skip to content

--dart-define-from-file tests are spread across two unrelated files #134279

Closed

Description

@andrewkolos

See title.

We have tests related to the --dart-define-from-file option in both build_bundle_test.dart and assemble_test.dart. This option does not function differently under these the flutter build bundle and flutter assemble commands, so it would make more sense to group all of these tests together into flutter_command.dart, where the --dart-define-from-file functionality is implemented.

In addition, there are some things about these tests that we should fix:

  • There are multiple tests that make sure we tool exit when --dart-define-from-file is given a malformed file (e.g. invalid JSON). Their titles don't differentiate themselves from each other, which can be confusing. These tests should either be merged into a single test call or be given better names and be grouped together into a group.
  • Nit: Some tests could have better names. The names state what is under test, but not what the expected result is.
  • There is behavior not under test. Specifically, the case where we are unable to parse an .env file (fun fact, we consider any file that doesn't start with { to be an .env file 🙃).

Lastly, while this is not related to the tests, we probably should change the error message printed when the user provides malformed JSON. Currently, we yell at the user.

Activity

  1. added
    P2Important issues not at the top of the work list
    c: tech-debtTechnical debt, code quality, testing, etc.
    team-toolOwned by Flutter Tool team
    triaged-toolTriaged by Flutter Tool team
    on Sep 8, 2023
  2. self-assigned this
    on Sep 8, 2023
  3. github-actions commented on Oct 31, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.team-toolOwned by Flutter Tool teamtriaged-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