Skip to content

refactor(test): use t.Context() instead of context.Background() - #12523

Draft
DariuszPorowski wants to merge 2 commits into
mainfrom
dp/comparable-lark-maroon
Draft

refactor(test): use t.Context() instead of context.Background()#12523
DariuszPorowski wants to merge 2 commits into
mainfrom
dp/comparable-lark-maroon

fix(test): use context with timeout for cleanup in AWS resource setup

147252c
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
GitHub Actions / Unit Tests failed Jul 23, 2026 in 0s

5 fail, 2 skipped, 6 003 pass in 6m 53s

    1 files  +    1    363 suites  +363   6m 53s ⏱️ + 6m 53s
6 010 tests +6 010  6 003 ✅ +6 003  2 💤 +2  5 ❌ +5 
6 009 runs  +6 009  6 001 ✅ +6 001  2 💤 +2  6 ❌ +6 

Results for commit 147252c. ± Comparison against earlier commit 04e2096.

Annotations

Check warning on line 0 in github.com/radius-project/radius/pkg/components/secret

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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)

Check warning on line 0 in /

See this annotation in the file changed.

@github-actions 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]