Skip to content

Commit 8ecef61

Browse files
authored
Merge pull request #16 from buildkite-plugins/fix-inconsistent-file-processing-order
Use a known sort order for processing files
2 parents fe9254d + 132a264 commit 8ecef61

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

ruby/bin/annotate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ end
1818
junit_report_files = Dir.glob(File.join(junits_dir, "**", "*"))
1919
failures = []
2020

21-
junit_report_files.each do |file|
21+
junit_report_files.sort.each do |file|
2222
next if File.directory?(file)
2323

2424
STDERR.puts "Parsing #{file.sub(junits_dir, '')}"

ruby/tests/annotate_test.rb

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
assert_equal <<~OUTPUT, output
99
Parsing junit-1.xml
10-
Parsing junit-3.xml
1110
Parsing junit-2.xml
11+
Parsing junit-3.xml
1212
--- ❓ Checking failures
1313
There were no failures/errors 🙌
1414
OUTPUT
@@ -21,8 +21,8 @@
2121

2222
assert_equal <<~OUTPUT, output
2323
Parsing junit-1.xml
24-
Parsing junit-3.xml
2524
Parsing junit-2.xml
25+
Parsing junit-3.xml
2626
--- ❓ Checking failures
2727
There are 4 failures/errors 😭
2828
--- ✍️ Preparing annotation
@@ -59,15 +59,15 @@
5959
./spec/support/log.rb:17:in `run'
6060
./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code>
6161
62-
in <a href="#3">Job #3</a>
62+
in <a href="#2">Job #2</a>
6363
</details>
6464
6565
<details>
66-
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in spec.models.account_spec</code></summary>
66+
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in spec.models.account_spec</code></summary>
6767
6868
<code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250)
6969
70-
expected: 250
70+
expected: 700
7171
got: 500
7272
7373
(compared using eql?)
@@ -78,13 +78,13 @@
7878
7979
in <a href="#3">Job #3</a>
8080
</details>
81-
81+
8282
<details>
83-
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in spec.models.account_spec</code></summary>
83+
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in spec.models.account_spec</code></summary>
8484
8585
<code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250)
8686
87-
expected: 700
87+
expected: 250
8888
got: 500
8989
9090
(compared using eql?)
@@ -93,7 +93,7 @@
9393
./spec/support/log.rb:17:in `run'
9494
./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code>
9595
96-
in <a href="#2">Job #2</a>
96+
in <a href="#3">Job #3</a>
9797
</details>
9898
OUTPUT
9999

@@ -105,8 +105,8 @@
105105

106106
assert_equal <<~OUTPUT, output
107107
Parsing junit-1.xml
108-
Parsing junit-3.xml
109108
Parsing junit-2.xml
109+
Parsing junit-3.xml
110110
--- ❓ Checking failures
111111
There are 4 failures/errors 😭
112112
--- ✍️ Preparing annotation
@@ -143,15 +143,15 @@
143143
./spec/support/log.rb:17:in `run'
144144
./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code>
145145
146-
in <a href="#3">Job #3</a>
146+
in <a href="#2">Job #2</a>
147147
</details>
148148
149149
<details>
150-
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in spec.models.account_spec</code></summary>
150+
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in spec.models.account_spec</code></summary>
151151
152152
<code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250)
153153
154-
expected: 250
154+
expected: 700
155155
got: 500
156156
157157
(compared using eql?)
@@ -162,13 +162,13 @@
162162
163163
in <a href="#3">Job #3</a>
164164
</details>
165-
165+
166166
<details>
167-
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in spec.models.account_spec</code></summary>
167+
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in spec.models.account_spec</code></summary>
168168
169169
<code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250)
170170
171-
expected: 700
171+
expected: 250
172172
got: 500
173173
174174
(compared using eql?)
@@ -177,7 +177,7 @@
177177
./spec/support/log.rb:17:in `run'
178178
./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code>
179179
180-
in <a href="#2">Job #2</a>
180+
in <a href="#3">Job #3</a>
181181
</details>
182182
OUTPUT
183183

@@ -220,8 +220,8 @@
220220

221221
assert_equal <<~OUTPUT, output
222222
Parsing sub-dir/junit-1.xml
223-
Parsing sub-dir/junit-3.xml
224223
Parsing sub-dir/junit-2.xml
224+
Parsing sub-dir/junit-3.xml
225225
--- ❓ Checking failures
226226
There are 4 failures/errors 😭
227227
--- ✍️ Preparing annotation
@@ -258,15 +258,15 @@
258258
./spec/support/log.rb:17:in `run'
259259
./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code>
260260
261-
in <a href="#3">Job #3</a>
261+
in <a href="#2">Job #2</a>
262262
</details>
263263
264264
<details>
265-
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in spec.models.account_spec</code></summary>
265+
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in spec.models.account_spec</code></summary>
266266
267267
<code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250)
268268
269-
expected: 250
269+
expected: 700
270270
got: 500
271271
272272
(compared using eql?)
@@ -277,13 +277,13 @@
277277
278278
in <a href="#3">Job #3</a>
279279
</details>
280-
280+
281281
<details>
282-
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 700 if the account is XYZ in spec.models.account_spec</code></summary>
282+
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in spec.models.account_spec</code></summary>
283283
284284
<code><pre>Failure/Error: expect(account.maximum_jobs_added_by_pipeline_changer).to eql(250)
285285
286-
expected: 700
286+
expected: 250
287287
got: 500
288288
289289
(compared using eql?)
@@ -292,7 +292,7 @@
292292
./spec/support/log.rb:17:in `run'
293293
./spec/support/log.rb:66:in `block (2 levels) in <top (required)>'</pre></code>
294294
295-
in <a href="#2">Job #2</a>
295+
in <a href="#3">Job #3</a>
296296
</details>
297297
OUTPUT
298298

0 commit comments

Comments
 (0)