Unit-tests and CI pipelines for them#20
Open
mrwesadex-flant wants to merge 12 commits into
Open
Conversation
Drop the push trigger. The upstream action's diff mode needs github.event.number (only present on pull_request); on push it builds an empty refspec (+refs/pull//merge:...) and git fetch fails with exit 128.
The diff scan flags commit 5f1edc2, which introduced the base64("user:token") test fixture before the inline gitleaks:allow comment was added, so the inline suppression cannot hide it. Ignore the finding by fingerprint instead.
2dd1e53 to
0c219c5
Compare
Code Coverage OverviewLanguages: Go Go / code-coverage/goThe overall coverage in the branch is 9%. The coverage in the branch is 2%. Show a code coverage summary of the most impacted files.
Updated |
main's golangci-lint config (pulled in by the rebase) flagged the unit-test files: gocritic paramTypeCombine, gofmt, misspell (behaviour/cancelled), ineffassign, and a staticcheck De Morgan simplification.
…ransition to a content-based allowlist in gitleaks.toml, which addresses false positives without relying on commit fingerprints.
fastrapier
requested changes
Jun 24, 2026
main's go-checks.yml already runs lint, race-enabled unit tests and coverage publishing, so a dedicated unit-tests.yml was redundant. Point the Makefile header at go-checks.yml.
|
fastrapier
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a hermetic unit-test suite for the framework's deterministic core logic and a mandatory CI pipeline that builds, vets and runs those tests on every push and PR. No production code under
pkg//internal/changes behavior — this PR is tests, CI wiring, tooling and docs.What's included
CI / tooling
.github/workflows/unit-tests.yml—Build, vet & unit testjob:go build ./...,go vet ./..., andgo test -race -shuffle=on -covermode=atomicscoped to./internal/... ./pkg/...(e2e suites under./tests/...stay off CI since they need real VMs/clusters/SSH). Uploadscoverage.outas an artifact.Makefile—build/vet/test/cover/e2e/cleantargets mirroring the CI commands somake testlocally == the CI job..gitignore— ignorecoverage.out/coverage.html.Gitleaks
gitleaks-scan-on-pr.yml→gitleaks.ymland kept itpull_request-scoped (the upstream action's diff mode needsgithub.event.number, so it can't run onpush).gitleaks.toml— content-based allowlist ([extend] useDefault=true) for thebase64("user:token")test fixture in the commander client tests. Chosen over a.gitleaksignorefingerprint because fingerprints are pinned to a commit SHA and break on rebase.Unit tests (hermetic, table-driven — no SSH/cluster/network)
pkg/retry/retry_test.go—Do/IsRetryable/IsSSHConnectionError/WithRetryAfter, including context-cancel and backoff paths.pkg/kubernetes/{apply,modules,poll}_test.go— YAML doc splitting + env-var scanning, module graph topo-sort + cycle detection, readiness polling helpers.pkg/cluster/vms_test.go— pure VM helpers (random suffix, etc.).pkg/testkit/stress_tests_test.go—Config.Validate/DefaultConfig.internal/config/types_yaml_test.go—ClusterNode/ClusterDefinitionYAML unmarshal + validation.internal/logger/level_test.go—LevelToStringround-trip.internal/kubernetes/commander/client_test.go+client_http_test.go— mapper/base64/validation helpers and the full Commander HTTP client driven against anhttptest.Server.Docs
docs/TESTS_IMPLEMENTATION_PLAN.md,docs/WORKLOG.md, andCLAUDE.md(repo working guidance).Test plan
go build ./...go vet ./...go test -race -shuffle=on ./internal/... ./pkg/...golangci-lint(via CILintjob)Notes
main; no merge conflicts.