DEV: Add process pid to `bin/turbo_tests --format documentation` output (#22429)

Why this change?

The process's pid is useful when we're trying to link output from
different processes together. In this case, we want to be able to link
the Rails server logs to the right rspec process.

Before:

[2] Viewing sidebar mobile collapses the sidebar when clicking outside of it

After:

[2] (#176342) Viewing sidebar mobile collapses the sidebar when clicking outside of it
This commit is contained in:
Alan Guo Xiang Tan 2023-07-05 11:47:35 +08:00 committed by GitHub
parent 14517785b2
commit de7110d539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,8 @@ module TurboTests
private private
def output_example(example) def output_example(example)
output = +"[#{example.process_id}] #{example.full_description}" output =
+"[#{example.process_id}] (##{example.metadata[:process_pid]}) #{example.full_description}"
if run_duration_ms = example.metadata[:run_duration_ms] if run_duration_ms = example.metadata[:run_duration_ms]
output << " (#{run_duration_ms}ms)" output << " (#{run_duration_ms}ms)"

View File

@ -55,6 +55,7 @@ module TurboTests
example.metadata[:shared_group_inclusion_backtrace].map(&method(:stack_frame_to_json)), example.metadata[:shared_group_inclusion_backtrace].map(&method(:stack_frame_to_json)),
extra_failure_lines: example.metadata[:extra_failure_lines], extra_failure_lines: example.metadata[:extra_failure_lines],
run_duration_ms: example.metadata[:run_duration_ms], run_duration_ms: example.metadata[:run_duration_ms],
process_pid: Process.pid,
}, },
location_rerun_argument: example.location_rerun_argument, location_rerun_argument: example.location_rerun_argument,
} }