@@ -2,10 +2,6 @@ name: "Integration Testing"
2
2
3
3
on : [pull_request]
4
4
5
- env :
6
- HONEYCOMB_WRITEKEY : 7f3c63a70eecc61d635917de46bea4e6
7
- HONEYCOMB_DATASET : litmus tests
8
-
9
5
jobs :
10
6
setup_matrix :
11
7
name : " Setup Test Matrix"
14
10
matrix : ${{ steps.get-matrix.outputs.matrix }}
15
11
16
12
steps :
17
- - name : " Honeycomb: Start recording"
18
- uses : puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
19
- with :
20
- apikey : ${{ env.HONEYCOMB_WRITEKEY }}
21
- dataset : ${{ env.HONEYCOMB_DATASET }}
22
- job-status : ${{ job.status }}
23
-
24
- - name : " Honeycomb: Start first step"
25
- run : |
26
- echo STEP_ID=setup-environment >> $GITHUB_ENV
27
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
28
-
29
13
- name : Checkout Source
30
14
uses : actions/checkout@v2
31
15
if : ${{ github.repository_owner == 'puppetlabs' }}
41
25
if : ${{ github.repository_owner == 'puppetlabs' }}
42
26
run : |
43
27
echo ::group::bundler environment
44
- buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
28
+ bundle env
45
29
echo ::endgroup::
46
30
47
- - name : " Honeycomb: Record Setup Environment time"
48
- if : ${{ github.repository_owner == 'puppetlabs' }}
49
- run : |
50
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
51
- echo STEP_ID=Setup-Integration-Test-Matrix >> $GITHUB_ENV
52
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
53
-
54
31
- name : Setup Integration Test Matrix
55
32
id : get-matrix
56
33
run : |
60
37
echo "matrix={}" >> $GITHUB_OUTPUT
61
38
fi
62
39
63
- - name : " Honeycomb: Record Setup Test Matrix time"
64
- if : ${{ always() }}
65
- run : |
66
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
67
-
68
40
Integration :
69
41
needs :
70
42
- setup_matrix
75
47
fail-fast : false
76
48
matrix : ${{fromJson(needs.setup_matrix.outputs.matrix)}}
77
49
78
- env :
79
- BUILDEVENT_FILE : ' ../buildevents.txt'
80
-
81
50
steps :
82
- - run : |
83
- echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE
84
- echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
85
-
86
- - name : " Honeycomb: Start recording"
87
- uses : puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
88
- with :
89
- apikey : ${{ env.HONEYCOMB_WRITEKEY }}
90
- dataset : ${{ env.HONEYCOMB_DATASET }}
91
- job-status : ${{ job.status }}
92
- matrix-key : ${{ matrix.platform }}-${{ matrix.collection }}
93
-
94
- - name : " Honeycomb: start first step"
95
- run : |
96
- echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
97
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
98
51
99
52
- name : Checkout Source
100
53
uses : actions/checkout@v2
@@ -108,39 +61,19 @@ jobs:
108
61
- name : Print bundle environment
109
62
run : |
110
63
echo ::group::bundler environment
111
- buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
64
+ bundle env
112
65
echo ::endgroup::
113
66
114
67
- name : Create the fixtures directory
115
68
run : |
116
- echo ::group::Create the fixtures directory
117
- buildevents cmd $TRACE_ID $STEP_ID 'bundle exec rake spec_prep' -- bundle exec rake spec_prep
118
- echo ::endgroup::
119
-
120
- - name : " Honeycomb: Record Setup Environment time"
121
- if : ${{ always() }}
122
- run : |
123
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
124
- echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
125
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
69
+ bundle exec rake spec_prep
126
70
127
71
- name : Provision test environment
128
72
run : |
129
- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec bolt --modulepath spec/fixtures/modules plan run ntp::acceptance::provision_integration image=${{ matrix.platform }}
130
- echo ::group::=== REQUEST ===
131
- cat request.json || true
132
- echo
133
- echo ::endgroup::
134
- echo ::group::=== INVENTORY ===
135
- if [ -f 'spec/fixtures/litmus_inventory.yaml' ];
136
- then
137
- FILE='spec/fixtures/litmus_inventory.yaml'
138
- elif [ -f 'inventory.yaml' ];
139
- then
140
- FILE='inventory.yaml'
141
- fi
73
+ bundle exec bolt --modulepath spec/fixtures/modules plan run ntp::acceptance::provision_integration image=${{ matrix.platform }}
74
+ # Redact password
75
+ FILE='spec/fixtures/litmus_inventory.yaml'
142
76
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
143
- echo ::endgroup::
144
77
145
78
- name : Install PE
146
79
run : |
@@ -152,41 +85,14 @@ jobs:
152
85
153
86
- name : Install module
154
87
run : |
155
- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
156
-
157
- - name : " Honeycomb: Record deployment times"
158
- if : ${{ always() }}
159
- run : |
160
- echo ::group::honeycomb step
161
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
162
- echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
163
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
164
- echo ::endgroup::
88
+ bundle exec rake 'litmus:install_module'
165
89
166
90
- name : Run integration tests
167
91
run : |
168
- buildevents cmd $TRACE_ID $STEP_ID 'rake ntp:integration' -- bundle exec rake ntp:integration
169
-
170
- - name : " Honeycomb: Record integration testing times"
171
- if : ${{ always() }}
172
- run : |
173
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run integration tests'
174
- echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
175
- echo STEP_START=$(date +%s) >> $GITHUB_ENV
92
+ bundle exec rake ntp:integration
176
93
177
94
- name : Remove test environment
178
95
if : ${{ always() }}
179
96
continue-on-error : true
180
97
run : |
181
- if [ -f inventory.yaml ]; then
182
- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
183
- echo ::group::=== REQUEST ===
184
- cat request.json || true
185
- echo
186
- echo ::endgroup::
187
- fi
188
-
189
- - name : " Honeycomb: Record removal times"
190
- if : ${{ always() }}
191
- run : |
192
- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
98
+ bundle exec rake 'litmus:tear_down'
0 commit comments