Skip to content

chore : increase code coverage and testing#29

Merged
felipegenef merged 2 commits into
mainfrom
chore-increase-code-coverage-and-testing
Jun 4, 2026
Merged

chore : increase code coverage and testing#29
felipegenef merged 2 commits into
mainfrom
chore-increase-code-coverage-and-testing

Conversation

@felipegenef

Copy link
Copy Markdown
Owner

🚀 PR: Comprehensive Test Quality & Coverage Audit

This PR represents a major hardening of the Gothic CLI test suite. Beyond increasing raw coverage to >80% (effective), the focus was shifted to High-Signal Validation—ensuring that every test secures a real-world behavior and eliminates "silent failure" modes.

🔴 Critical Fixes (CI & Portability)

  • Decoupled AST Scanner from Local FS: Removed all hardcoded absolute paths in pkg/helpers/wasm/astx. Test paths are now dynamically resolved using runtime.Caller, enabling seamless execution on any machine or CI runner.
  • WASM Cache Invalidation Proof: Added end-to-end hash verification to ensure that updates to the CLI's embedded Runtime or Templates correctly flip the cache key. This guarantees users won't ship stale WASM binaries after a framework upgrade.

🟡 Logic & Security Hardening

  • Infrastructure Assertions: Hardened AWS S3 deployment tests to assert full argv signatures. This prevents regressions where recursive flags or AWS profiles might be dropped, causing partial or mis-targeted deployments.
  • Tailwind Reliability: Added a "Cache-Miss" download test for the Tailwind binary, ensuring the automated download and checksum verification logic works as intended on fresh installs.
  • Proxy Resilience: Rewrote the Proxy RoundTripper tests to use real httptest blocking servers. This confirms the Exponential Backoff and Context Cancellation logic works against real networking timeouts, not just mock errors.

🟢 Quality & Maintenance

  • Removed Tautological Tests: Deleted ~5 "placeholder" tests that were asserting Go's internal mechanics (like struct assignment or file writing) rather than framework logic.
  • Standardized Checksums: Consolidated checksum parsing assertions into a single canonical suite in wasm_binary_test.go, removing duplication in the download helpers.
  • Watch Loop Stability: Replaced flaky time.Sleep calls in the Hot Reload seam with a polling mechanism that waits for the debounce timer to arm. This eliminates "timing-flaky" false negatives in CI.

📊 Coverage Impact

  • Effective Coverage: Recalculated at >80% (Project Target).
  • Exclusions: Updated codecov.yml to ignore generated boilerplate (_templ.go), internal parity stubs, and static data templates, providing a more honest view of the CLI's logic health.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 81.81818% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/cli/cli.go 44.44% 5 Missing ⚠️
cmd/hotReload.go 82.60% 2 Missing and 2 partials ⚠️
cmd/init.go 55.55% 4 Missing ⚠️
pkg/helpers/templ.go 40.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@felipegenef
felipegenef merged commit d9f6345 into main Jun 4, 2026
1 check passed
@felipegenef
felipegenef deleted the chore-increase-code-coverage-and-testing branch June 4, 2026 15:12
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.

2 participants