Skip to content

Commit

Permalink
Merge pull request #243 from coreymbe/MAINT-rspec_test_format
Browse files Browse the repository at this point in the history
(MAINT) RSpec testing format parameter
  • Loading branch information
gavindidrichsen committed Oct 6, 2023
2 parents 32c285e + dabbc9f commit 03cc0ad
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 03cc0ad

Please sign in to comment.