Skip to content

Using --define is not consistent across dart CLI commands #51791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pak3nuh opened this issue Mar 20, 2023 · 0 comments
Open

Using --define is not consistent across dart CLI commands #51791

pak3nuh opened this issue Mar 20, 2023 · 0 comments
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-test Issues related to the 'dart test' tool

Comments

@pak3nuh
Copy link

pak3nuh commented Mar 20, 2023

Hey,

I'm developing a dart package that has some integration tests dependent on an outside service and I use the String.fromEnvironment method to get the value of a specific variable and not have it in the repository as code.

The thing is that the flag that adds environment variables doesn't seem to work consistently across dart CLI commands.

If I run the command

dart -DMY_VAR=my-value run some-dart-test.dart

it picks up the correct value of the var, but if I do the same with the test command it fails

dart -DMY_VAR=my-value test

Also the define flag doesn't seem to be documented anywhere in the CLI. I got a hold of how it works through stackoverflow entries and I don't know if I'm doing something wrong.

I'm using dart 2.19.4 on a Windows 10 machine.

@bkonyi bkonyi added area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-test Issues related to the 'dart test' tool labels Mar 20, 2023
@bkonyi bkonyi self-assigned this Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-test Issues related to the 'dart test' tool
Projects
None yet
Development

No branches or pull requests

2 participants