https://pantsbuild.org/ logo
#general
Title
# general
r

rhythmic-morning-87313

04/29/2022, 3:03 PM
Q10: Passing extra pytest args to skip "integration" marked tests, but running the test says "ERROR: file or directory not found: integration"
1
b

bitter-ability-32190

04/29/2022, 3:12 PM
I think you need to provide quotes:
"'not integration'"
r

rhythmic-morning-87313

04/29/2022, 3:17 PM
hm ok
image.png
f

fast-nail-55400

04/29/2022, 3:17 PM
also possible that there is a missing
shlex.quote
somewhere in the code
if you run with
-ldebug
, Pants will log the
Process
instance it wants to run
that will quickly demonstrate if there is an issue or not
r

rhythmic-morning-87313

04/29/2022, 3:21 PM
does pants reset the environment variables passed to individual pytest processes?
yeah. it does.....
f

fast-nail-55400

04/29/2022, 3:22 PM
yes
the env is set from several sources
r

rhythmic-morning-87313

04/29/2022, 3:23 PM
the param name is "extra_envs" so i'd expected it is merged upon
os.environ
r

rhythmic-morning-87313

04/29/2022, 3:24 PM
depending on the setup, i need to locally override some environment variables (e.g., on dev setup)
which should not be set in CI and production
i don't want put these env-vars in the version control
f

fast-nail-55400

04/29/2022, 3:24 PM
you can always add an extra config file to your local invocations
with just the extra env vars you need
then point Pants at the extra config file by setting
PANTS_CONFIG_FILES
in the environment so you don’t need to specify on each invocation
r

rhythmic-morning-87313

04/29/2022, 3:25 PM
ahha, pants has its own env-var overriding env-var
good
f

fast-nail-55400

04/29/2022, 3:26 PM
every Pants option can also be set in the environment
so you could set
PANTS_TEST_EXTRA_ENV_VARS
c

curved-television-6568

04/29/2022, 5:17 PM
For dev machines there's also the .pants.rc style files you can use (would post link to docs, but are on my phone currently, and the docs is kind of a pain on mobile..)
6 Views