Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bugcrowd/test-summary-buildkite-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f5a9bc847d6ebcef51443d6b9c154670d758ab53
Choose a base ref
..
head repository: bugcrowd/test-summary-buildkite-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ad8c630f0071615e25d6e54bf204b5db08139787
Choose a head ref
Showing with 7 additions and 13 deletions.
  1. +5 −5 lib/test_summary_buildkite_plugin/input.rb
  2. +2 −8 spec/test_summary_buildkite_plugin/input_spec.rb
10 changes: 5 additions & 5 deletions lib/test_summary_buildkite_plugin/input.rb
Original file line number Diff line number Diff line change
@@ -237,11 +237,11 @@ def file_contents_to_failures(str)
end

def summary(filename, error)
severity = error.attribute('severity')&.value
line = error.attribute('line')&.value
column = error.attribute('column')&.value
location = [filename, line, column].compact.join(':')
message = error.attribute('message')&.value
severity = error.attribute('severity').value
line = error.attribute('line').value
column = error.attribute('column').value
location = "#{filename}:#{line}:#{column}"
message = error.attribute('message').value

"[#{severity}] #{location}: #{message}"
end
10 changes: 2 additions & 8 deletions spec/test_summary_buildkite_plugin/input_spec.rb
Original file line number Diff line number Diff line change
@@ -220,19 +220,13 @@
it { is_expected.to be_a(TestSummaryBuildkitePlugin::Input::Checkstyle) }

it 'has all failures' do
expect(input.failures.count).to eq(3)
expect(input.failures.count).to eq(1)
end

it 'failures have summary' do
expect(input.failures[0].summary).to eq(
'[error] src/main/java/io/timnew/sol/Sol.kt: Without column or line'
)
expect(input.failures[1].summary).to eq(
expect(input.failures.first.summary).to eq(
'[error] src/main/java/io/timnew/sol/Sol.kt:106:1: Needless blank line(s)'
)
expect(input.failures[2].summary).to eq(
'[error] src/main/java/io/timnew/sol/Sol.kt:109: Without column'
)
end

it 'failures have details' do