Skip to content

Stabilize reconciler unit tests to fix Run Unit Tests GitHub Actions failure#11772

Draft
Copilot wants to merge 20 commits into
mainfrom
copilot/fix-rad-init-bicepconfig
Draft

Stabilize reconciler unit tests to fix Run Unit Tests GitHub Actions failure#11772
Copilot wants to merge 20 commits into
mainfrom
copilot/fix-rad-init-bicepconfig

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

Description

This PR fixes the failing Run Unit Tests GitHub Actions job by stabilizing reconciler test lifecycle behavior in pkg/controller/reconciler.

The failure was traced to test manager goroutines in reconciler tests using panic-based error handling and non-deterministic shutdown timing. I updated the test setup helpers to use deterministic manager startup/shutdown coordination with cleanup ordering that waits for mgr.Start(...) to exit after cancellation, and only fails on unexpected non-cancellation errors.

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document is added or updated under eng/design-notes/ in this repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for resource-types-contrib is created, if resource types or recipes are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for dashboard is created, if the Radius Dashboard is affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable

Copilot AI and others added 2 commits April 28, 2026 15:23
…icep, warn on existing config

Agent-Logs-Url: https://github.com/radius-project/radius/sessions/501b2ffa-3885-4125-99fc-75725464c1c1

Co-authored-by: zachcasper <30731731+zachcasper@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Unit Tests

    1 files   -     1    336 suites   - 87   7m 22s ⏱️ -17s
5 113 tests  -    15  5 110 ✅  -    16  2 💤 ±0  1 ❌ +1 
5 112 runs   - 1 045  5 109 ✅  - 1 046  2 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit ca279b7. ± Comparison against base commit 9a15c2d.

This pull request removes 25 and adds 10 tests. Note that renamed tests count towards both.
github.com/radius-project/radius/cmd/rad/cmd ‑ Test_HandlePanic
github.com/radius-project/radius/cmd/rad/cmd ‑ Test_prettyPrintJSON
github.com/radius-project/radius/cmd/rad/cmd ‑ Test_prettyPrintJSON/formats_JSON_correctly
github.com/radius-project/radius/cmd/rad/cmd ‑ Test_prettyPrintJSON/formats_complex_objects
github.com/radius-project/radius/cmd/rad/cmd ‑ Test_prettyPrintJSON/handles_invalid_JSON
github.com/radius-project/radius/cmd/rad/cmd ‑ Test_prettyPrintRPError
github.com/radius-project/radius/pkg/cli/cmd/radinit ‑ Test_Validate/Initialize_--full_with_existing_environment_create_application_-_initial_appname_is_invalid
github.com/radius-project/radius/pkg/cli/cmd/radinit ‑ Test_enterApplicationOptions
github.com/radius-project/radius/pkg/cli/cmd/radinit ‑ Test_enterApplicationOptions/create_application:_No
github.com/radius-project/radius/pkg/cli/cmd/radinit ‑ Test_enterApplicationOptions/create_application:_Yes
…
TestMain
github.com/radius-project/radius/pkg/cli/cmd/radinit ‑ Test_Run_InstallRadiusError
github.com/radius-project/radius/pkg/cli/cmd/radinit ‑ Test_Run_WarnsWhenBicepConfigAlreadyExists
github.com/radius-project/radius/pkg/cli/helm ‑ Test_ClusterOptions_logf_FallsBackWhenLoggerNil
github.com/radius-project/radius/pkg/cli/helm ‑ Test_ClusterOptions_logf_UsesCustomLogger
github.com/radius-project/radius/pkg/cli/setup ‑ Test_ScaffoldBicepConfig_CreatesFile
github.com/radius-project/radius/pkg/cli/setup ‑ Test_ScaffoldBicepConfig_DoesNotCreateAppBicep
github.com/radius-project/radius/pkg/cli/setup ‑ Test_ScaffoldBicepConfig_KeepsExistingFile
github.com/radius-project/radius/pkg/cli/setup ‑ Test_ScaffoldBicepConfig_StatError
github.com/radius-project/radius/pkg/cli/setup ‑ Test_ScaffoldBicepConfig_WriteFileError

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

❌ Patch coverage is 52.00000% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.42%. Comparing base (79aeb54) to head (04df42f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cli/cmd/radinit/common/display.go 0.00% 11 Missing ⚠️
pkg/cli/cmd/radinit/preview/init.go 36.36% 4 Missing and 3 partials ⚠️
pkg/cli/cmd/radinit/init.go 58.33% 2 Missing and 3 partials ⚠️
pkg/cli/helm/cluster.go 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11772      +/-   ##
==========================================
+ Coverage   51.39%   51.42%   +0.03%     
==========================================
  Files         716      713       -3     
  Lines       45106    45025      -81     
==========================================
- Hits        23181    23156      -25     
+ Misses      19725    19678      -47     
+ Partials     2200     2191       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
@zachcasper zachcasper changed the title [WIP] Fix rad init to always create bicepconfig.json and remove prompt Fix rad init to always create bicepconfig.json and remove prompt Apr 28, 2026
zachcasper added 10 commits May 7, 2026 10:40
Resolve conflicts after the rad init refactor on main that moved shared
prompt and display logic into pkg/cli/cmd/radinit/common.

- application.go/application_test.go: keep PR's deletion (rad init no
  longer prompts to scaffold an application).
- display.go: keep PR's BicepConfig rename. Switch to the thin wrapper
  introduced on main and pass the bicepconfig file through a new
  common.BicepConfigDisplay so the shared summary/progress views render
  the '🚧 Create bicepconfig.json' step.
- common/display.go: add BicepConfigDisplay, BicepConfigComplete, and
  the bicepconfig summary/progress rendering. Make isComplete only
  require ApplicationComplete when scaffolding and BicepConfigComplete
  when bicepconfig files are present, so both rad init and rad init
  --preview work.
- pkg/cli/setup/application.go: restore ScaffoldApplication so
  rad init --preview keeps building (it scaffolds app.bicep and reuses
  ScaffoldBicepConfig).
- init_test.go: drop the application prompt mock setup and the new
  'create application - initial appname is invalid' test case; switch
  to common.ResultConfirmed and common.ProgressModel.
Mirror the rad init change for the --preview command:

- Delete preview/application.go and preview/application_test.go.
- Drop applicationOptions, the Application field on initOptions, and the
  enterApplicationOptions call in preview/options.go.
- Replace the application scaffold step in preview/init.go with the same
  bicepconfig scaffold + warning flow used by rad init. The Application
  scaffold step is gone; a bicepconfig.json is always created and the
  user is warned if one already existed.
- Update preview/display.go to populate common.BicepConfigDisplay so the
  shared summary/progress views render the bicepconfig step.
- Strip setScaffoldApplicationPrompt* and setApplicationNamePrompt calls
  from preview/init_test.go, drop the 'create application - initial
  appname is invalid' test case and the helper functions, remove the
  Application field from the Test_Run options, and t.Chdir to a temp
  dir so bicepconfig scaffolding does not affect the source tree.
- Remove pkg/cli/setup.ScaffoldApplication; nothing references it now.
Neither rad init nor rad init --preview scaffold an application any
more, so the helpers and display fields that supported that flow are
unused.

- Delete pkg/cli/cmd/radinit/common/application.go and its test file
  (EnterApplicationOptions and the Confirm/Enter prompt constants).
- Drop ApplicationDisplay, DisplayOptions.Application, and
  ProgressMsg.ApplicationComplete from common/display.go, along with
  the SummaryApplication* constants and the application branches in
  the summary/progress views and isComplete.
- Update the rad init Run doc comment to say it scaffolds a
  bicepconfig.json (not an application).
@radius-functional-tests
Copy link
Copy Markdown

radius-functional-tests Bot commented May 18, 2026

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository radius-project/radius
Commit ref ca279b7
Unique ID func0382ec7b14
Image tag pr-func0382ec7b14
  • gotestsum 1.13.0
  • KinD: v0.29.0
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func0382ec7b14
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func0382ec7b14
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func0382ec7b14
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func0382ec7b14
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func0382ec7b14
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@DariuszPorowski
Copy link
Copy Markdown
Member

@brooke-hamilton PTAL

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint-api.hashicorp.com
    • Triggering command: /tmp/terraform-download-test3483464973/terraform /tmp/terraform-download-test3483464973/terraform version -json 20ITjMqImDWg -d: @v0.18.2/httptra-errorsas @v0.18.2/httptra-ifaceassert ux-amd64/pkg/tool/linux_amd64/link urces/processors/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.3.lin/tmp/go-build3782494991/b2920/_testmain.go syscall rg/toolchain@v0./tmp/go-build3782494991/b2812/_pkg_.a ux-amd64/pkg/too-trimpath e=/t�� 1.80.0/internal/-p 1.80.0/internal/main 0.1-go1.26.3.lin-lang=go1.26 kg_.a transport t MFzr34n/OBNk19iM-trimpath (dns block)
    • Triggering command: /tmp/terraform-download-test3483464973/terraform /tmp/terraform-download-test3483464973/terraform version -json -dwarf=false -goversion go1.26.3 -c=4 -nolocalimports -importcfg /tmp/go-build3782494991/b2835/importcfg -pack /tmp/go-build3782494991/b2835/_testmain.go -c -control-plane/e-s -control-plane/e-w 0.1-go1.26.3.lin-buildmode=exe kg_.a tionstores mpile 0.1-go1.26.3.lin-buildtags (dns block)
    • Triggering command: /tmp/terraform-reuse-test395216801/terraform /tmp/terraform-reuse-test395216801/terraform version -json l/linux_amd64/link go1.26.3 -c=4 -nolocalimports -importcfg /tmp/go-build3782494991/b2883/importcfg -pack /home/REDACTED/work/radius/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go wqoJ3qyCfbBt e=/t�� -control-plane/e-errorsas -control-plane/e-ifaceassert ux-amd64/pkg/tool/linux_amd64/compile ndlers.test balancergroup mpile ux-amd64/pkg/too-trimpath (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Fix rad init to always create bicepconfig.json and remove prompt Stabilize reconciler unit tests to fix Run Unit Tests GitHub Actions failure May 18, 2026
Copilot AI requested a review from zachcasper May 18, 2026 18:36
@zachcasper zachcasper marked this pull request as draft May 18, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rad init should always create bicepconfig.json, remove confusing prompt, and not generate app.bicep

6 participants