@@ -56,15 +56,25 @@ public function job_output_shows_job_name_not_executable_path_for_script_type():
5656 }
5757
5858 /**
59- * The real-world case from the bug report: two parallel script jobs with the
60- * same executable. Before the fix they were indistinguishable in the output;
61- * after the fix each one reports its own job key.
59+ * The real-world case from the bug report: two script jobs sharing the same
60+ * executable. Before the fix they were indistinguishable in the output;
61+ * after the fix each one reports its own job key. Runs the default sequential
62+ * executor — the bug lives in JobExecutor's display logic, identical under
63+ * both serial and parallel scheduling, so a single mode is enough.
6264 *
6365 * @test
6466 */
65- public function two_parallel_script_jobs_with_same_executable_are_distinguishable (): void
67+ public function two_script_jobs_with_same_executable_are_distinguishable (): void
6668 {
69+ // The builder ships a default `hooks => pre-commit => ['qa']` block.
70+ // We declare a single ad-hoc flow `shards`, so the default hook would
71+ // reference a missing `qa` flow and the command would abort with
72+ // "Hook 'pre-commit' references 'qa' which is not a defined flow or job."
73+ // before getting anywhere near the display-name logic. Hook empty by design:
74+ // this test exercises the executor's OK/KO output for two `script` jobs,
75+ // not the hook subsystem.
6776 $ this ->configurationFileBuilder
77+ ->setV3Hooks ([])
6878 ->setV3Flows (['shards ' => ['jobs ' => ['shard_a ' , 'shard_b ' ]]])
6979 ->setV3Jobs ([
7080 'shard_a ' => [
@@ -79,7 +89,7 @@ public function two_parallel_script_jobs_with_same_executable_are_distinguishabl
7989
8090 file_put_contents ($ this ->configPath , $ this ->configurationFileBuilder ->buildV3Php ());
8191
82- passthru ("$ this ->githooks flow shards --config= $ this ->configPath --processes=2 2>&1 " , $ exitCode );
92+ passthru ("$ this ->githooks flow shards --config= $ this ->configPath 2>&1 " , $ exitCode );
8393
8494 $ this ->assertEquals (0 , $ exitCode );
8595 $ output = $ this ->getActualOutput ();
@@ -89,7 +99,7 @@ public function two_parallel_script_jobs_with_same_executable_are_distinguishabl
8999 $ this ->assertLessThanOrEqual (
90100 1 ,
91101 substr_count ($ output , '/bin/echo identical-runner - OK ' ),
92- 'Two parallel script jobs were shown with their executable instead of their job key. '
102+ 'Two script jobs were shown with their executable instead of their job key. '
93103 );
94104 }
95105}
0 commit comments