Skip to content

Commit

Permalink
chore: choose WARN or ERROR for 'no pacts found' message based on fai…
Browse files Browse the repository at this point in the history
…l option
  • Loading branch information
bethesque committed Mar 29, 2021
1 parent 81c4b9e commit e11821f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/pact/provider_verifier/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ def all_pact_urls

def warn_empty_pact_set
if all_pact_urls.empty?
$stderr.puts "WARN: No pacts were found for the consumer versions selected"
level = options.fail_if_no_pacts_found ? "ERROR" : "WARN"
$stderr.puts "#{level}: No pacts were found for the consumer versions selected"
end
end

Expand Down
5 changes: 4 additions & 1 deletion script/dev/broker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ bundle exec bin/pact-provider-verifier \
--provider-app-version $(git rev-parse --short HEAD | xargs echo -n) \
--provider-base-url http://localhost:4567 \
--include-wip-pacts-since 2018-01-01 \
--enable-pending --verbose
--enable-pending --verbose \
--no-fail-if-no-pacts-found

echo "exit code is $?"

kill -2 $pid
wait $pid

0 comments on commit e11821f

Please sign in to comment.