@@ -158,12 +158,12 @@ jobs:
158
158
# Besides, each job is running on a different instance, which means using host network here
159
159
# is safe and has no side effects on others.
160
160
[ "${{ inputs.target }}" == "rootful" ] \
161
- && args=(test-integration ./hack/test- integration.sh -test.allow-modify-users=true) \
162
- || args=(test-integration-${{ inputs.target }} /test-integration-rootless.sh ./hack/test- integration.sh)
161
+ && args=(test-integration ./hack/testing/ integration.sh -test.allow-modify-users=true) \
162
+ || args=(test-integration-${{ inputs.target }} /test-integration-rootless.sh ./hack/testing/ integration.sh)
163
163
if [ "${{ inputs.ipv6 }}" == true ]; then
164
- docker run --network host -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=false -test.only-ipv6 -test.target=${{ inputs.binary }}
164
+ docker run --name test-runner -- network host -t --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=false -test.only-ipv6 -test.target=${{ inputs.binary }}
165
165
else
166
- docker run -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=false -test.target=${{ inputs.binary }}
166
+ docker run --name test-runner -t --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=false -test.target=${{ inputs.binary }}
167
167
fi
168
168
# FIXME: this NEEDS to go away
169
169
- name : " Run: integration tests (flaky)"
@@ -172,18 +172,87 @@ jobs:
172
172
github::md::h2 "flaky" >> "$GITHUB_STEP_SUMMARY"
173
173
174
174
[ "${{ inputs.target }}" == "rootful" ] \
175
- && args=(test-integration ./hack/test- integration.sh) \
176
- || args=(test-integration-${{ inputs.target }} /test-integration-rootless.sh ./hack/test- integration.sh)
175
+ && args=(test-integration ./hack/testing/ integration.sh) \
176
+ || args=(test-integration-${{ inputs.target }} /test-integration-rootless.sh ./hack/testing/ integration.sh)
177
177
if [ "${{ inputs.ipv6 }}" == true ]; then
178
- docker run --network host -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=true -test.only-ipv6 -test.target=${{ inputs.binary }}
178
+ docker run --name test-runner-flaky -- network host -t --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=true -test.only-ipv6 -test.target=${{ inputs.binary }}
179
179
else
180
- docker run -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=true -test.target=${{ inputs.binary }}
180
+ docker run --name test-runner-flaky -t --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=true -test.target=${{ inputs.binary }}
181
181
fi
182
182
183
183
- name : Logs
184
- if : ${{ failure() }}
184
+ if : ${{ failure() || success() }}
185
+ run : |
186
+ # Get the reports from inside the containers
187
+ [ "${{ inputs.target }}" == "rootful" ] && src=/root || src=/home/rootless
188
+ mkdir -p ~/report
189
+ docker cp test-runner:$src/nerdctl-test-report ~/report/main || true
190
+ # Flaky may not have run
191
+ docker cp test-runner-flaky:$src/nerdctl-test-report ~/report/flaky 2>/dev/null || true
192
+ - name : Logs
193
+ id : artifact-upload
194
+ if : ${{ failure() || success() }}
185
195
uses : actions/upload-artifact@v4
186
196
with :
187
- name : " System logs"
188
- path : ~/debug-logs.tar.gz
197
+ name : logs-${{ inputs.binary }}-${{ inputs.target }}-${{ inputs.runner }}-${{ inputs.ipv6 }}-${{ inputs.canary }}-${{ inputs.containerd-version }}-${{ inputs.rootlesskit-version }}
198
+ path : ~/report/*
189
199
retention-days : 1
200
+
201
+ - name : Annotate
202
+ if : ${{ failure() || success() }}
203
+ run : |
204
+ echo "::add-matcher::.github/matchers/tigron.json"
205
+ echo "::error title=ErrorReport::MEH .github/workflows/job-test-in-host.yml${{steps.artifact-upload-step.outputs.artifact-url}}"
206
+ echo "::notice title=NoticeReport::SHEESH ${{steps.artifact-upload-step.outputs.artifact-url}}"
207
+ echo "::error file=cmd/nerdctl/main_test_test.go,line=1,endLine=10,title=AgainErrorReport::FOO ${{steps.artifact-upload-step.outputs.artifact-url}}"
208
+ echo "::error file=cmd/nerdctl/main_test.go,line=38,endLine=41,title=AgainErrorReport::BLA ${{steps.artifact-upload-step.outputs.artifact-url}}"
209
+ echo "Error: TestFooFoo "
210
+ pwd
211
+ ls -lA cmd/nerdctl/main_test_test.go || true
212
+ # ::workflow-command parameter1={data},parameter2={data}::{command value}
213
+ echo "::remove-matcher owner=tigron::"
214
+
215
+ # - name: "Comment report"
216
+ # if: ${{ failure() }}
217
+ # uses: ./.github/actions/wax
218
+ # with:
219
+ # body: "body test (in-container)"
220
+ # github-token: ${{ secrets.GITHUB_TOKEN }}
221
+ # steps.artifact-upload-step.outputs.artifact-url
222
+
223
+ # - name: Commenting
224
+ # if: ${{ failure() || success() }}
225
+ # uses: actions/github-script@v7
226
+ # with:
227
+ # github-token: ${{ secrets.GITHUB_TOKEN }}
228
+ # script: |
229
+ # let comments = await github.rest.issues.listComments({
230
+ # issue_number: context.issue.number,
231
+ # owner: context.repo.owner,
232
+ # repo: context.repo.repo,
233
+ # })
234
+ #
235
+ # let found = 0
236
+ # let body = ""
237
+ # comments.data.forEach(function(comment){
238
+ # if (comment.user.login === context.repo.login) {
239
+ # found = comment.id
240
+ # body = comment.body
241
+ # }
242
+ # })
243
+ #
244
+ # if (found === 0){
245
+ # github.rest.issues.createComment({
246
+ # issue_number: context.issue.number,
247
+ # owner: context.repo.owner,
248
+ # repo: context.repo.repo,
249
+ # body: "${{steps.artifact-upload-step.outputs.artifact-url}}\n"
250
+ # })
251
+ # }else{
252
+ # github.rest.issues.updateComment({
253
+ # comment_id: found,
254
+ # owner: context.repo.owner,
255
+ # repo: context.repo.repo,
256
+ # body: body + "${{steps.artifact-upload-step.outputs.artifact-url}}\n"
257
+ # })
258
+ # }
0 commit comments