refactor(test): use t.Context() instead of context.Background() - #12523
refactor(test): use t.Context() instead of context.Background()#12523DariuszPorowski wants to merge 2 commits into
5 fail, 2 skipped, 6 003 pass in 6m 53s
Annotations
Check warning on line 0 in github.com/radius-project/radius/pkg/components/secret
github-actions / Unit Tests
Test_SaveSecret/save-secret-success (github.com/radius-project/radius/pkg/components/secret) failed
dist/unit_test//processed/results.xml [took 0s]
Raw output
Failed
=== RUN Test_SaveSecret/save-secret-success
testing.go:1913: test executed panic(nil) or runtime.Goexit: subtest may have called FailNow on a parent test
--- FAIL: Test_SaveSecret/save-secret-success (0.00s)
Check warning on line 0 in github.com/radius-project/radius/pkg/components/secret
github-actions / Unit Tests
Test_SaveSecret (github.com/radius-project/radius/pkg/components/secret) failed
dist/unit_test//processed/results.xml [took 0s]
Raw output
Failed
=== RUN Test_SaveSecret
client.go:46: Unexpected call to *secret.MockClient.Save([context.Background.WithCancel azure-azurecloud-default [123 34 99 108 105 101 110 116 73 100 34 58 34 99 108 105 101 110 116 73 100 34 44 34 107 105 110 100 34 58 34 97 122 117 114 101 34 44 34 115 101 99 114 101 116 34 58 34 115 101 99 114 101 116 34 44 34 116 101 110 97 110 116 73 100 34 58 34 116 101 110 97 110 116 73 100 34 125]]) at /home/runner/work/radius/radius/pkg/components/secret/client.go:46 because:
expected call at /home/runner/work/radius/radius/pkg/components/secret/client_test.go:55 doesn't match the argument at index 0.
Got: context.Background.WithCancel (*context.cancelCtx)
Want: is equal to context.Background (context.backgroundCtx)
controller.go:251: missing call(s) to *secret.MockClient.Save(is equal to context.Background (context.backgroundCtx), is equal to azure-azurecloud-default (string), is anything) /home/runner/work/radius/radius/pkg/components/secret/client_test.go:55
controller.go:251: aborting test due to missing call(s)
--- FAIL: Test_SaveSecret (0.00s)
Check warning on line 0 in github.com/radius-project/radius/pkg/components/secret
github-actions / Unit Tests
Test_GetSecret/get-secret-success (github.com/radius-project/radius/pkg/components/secret) failed
dist/unit_test//processed/results.xml [took 0s]
Raw output
Failed
=== RUN Test_GetSecret/get-secret-success
testing.go:1913: test executed panic(nil) or runtime.Goexit: subtest may have called FailNow on a parent test
--- FAIL: Test_GetSecret/get-secret-success (0.00s)
Check warning on line 0 in github.com/radius-project/radius/pkg/components/secret
github-actions / Unit Tests
Test_GetSecret (github.com/radius-project/radius/pkg/components/secret) failed
dist/unit_test//processed/results.xml [took 0s]
Raw output
Failed
=== RUN Test_GetSecret
client.go:52: Unexpected call to *secret.MockClient.Get([context.Background.WithCancel azure-azurecloud-default]) at /home/runner/work/radius/radius/pkg/components/secret/client.go:52 because:
expected call at /home/runner/work/radius/radius/pkg/components/secret/client_test.go:94 doesn't match the argument at index 0.
Got: context.Background.WithCancel (*context.cancelCtx)
Want: is equal to context.Background (context.backgroundCtx)
controller.go:251: missing call(s) to *secret.MockClient.Get(is equal to context.Background (context.backgroundCtx), is equal to azure-azurecloud-default (string)) /home/runner/work/radius/radius/pkg/components/secret/client_test.go:94
controller.go:251: aborting test due to missing call(s)
--- FAIL: Test_GetSecret (0.00s)
github-actions / Unit Tests
All 2 runs failed: TestMain
dist/unit_test//processed/results.xml [took 0s]
Raw output
Failed
FAIL github.com/radius-project/radius/pkg/dynamicrp/frontend [build failed]