Is it possible to specify `--test-extra-env-vars` ...
# general
h
Is it possible to specify
--test-extra-env-vars
on the command line in a way that appends to/modifies what's specific in
pants.toml
?
e
Yes. Same as for any list valued option: https://www.pantsbuild.org/docs/options#list-values So
--test-extra-env-vars FOO=bar --test-extra-env-vars BAZ=spam
adds those two to any others configured is one way.
h
oof, my reading is bad today
I skipped right over where it says that appends
e
If you're ever not sure, try
pants help <all the options>
That output will show you the current value of the options Pants thinks it has.
So something like:
Copy code
$ pants help test --test-extra-env-vars=FOO=bar | grep test-extra-env-vars -A10
  --test-extra-env-vars="['<str>', '<str>', ...]"
  PANTS_TEST_EXTRA_ENV_VARS
  extra_env_vars
      default: []
      current value: [
          "FOO=bar"
      ] (from command-line flag)
      Additional environment variables to include in test processes. Entries are strings in
      the form `ENV_VAR=value` to use explicitly; or just `ENV_VAR` to copy the value of a
      variable in Pants's own environment.
More illuminating:
Copy code
$ PANTS_TEST_EXTRA_ENV_VARS='["A", "B=c"]' pants help test --test-extra-env-vars=FOO=bar | grep test-extra-env-vars -A10
  --test-extra-env-vars="['<str>', '<str>', ...]"
  PANTS_TEST_EXTRA_ENV_VARS
  extra_env_vars
      default: []
      current value: [
          "A",
          "B=c",
          "FOO=bar"
      ] (from env var PANTS_TEST_EXTRA_ENV_VARS, from command-line flag)
      Additional environment variables to include in test processes. Entries are strings in
      the form `ENV_VAR=value` to use explicitly; or just `ENV_VAR` to copy the value of a
h
oh wow, very cool. I didn't realize
help
would dynamically update like that