Skip to content

Commit c288b48

Browse files
committed
increase CI approval leeway
1 parent 02701df commit c288b48

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

spec/bashly/integration/examples_spec.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# what they are supposed to do, and running without errors.
55
# It will run several tests on all the configuration files in the examples
66
# folder
7+
#
8+
# To only test examples containing a certain string in their path, run:
9+
# EXAMPLE=yaml bundle exec run spec examples
710

811
describe 'generated bash scripts' do
912
# Test public examples from the examples folder...
@@ -16,9 +19,8 @@
1619

1720
test_cases = fixtures + examples
1821

19-
# To only test examples containing a certain string in their path, run:
20-
# EXAMPLE=yaml bundle exec run spec examples
21-
leeway = ENV['CI'] ? 30 : 0
22+
# Allow up to a certain string distance from the approval text in CI
23+
leeway = ENV['CI'] ? 40 : 0
2224

2325
test_cases.each do |example|
2426
approval_name = example.gsub 'spec/fixtures/workspaces', 'fixtures'
@@ -32,10 +34,11 @@
3234
output = `bash test.sh 2>&1`
3335
end
3436

35-
# Use .diff to give CI some leeway, since its shell differs soemtimes
37+
# Use .diff to give CI some leeway, since its shell differs sometimes
3638
# This was observed in at least these two cases:
3739
# - The "+ ..." shell messages driven by `set -x` have no space
3840
# - The order of our `inspect_args` sometimes differs
41+
# - The result of the `deps` array sometimes differs
3942
expect(output).to match_approval(approval_name).diff(leeway)
4043
end
4144
end

0 commit comments

Comments
 (0)