Skip to content

Commit 49b54ce

Browse files
committed
Add CCK strawman for validating the testRunId consistency
1 parent 30c56c0 commit 49b54ce

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

compatibility/support/shared_examples.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@
2727

2828
expect(comparator.errors).to be_empty, "There were comparison errors: #{comparator.errors}"
2929
end
30+
31+
it 'ensures a consistent `testRunStartedId` across the entire test run' do
32+
# Step 1) Grab testRunStarted[:id]
33+
test_run_message = parsed_generated.detect { |msg| message_type(msg) == :test_run_started }
34+
id = test_run_message.test_run_started.id
35+
36+
# Step 2) Validate every testCase has a [:testRunStartedId] equal to the above
37+
# Step 3) Validate the single testRunFinished [:testRunStartedId] equal to the above
38+
messages_types_containing_test_run_started_id = %i[test_case test_run_finished]
39+
messages_containing_test_run_started_id = parsed_generated.select { |msg| messages_types_containing_test_run_started_id.include?(message_type(msg)) }
40+
ids = messages_containing_test_run_started_id.map { |msg| msg.send(message_type(msg)).test_run_started_id }
41+
42+
expect(ids).to all eq(id)
43+
end
3044
end

0 commit comments

Comments
 (0)