rhythmic-glass-66959
08/22/2022, 1:09 PM[WARN] Failed to generate JUnit XML data for test/python/...tests.
Do you know how I can troubleshoot this problem in Pants? I tried to find some logs and use the flag --keep-sandboxes=always
, but without success... Note that the tests are successful. Thank you.enough-analyst-54434
08/22/2022, 1:27 PM./pants -V
) and in what way do you mean `--keep-sandboxes=always`~ without success. Were you able to find the appropriate sandbox and replicate the failure message using the __run.sh
script in that sandbox?rhythmic-glass-66959
08/22/2022, 1:31 PM2.14.0.dev6
enough-analyst-54434
08/22/2022, 1:31 PMenough-analyst-54434
08/22/2022, 1:32 PMtest --force
and include your full command line and full output, that might be enlightening.enough-analyst-54434
08/22/2022, 1:33 PMtest --force
will force the tests to re-run even if they have cached success.rhythmic-glass-66959
08/22/2022, 1:33 PMenough-analyst-54434
08/22/2022, 1:34 PMenough-analyst-54434
08/22/2022, 1:35 PMenough-analyst-54434
08/22/2022, 1:35 PMenough-analyst-54434
08/22/2022, 1:35 PMenough-analyst-54434
08/22/2022, 1:36 PM__run.sh
to debug.enough-analyst-54434
08/22/2022, 1:38 PMrhythmic-glass-66959
08/22/2022, 1:38 PM-ldebug
and --test-force
, but I see nothing more about Junit XML reports.enough-analyst-54434
08/22/2022, 1:39 PMenough-analyst-54434
08/22/2022, 1:41 PMrhythmic-glass-66959
08/22/2022, 1:43 PMenough-analyst-54434
08/22/2022, 1:43 PMenough-analyst-54434
08/22/2022, 1:46 PMenough-analyst-54434
08/22/2022, 1:47 PMenough-analyst-54434
08/22/2022, 1:47 PM--junitxml-...
from here: https://github.com/pantsbuild/pants/blob/a69b8f0ef4e14451dbf7f39fd23adaf3f2700535/src/python/pants/backend/python/goals/pytest_runner.py#L286-L292enough-analyst-54434
08/22/2022, 1:49 PMrhythmic-glass-66959
08/22/2022, 1:49 PMrhythmic-glass-66959
08/22/2022, 1:50 PMsandboxe
and __run.sh
to troubleshoot?enough-analyst-54434
08/22/2022, 1:50 PMrhythmic-glass-66959
08/22/2022, 1:51 PMenough-analyst-54434
08/22/2022, 1:51 PM__run.sh
and run that and see if the junit file is actually output where the script asks pytest to output it.rhythmic-glass-66959
08/22/2022, 2:06 PMextra-output
folder?enough-analyst-54434
08/22/2022, 2:07 PM__run.sh
? The full command line should be in there.enough-analyst-54434
08/22/2022, 2:09 PM__run.sh
or even the full sandbox tarball I'm happy to take a look.rhythmic-glass-66959
08/22/2022, 2:10 PM./pytest_runner.pex_pex_shim.sh -c build-support/python/tools/pytest.ini -vv --no-header -s $'--cov-report=' $'--cov-config=build-support/python/tools/.coveragerc' $'--cov=.' $'--cov=src/python' tests/python/nautobot_tests/nautobot_animal_sounds_tests/test_api.py
rhythmic-glass-66959
08/22/2022, 2:11 PM--junitxml-...
enough-analyst-54434
08/22/2022, 2:12 PMrhythmic-glass-66959
08/22/2022, 2:13 PMenough-analyst-54434
08/22/2022, 2:13 PMrhythmic-glass-66959
08/22/2022, 2:14 PMrhythmic-glass-66959
08/22/2022, 2:17 PMenough-analyst-54434
08/22/2022, 2:17 PM--test-debug
or --test-debug-adapter
and would apply to all tests. You should not see the behavior vary amongst different tests like you do.rhythmic-glass-66959
08/22/2022, 2:18 PMrhythmic-glass-66959
08/22/2022, 2:23 PMPYTEST_ADDOPTS
extra_env_vars
in the python_tests
target. It seems to override the content of this variable set by pants...rhythmic-glass-66959
08/22/2022, 2:23 PMrhythmic-glass-66959
08/22/2022, 2:27 PM❯ cat __run.sh
#!/bin/bash
# This command line should execute the same process as pants did internally.
export PANTS_EXECUTION_SLOT=1 PEX_EXTRA_SYS_PATH=$'.:src/python' PYTEST_ADDOPTS=$'--color=yes --junitxml=tests.python.nornir_tests.nornir_greet_tests.test_greeting_tasks.py@tests.xml -o junit_family=xunit2'
cd /tmp/pants-sandbox-vjs2JG
./pytest_runner.pex_pex_shim.sh -c build-support/python/tools/pytest.ini -vv --no-header -s $'--cov-report=' $'--cov-config=build-support/python/tools/.coveragerc' $'--cov=.' $'--cov=src/python' tests/python/nornir_tests/nornir_greet_tests/test_greeting_tasks.py
rhythmic-glass-66959
08/22/2022, 2:27 PM❯ cat __run.sh
#!/bin/bash
# This command line should execute the same process as pants did internally.
export DJANGO_SETTINGS_MODULE=nautobot.core.tests.nautobot_config NAUTOBOT_CONFIG=./src/python/netops_nautobot/nautobot_config.py NAUTOBOT_REDIS_PASSWORD=decinablesprewad PANTS_EXECUTION_SLOT=7 PEX_EXTRA_SYS_PATH=$'.:src/python' PYTEST_ADDOPTS=$'-p pytest_nautobot --reuse-db'
cd /tmp/pants-sandbox-SHdrIJ
./pytest_runner.pex_pex_shim.sh -c build-support/python/tools/pytest.ini -vv --no-header -s $'--cov-report=' $'--cov-config=build-support/python/tools/.coveragerc' $'--cov=.' $'--cov=src/python' tests/python/nautobot_tests/nautobot_animal_sounds_tests/test_api.py
rhythmic-glass-66959
08/22/2022, 2:29 PMpython_tests(
name="tests",
dependencies=[
"3rdparty/python:nautobot-plugin-reqs",
"3rdparty/python:reqs#pytest-django",
"src/python/nautobot_animal_sounds",
"src/python/netops_nautobot",
"src/python/pytest_nautobot",
],
extra_env_vars=[
"DJANGO_SETTINGS_MODULE=nautobot.core.tests.nautobot_config",
"NAUTOBOT_CONFIG=./src/python/netops_nautobot/nautobot_config.py",
"NAUTOBOT_REDIS_PASSWORD=decinablesprewad",
"PYTEST_ADDOPTS=-p pytest_nautobot --reuse-db",
],
sources=["**/test_*.py"],
)
enough-analyst-54434
08/22/2022, 2:34 PMenough-analyst-54434
08/22/2022, 2:36 PMenough-analyst-54434
08/22/2022, 2:42 PMenough-analyst-54434
08/22/2022, 2:43 PMenough-analyst-54434
08/22/2022, 2:44 PMenough-analyst-54434
08/22/2022, 2:45 PM"3rdparty/python:nautobot-plugin-reqs",
dep pretty much answers my question.rhythmic-glass-66959
08/22/2022, 2:51 PMenough-analyst-54434
08/22/2022, 2:55 PMrhythmic-glass-66959
08/22/2022, 2:56 PMrhythmic-glass-66959
08/22/2022, 2:57 PMenough-analyst-54434
08/22/2022, 2:59 PMhappy-kitchen-89482
08/22/2022, 6:01 PM