Repository navigation
14 Testing and Verification
Vicky Patel edited this page Nov 18, 2026
·
1 revision
Unit Testing, Template Drift Prevention, Integration Suites, and CI Checks
GitVerse operates under a strict Quality Assurance protocol:
- Deterministic Accuracy: Calculation algorithms must never hallucinate milestones or miscalculate tier progress.
- Zero-Drift Invariance: Static HTML pages must never drift out of sync from Go code models.
- Cross-Platform Compatibility: CLI binaries must pass tests on Linux, macOS, and Windows.
graph TD
TestMatrix[GitVerse QA Matrix] --> GoTests[Go Test Suite: Unit & Integration]
TestMatrix --> Drift[Zero-Drift Static Checks]
TestMatrix --> JSTests[Node.js DOM Test Suite]
TestMatrix --> Linters[golangci-lint & CodeQL]
go test -v ./...This executes tests across:
-
internal/engine: Validates threshold math, edge case boundaries, and progress percentages. -
internal/catalog: Validates that all 15 achievements contain proper metadata, valid URLs, and non-decreasing thresholds. -
internal/github: Tests HTML token parsing against fixture data without hitting live GitHub servers. -
internal/webui: Asserts that HTML templates render without escaping errors or syntax breaks.
CI tests verify that static pages in site/ match the canonical Go templates:
go test -run TestGendocsDrift ./...If you edited template content without running go run scripts/gendocs/main.go, this test will pinpoint the exact diff and fail early.
To test browser DOM interactions (e.g. copy buttons, search input behaviors):
node --test web/web_test.jsNetwork calls to GitHub are mocked during unit tests using local HTML and JSON fixtures located in internal/github/testdata/:
-
profile_full.html: Sample user profile containing multiple unlocked tiers. -
profile_empty.html: Brand new user with zero unlocked achievements. -
achievement_modal_pull_shark.html: Raw modal fragment with multiple milestone dates.
This guarantees tests run offline, execute in milliseconds, and avoid rate limiting.
| ๐๏ธ Project Hub | ๐ ๏ธ Developer Docs | ๐ฌ Community & Support |
|---|---|---|
| GitHub Repository | System Architecture | Live Web App |
| Track Any Profile | Achievement Catalog | Open Issues |
| Explore Badge Guides | CLI Reference | Pull Requests |
| Project Roadmap | Testing & QA Matrix | Maintainer Runbook |