Skip to content

Commit

Permalink
chore: fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzzzzzzz committed Mar 20, 2024
1 parent d7b8ab4 commit f70eb31
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions test/artifacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ func TestSurfaceArtifactsThroughTerminationMessage(t *testing.T) {
updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{
"results-from": config.ResultExtractionMethodTerminationMessage,
})
t.Cleanup(func() {

knativetest.CleanupOnInterrupt(func() {
updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{
"results-from": previous,
})
})

knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf)
defer tearDown(ctx, t, c, namespace)
tearDown(ctx, t, c, namespace)
}, t.Logf)
defer func() {
updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{
"results-from": previous,
})
tearDown(ctx, t, c, namespace)
}()

taskRunName := helpers.ObjectNameForTest(t)

Expand Down Expand Up @@ -123,15 +128,20 @@ func TestConsumeArtifact(t *testing.T) {
updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{
"results-from": config.ResultExtractionMethodTerminationMessage,
})
t.Cleanup(func() {

knativetest.CleanupOnInterrupt(func() {
updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{
"results-from": previous,
})
})

knativetest.CleanupOnInterrupt(func() { tearDown(ctx, t, c, namespace) }, t.Logf)
defer tearDown(ctx, t, c, namespace)
tearDown(ctx, t, c, namespace)
}, t.Logf)

defer func() {
updateConfigMap(ctx, c.KubeClient, system.Namespace(), config.GetFeatureFlagsConfigName(), map[string]string{
"results-from": previous,
})
tearDown(ctx, t, c, namespace)
}()
taskRunName := helpers.ObjectNameForTest(t)

fqImageName := getTestImage(busyboxImage)
Expand Down

0 comments on commit f70eb31

Please sign in to comment.