btw we are using 1.9.0 but tried with 1.11.0rc1 as...
# general
a
btw we are using 1.9.0 but tried with 1.11.0rc1 as well and no difference.
e
I do not repro on master. I simplified by using an explicit target instead of changed to confirm I had a test actually run - which is needed to get any xml output:
Copy code
$ ./pants test --test-pytest-junit-xml-dir=./tests-out/ tests/python/pants_test/util:memo
$ xmllint -format tests-out/TEST-tests.python.pants_test.util.memo.xml | head
<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="0" failures="0" name="pytest" skips="0" tests="18" time="0.061">
  <testcase classname="...tests.python.pants_test.util.test_memo" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants/util/memo.py" line="258" name="testable_memoized_property" time="0.000488042831421"/>
  <testcase classname="...tests.python.pants_test.util.test_memo.MemoizeTest" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants_test/util/test_memo.py" line="92" name="test_cache_factory" time="0.000428915023804"/>
  <testcase classname="...tests.python.pants_test.util.test_memo.MemoizeTest" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants_test/util/test_memo.py" line="136" name="test_clear" time="0.000380039215088"/>
  <testcase classname="...tests.python.pants_test.util.test_memo.MemoizeTest" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants_test/util/test_memo.py" line="216" name="test_descriptor_application_invalid" time="0.000358104705811"/>
  <testcase classname="...tests.python.pants_test.util.test_memo.MemoizeTest" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants_test/util/test_memo.py" line="280" name="test_descriptor_application_valid" time="0.000385046005249"/>
  <testcase classname="...tests.python.pants_test.util.test_memo.MemoizeTest" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants_test/util/test_memo.py" line="114" name="test_forget" time="0.000392913818359"/>
  <testcase classname="...tests.python.pants_test.util.test_memo.MemoizeTest" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants_test/util/test_memo.py" line="29" name="test_function_application_kwargs" time="0.000377893447876"/>
  <testcase classname="...tests.python.pants_test.util.test_memo.MemoizeTest" file="pyprep/sources/15408d347b4dde741ac5a7c56a9e8f5fd927e173/pants_test/util/test_memo.py" line="43" name="test_function_application_mixed" time="0.000340938568115"/>
Happy to dig further and check against your Pants versions if you file an issue after confirming there aren't simply no tests running.
a
It seems to work with python tests but not scala 😕 I will file issue later today.
e
Ah, yes, that is a python (test.pytest) specific option. We don't have the feature for junit (test.junit).
a
ohh, that is disappointing. Is there a plan to implement it anytime soon?
btw the option name is confusing in that case as I thought it will support both as it has both pytest and junit in name
e
No. But this is exactly where you come in. File a feature request issue to start so it's on the radar. Then, potentially, dive in if we don't get to it quickly enough.
👍 1
AH, yeah - agreed somewhat. The option scoping is regular but mysterious. When you say
test
, that implies test tasks for a whole bunch of languages Pants supports (try
./pants --explain tests
). So, for example, test.pytest and test.junit. The former tests python code, the latter jvm code using the junit runner. Options are scoped to goal, task. So --test-pytest means this is an option bound for the
pytest
task in the
test
goal. The rest, junit-xml-dir - is the actual option name.
./pants test.junit --help
and
./pants test.pytest --help
give scoped help for example.
And, fwiw - you can shorten options on the cli leveraging this. To the right of a task you can supply its options in short form; ie:
./pants test.pytest --no-timeouts --junit-xml-dir=./bob [targets]
.
a
I knew a bit about that (tried to write a plugin once) but still finding it confusing sometimes. Thanks for help.