Skip to content

Commit e5cfb81

Browse files
committed
Replace an older pipelines test JUnit report when --resume names an update that is not a test update
1 parent 62df2cd commit e5cfb81

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuites>
3+
<testsuite name="my_pipeline" tests="1" failures="0" errors="1" skipped="0">
4+
<testcase name="pipelines test">
5+
<error message="update [UUID] is not a test update; pass the update ID that pipelines test printed">update [UUID] is not a test update; pass the update ID that pipelines test printed</error>
6+
</testcase>
7+
</testsuite>
8+
</testsuites>

‎acceptance/pipelines/test/run-control/output.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Results received: none.
8282
JUnit report: out.resumed.xml
8383
Error: update [UUID] is CANCELED
8484

85-
=== --resume rejects an update that is not a test update
86-
>>> musterr [CLI] pipelines test my_pipeline --resume [UUID]
85+
=== --resume rejects an update that is not a test update, and an older report is replaced
86+
>>> musterr [CLI] pipelines test my_pipeline --resume [UUID] --junit-xml out.not-test-update.xml
8787
Error: update [UUID] is not a test update; pass the update ID that pipelines test printed
8888

8989
=== Outside a project, an older passing report is replaced

‎acceptance/pipelines/test/run-control/script‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ title "Stopping the pipeline cancels the test update"
3333
trace $CLI pipelines stop my_pipeline
3434
trace musterr $CLI pipelines test my_pipeline --resume $hang_update_id --junit-xml out.resumed.xml
3535

36-
title "--resume rejects an update that is not a test update"
36+
title "--resume rejects an update that is not a test update, and an older report is replaced"
3737
pipeline_id=$($CLI bundle summary -o json | jq -r '.resources.pipelines.my_pipeline.id')
3838
regular_update_id=$($CLI pipelines start-update $pipeline_id | jq -r .update_id)
39-
trace musterr $CLI pipelines test my_pipeline --resume $regular_update_id
39+
echo '<testsuites><testsuite name="my_pipeline" tests="1"><testcase name="test_old"></testcase></testsuite></testsuites>' > out.not-test-update.xml
40+
trace musterr $CLI pipelines test my_pipeline --resume $regular_update_id --junit-xml out.not-test-update.xml
4041

4142
title "Outside a project, an older passing report is replaced\n"
4243
echo '<testsuites><testsuite name="my_pipeline" tests="1"><testcase name="test_old"></testcase></testsuite></testsuites>' > out.outside.xml

‎cmd/pipelines/test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ names the cause.`,
652652
return report.failed(ctx, err)
653653
}
654654
} else if err := checkTestUpdate(ctx, target.w, target.pipelineID, updateID); err != nil {
655-
return err
655+
return report.failed(ctx, err)
656656
}
657657
target.printHeader(out, updateID)
658658
if noWait {

0 commit comments

Comments
 (0)