Skip to content

Commit 7554c2f

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 a1d9de2 commit 7554c2f

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
@@ -1816,20 +1816,22 @@ def set(_context, changes) end
18161816

18171817
it { expect { described_class.register_type(definition) }.not_to raise_error }
18181818

1819-
it 'is seen as a supported feature' do
1820-
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter})
1821-
expect { described_class.register_type(definition) }.not_to raise_error
1822-
end
1819+
context 'with the type registered' do
1820+
it 'is seen as a supported feature' do
1821+
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter})
1822+
expect { described_class.register_type(definition) }.not_to raise_error
1823+
end
18231824

1824-
it 'passes through the an empty array to `get`' do
1825-
expect(provider).to receive(:get).with(anything, []).and_return([])
1826-
type.instances
1827-
end
1825+
it 'passes through the an empty array to `get`' do
1826+
expect(provider).to receive(:get).with(anything, []).and_return([])
1827+
type.instances
1828+
end
18281829

1829-
it 'passes through the resource title to `get`' do
1830-
instance = type.new(name: 'bar', ensure: 'present')
1831-
expect(provider).to receive(:get).with(anything, ['bar']).and_return([])
1832-
instance.retrieve
1830+
it 'passes through the resource title to `get`' do
1831+
instance = type.new(name: 'bar', ensure: 'present')
1832+
expect(provider).to receive(:get).with(anything, ['bar']).and_return([])
1833+
instance.retrieve
1834+
end
18331835
end
18341836
end
18351837

0 commit comments

Comments
 (0)