Skip to content

Commit f03f10c

Browse files
author
Nicole Lopez
committed
using abort vs raise; adding enum to plugin.yml
1 parent 02cec82 commit f03f10c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

plugin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ configuration:
1111
type: string
1212
failure-format:
1313
type: string
14+
enum:
15+
- classname
16+
- file
1417
required:
1518
- artifacts
1619
additionalProperties: false

ruby/bin/annotate

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ job_pattern = '-(.*).xml' if !job_pattern || job_pattern.empty?
1414

1515
failure_format = ENV['BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT']
1616
failure_format = 'classname' if !failure_format || failure_format.empty?
17+
18+
# TODO -- remove this validation once https://github.com/buildkite/agent/pull/748 is merged
1719
if !%w(classname file).include?(failure_format)
18-
raise ArgumentError.new("Invalid failure-format #{failure_format} provided -- leave this setting blank or specify `file` or `classname`")
20+
abort("Invalid failure-format #{failure_format} provided -- leave this setting blank or specify `file` or `classname`")
1921
end
2022

2123
class Failure < Struct.new(:name, :failed_test, :body, :job, :type)

0 commit comments

Comments
 (0)