Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit c934a46

Browse files
committed
Update tests
1 parent 46c9f49 commit c934a46

File tree

2 files changed

+59
-7
lines changed

2 files changed

+59
-7
lines changed

.fixtures.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ fixtures:
1010
ref: "v1.1.2"
1111
systemd:
1212
repo: "https://github.com/camptocamp/puppet-systemd.git"
13-
ref: "1.1.1"
13+
ref: "2.7.0"
1414

1515

spec/classes/github_actions_runner_spec.rb

+58-6
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@
8787
end
8888
end
8989

90-
context 'is expected to create a github_actions_runner service' do
91-
it do
92-
is_expected.to contain_service('github-actions-runner.first_runner.service').with('ensure' => 'running', 'enable' => true)
93-
end
94-
end
95-
9690
context 'is expected to contain archive' do
9791
it do
9892
is_expected.to contain_archive('first_runner-actions-runner-linux-x64-2.272.0.tar.gz').with(
@@ -208,6 +202,64 @@
208202
end
209203
end
210204

205+
context 'is expected to create a github_actions_runner with service active and enabled' do
206+
let(:params) do
207+
super().merge(
208+
'http_proxy' => 'http://proxy.local',
209+
'https_proxy' => 'http://proxy.local',
210+
'no_proxy' => 'example.com',
211+
'instances' => {
212+
'first_runner' => {
213+
'labels' => ['test_label1'],
214+
'repo_name' => 'test_repo',
215+
},
216+
},
217+
)
218+
end
219+
220+
it do
221+
is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with(
222+
'ensure' => 'present',
223+
'enable' => true,
224+
'active' => true,
225+
)
226+
end
227+
end
228+
229+
context 'is expected to remove github_actions_runner unit_file and other resources' do
230+
let(:params) do
231+
super().merge(
232+
'http_proxy' => 'http://proxy.local',
233+
'https_proxy' => 'http://proxy.local',
234+
'no_proxy' => 'example.com',
235+
'instances' => {
236+
'first_runner' => {
237+
'ensure' => 'absent',
238+
'labels' => ['test_label1'],
239+
'repo_name' => 'test_repo',
240+
},
241+
},
242+
)
243+
end
244+
245+
it do
246+
is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with(
247+
'ensure' => 'absent',
248+
'enable' => false,
249+
'active' => false,
250+
)
251+
is_expected.to contain_file('/some_dir/actions-runner-2.272.0/first_runner').with(
252+
'ensure' => 'absent',
253+
)
254+
is_expected.to contain_archive('first_runner-actions-runner-linux-x64-2.272.0.tar.gz').with(
255+
'ensure' => 'absent',
256+
)
257+
is_expected.to contain_file('/some_dir/actions-runner-2.272.0/first_runner/configure_install_runner.sh').with(
258+
'ensure' => 'absent',
259+
)
260+
end
261+
end
262+
211263
context 'is expected to create a github_actions_runner installation with proxy settings in systemd globally in init.pp' do
212264
let(:params) do
213265
super().merge(

0 commit comments

Comments
 (0)