Skip to content

Commit aae426c

Browse files
committed
(maint) make test order really random
The test leakage fixed in the previous commit was only detected by changing the test order. Removing the seed will ensure that different test orderings are tested, leading to a more robust test suite as new issues are discovered and fixed.
1 parent efaf767 commit aae426c

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.rspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--format documentation
22
--color
3-
--order rand:123
3+
--order rand

spec/puppet/resource_api_spec.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,20 +1794,22 @@ def set(_context, changes) end
17941794

17951795
it { expect { described_class.register_type(definition) }.not_to raise_error }
17961796

1797-
it 'is seen as a supported feature' do
1798-
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter})
1799-
expect { described_class.register_type(definition) }.not_to raise_error
1800-
end
1797+
context 'with the type registered' do
1798+
it 'is seen as a supported feature' do
1799+
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter})
1800+
expect { described_class.register_type(definition) }.not_to raise_error
1801+
end
18011802

1802-
it 'passes through the an empty array to `get`' do
1803-
expect(provider).to receive(:get).with(anything, []).and_return([])
1804-
type.instances
1805-
end
1803+
it 'passes through the an empty array to `get`' do
1804+
expect(provider).to receive(:get).with(anything, []).and_return([])
1805+
type.instances
1806+
end
18061807

1807-
it 'passes through the resource title to `get`' do
1808-
instance = type.new(name: 'bar', ensure: 'present')
1809-
expect(provider).to receive(:get).with(anything, ['bar']).and_return([])
1810-
instance.retrieve
1808+
it 'passes through the resource title to `get`' do
1809+
instance = type.new(name: 'bar', ensure: 'present')
1810+
expect(provider).to receive(:get).with(anything, ['bar']).and_return([])
1811+
instance.retrieve
1812+
end
18111813
end
18121814
end
18131815

0 commit comments

Comments
 (0)