Skip to content

test(azure): stub server pagers in Azure SQL converter tests - #257

Merged
cristim merged 4 commits into
mainfrom
test/azure-sql-converter-stub-pagers
Oct 6, 2026
Merged

cristim merged 4 commits into
mainfrom
test/azure-sql-converter-stub-pagers

Conversation

@cristim

@cristim cristim commented Oct 6, 2026

Copy link
Copy Markdown
Member

Closes #184

Three converter tests (PopulatesAllFields, PopulatesEngineVersion, CapabilitiesErrorFallsBack) stubbed only capabilities. convertAzureSQLRecommendation reaches fetchServerInfo, which built default ARM pagers and issued real GETs to management.azure.com (a 400 InvalidSubscriptionId came back in the test log).

Fix: inject empty managed-instance and server pagers in those three tests.

Verification: before, go test -short -v on the package logged 3 management.azure.com requests; after, 0. Removing the pagers from one test again produced 1. No loud-failure guard added: the package has no existing network-denial pattern and the issue's suggested one would be a new abstraction.

Three converter tests stubbed only capabilities, so convertAzureSQLRecommendation walked the default ARM pagers and sent real GETs to management.azure.com. Inject empty managed-instance and server pagers so none can reach a live client.
@cristim cristim added priority/p2 Backlog-worthy triaged Item has been triaged impact/internal Team-internal only severity/low Minor harm urgency/this-quarter Within the quarter effort/s Hours type/bug Defect labels Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 5 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 64 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-go/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: aa8901f7-5987-451e-a065-d344fe5ff2c2
📥 Commits

Reviewing files that changed from the base of the PR and between a59df8d and 85f5cd4.

📒 Files selected for processing (2)
  • providers/azure/services/database/client_test.go
  • providers/azure/services/database/network_guard_test.go
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

cristim and others added 3 commits October 6, 2026 08:19
Route the SDK's own transport through a counting loopback proxy installed in TestMain and assert the converter scenarios make zero external requests.
@cristim
cristim merged commit 2e8cc34 into main Oct 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/internal Team-internal only priority/p2 Backlog-worthy severity/low Minor harm triaged Item has been triaged type/bug Defect urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure SQL converter unit tests leave server-info pagers live

1 participant