fresh-cat-90827
05/11/2024, 10:18 PMtest
goal was executed? ๐งตfresh-cat-90827
05/11/2024, 10:18 PM$ pants --no-pantsd test --report ::
23:13:22.00 [INFO] Completed: Run Pytest - helloworld/translator/translator_test.py:tests - succeeded.
23:13:22.20 [INFO] Completed: Run Pytest - helloworld/greet/greeting_test.py:tests - succeeded.
โ helloworld/greet/greeting_test.py:tests succeeded in 0.20s.
โ helloworld/translator/translator_test.py:tests succeeded in 0.35s (cached locally).
Wrote test reports to dist/test/reports
fresh-cat-90827
05/11/2024, 10:18 PMhelloworld/greet/greeting_test.py
was executed and helloworld/translator/translator_test.py
was cached locallyfresh-cat-90827
05/11/2024, 10:18 PMfresh-cat-90827
05/11/2024, 10:22 PMbroad-processor-92400
05/11/2024, 10:30 PMfresh-cat-90827
05/11/2024, 10:36 PMdiff --git a/src/python/pants/core/goals/test.py b/src/python/pants/core/goals/test.py
index b21c37e459..b7861381ff 100644
--- a/src/python/pants/core/goals/test.py
+++ b/src/python/pants/core/goals/test.py
@@ -940,6 +940,7 @@ async def run_tests(
exit_code = 0
if results:
console.print_stderr("")
+ json_results = {}
for result in sorted(results):
if result.exit_code is None:
# We end up here, e.g., if we implemented test discovery and found no tests.
@@ -949,7 +950,7 @@ async def run_tests(
if result.result_metadata is None:
# We end up here, e.g., if compilation failed during self-implemented test discovery.
continue
-
+ json_results[result.addresses[0]] = result.result_metadata._source
console.print_stderr(_format_test_summary(result, run_id, console))
if result.extra_output and result.extra_output.files:
@@ -962,7 +963,7 @@ async def run_tests(
<http://logger.info|logger.info>(
f"Wrote extra output from test `{result.addresses[0]}` to `{path_prefix}`."
)
-
+ print(json_results)
rerun_command = _format_test_rerun_command(results)
if rerun_command and test_subsystem.show_rerun_command:
console.print_stderr(f"\n{rerun_command}")
~
~
fresh-cat-90827
05/11/2024, 10:37 PM./pants_from_sources --no-pantsd test ::
Pantsd has been turned off via Flag.
23:35:27.67 [INFO] Completed: Run Pytest - helloworld/translator/translator_test.py:tests - succeeded.
23:35:27.67 [INFO] Completed: Run Pytest - helloworld/greet/greeting_test.py:tests - succeeded.
โ helloworld/greet/greeting_test.py:tests succeeded in 0.36s (cached locally).
โ helloworld/translator/translator_test.py:tests succeeded in 0.28s (cached locally).
{Address(helloworld/greet/greeting_test.py:tests): 'hit_locally', Address(helloworld/translator/translator_test.py:tests): 'hit_locally'}
fresh-cat-90827
05/11/2024, 10:46 PMDoes the https://www.pantsbuild.org/2.19/reference/subsystems/workunit-logger backend provide this info?it does, partially only. It told me that a test module
helloworld/greet/greeting_test.py
was run, but it doesn't tell me anything about the other modules (was it memoized? cached locally? cached remotely?)
pants test ::
23:41:58.73 [INFO] Completed: Run Pytest - helloworld/translator/translator_test.py:tests - succeeded.
23:41:58.98 [INFO] Completed: Run Pytest - helloworld/greet/greeting_test.py:tests - succeeded.
โ helloworld/greet/greeting_test.py:tests succeeded in 0.24s.
โ helloworld/translator/translator_test.py:tests succeeded in 0.35s (memoized).
23:41:58.98 [INFO] Wrote log to artifacts/pants_run_2024_05_11_23_41_58_701_5b78f507156843cfaab9ff8b3d8f1261.json
fresh-cat-90827
05/11/2024, 10:47 PMtest ::
in the CI build as it will have enormous performance hitfresh-cat-90827
05/11/2024, 10:49 PMstats
subsystemwide-midnight-78598
05/12/2024, 12:31 AMwide-midnight-78598
05/12/2024, 12:33 AMfresh-cat-90827
05/13/2024, 9:48 AMtime
tag with the duration, but, yes, individual tests module cache status and execution status, at least, would be helpful. I'll file an issue and will start working on a feature.fresh-cat-90827
07/14/2024, 9:38 PM