Skip to content

Commit

Permalink
(MAINT) RSpec testing format parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
coreymbe committed Oct 5, 2023
1 parent 32c285e commit dabbc9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions tasks/run_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"test_path": {
"description": "Location of the test files. Defaults to './spec/acceptance'",
"type": "Optional[String[1]]"
},
"format": {
"description": "",
"type": "Enum[progress, documentation]",
"default": "progress"
}
},
"files": [
Expand Down
8 changes: 5 additions & 3 deletions tasks/run_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
require 'puppet_litmus'
require_relative '../lib/task_helper'

def run_tests(sut, test_path)
test = "bundle exec rspec #{test_path} --format progress"
def run_tests(sut, test_path, format)
test = "bundle exec rspec #{test_path} --format #{format}"
options = {
env: {
'TARGET_HOST' => sut
Expand All @@ -25,8 +25,10 @@ def run_tests(sut, test_path)
else
params['test_path']
end
format = params['format']

begin
result = run_tests(sut, test_path)
result = run_tests(sut, test_path, format)
puts result.to_json
exit 0
rescue StandardError => e
Expand Down

0 comments on commit dabbc9f

Please sign in to comment.