Skip to content

Commit

Permalink
Merge pull request #101 from bugsnag/no-strict-for-retry
Browse files Browse the repository at this point in the history
Allow flaky tests by default when —retry is provided
  • Loading branch information
twometresteve authored Jun 22, 2020
2 parents 0ff287a + acb3ad1 commit 1272fde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.1.1 - 2020/06/22

## Fixes

- Account for --retry being provided when adding --strict option (to allow flaky tests).

# 2.1.0 - 2020/06/04

## Enhancements
Expand Down
11 changes: 9 additions & 2 deletions bin/bugsnag-maze-runner
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ class MazeRunner
def add_maze_runner_options
@args << 'features' if @args.empty?

# Strict mode unless any no/strict option is given
# Add strict mode unless any no/strict option is given,
# but also allow flaky tests if --retry was provided.
regex = /--(no-)?strict(-(undefined|pending|flaky))?/
@args << '--strict' if @args.all? { |arg| regex.match(arg).nil? }
if @args.all? { |arg| regex.match(arg).nil? }
if @args.any? '--retry'
@args << '--strict-undefined' << '--strict-pending'
else
@args << '--strict'
end
end

# Load internal steps and helper functions
load_dir = File.expand_path(File.dirname(File.dirname(__FILE__))).freeze
Expand Down

0 comments on commit 1272fde

Please sign in to comment.