Skip to content

test: improve coverage for templates, azure id resolution and apply dirs - #1178

Merged
cdalar merged 1 commit into
mainfrom
test/improve-coverage
Oct 5, 2026
Merged

cdalar merged 1 commit into
mainfrom
test/improve-coverage

Conversation

@cdalar

@cdalar cdalar commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds tests for findSingleFile (embedded-file branch, local file overrides embedded), findFile, resolveAzureIdentifiers, ensureProvider and checkCloudProvider in cmd/logic_coverage_test.go.
  • Adds tools.NextApplyDir tests in internal/tools/apply_dir_test.go.
  • Azure tests use a fake az on PATH, so they need no real login.
  • Total statement coverage: 52.9% -> 53.9% (internal/tools 39.8% -> 47.8%; cmd 45.7% -> 46.0%).

Test plan

  • go test ./... passes, go vet, gofmt and golangci-lint clean (Go 1.27.1)
  • Note: TestPopulateOnctlEnv_ErrorWritingFile fails when run as root (root ignores the 0444 permission it relies on) and panics the cmd package. I skipped it locally with -skip; it is unchanged and unrelated to this PR.

Remaining gaps are mostly cloud-SDK wrappers (deploy.go, hetzner.go, aws.go, azure.go) and the providerch/providerfc shell-out code, which need fakes or refactoring.

🤖 Generated with Claude Code

Adds tests for findSingleFile's embedded-file branch, resolveAzureIdentifiers
(using a fake az on PATH), ensureProvider, checkCloudProvider and
tools.NextApplyDir. Total statement coverage 52.9% -> 53.9%.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cdalar
cdalar enabled auto-merge (squash) October 5, 2026 05:44
@cdalar
cdalar merged commit a7378ed into main Oct 5, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址