.agents/skills/test/SKILL.md
Run onepixel unit and e2e tests with correct env setup, coverage artifacts, and troubleshooting guidance for GeoIP/network-related failures.
npx skillsauth add championswimmer/onepixel_backend testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill for unit tests, e2e tests, targeted test runs, and test triage.
make test_unitmake test_e2emake testENV=test go test -count 1 ./src/security/...ENV=test go test -count 1 ./src/controllers/...ENV=test go test -count 1 ./tests/e2e -run TestRegisterUserDefined in Makefile at repo root:
test_clean
app.db, events.db, events.db.waltest_unit (depends on test_clean)
coverage.unit.outENV=test go test -count 1 -timeout 10s -race -coverprofile=coverage.unit.out -covermode=atomic -v -coverpkg=./src/... ./src/...test_e2e (depends on test_clean)
coverage.e2e.outENV=test go test -count 1 -timeout 10s -race -coverprofile=coverage.e2e.out -covermode=atomic -v -coverpkg=./src/... ./tests/...test
test_unit then test_e2eENV=test triggers src/config/env.go logic:
onepixel.test.envonepixel.local.env as fallback defaultsonepixel.test.env sets sqlite/duckdb dialects.USE_FILE_DB comes from fallback local env by default (true in onepixel.local.env).db.GetGeoIPDB() checks ./GeoLite2-City.mmdb freshness (30 days). If stale/missing, it downloads from:
https://git.io/GeoLite2-City.mmdbIn restricted/offline environments, tests touching GeoIP can fail due to network/DNS.
Mitigation before running tests:
curl -L https://git.io/GeoLite2-City.mmdb -o GeoLite2-City.mmdbmake test_unit.make test_e2e when API/integration behavior changed.make test before final handoff when feasible.-timeout 10s; for debugging, rerun failing package with a longer timeout manually.coverage.unit.outcoverage.e2e.outdata-ai
Understand onepixel database topology by environment, data ownership across app/events stores, and initialization/migration behavior.
development
Apply onepixel repository conventions for env loading, DB backend selection, auth locals, error payloads, and shortcode semantics.
development
Build and run onepixel binaries, generate Swagger docs when needed, and produce cross-platform release artifacts.
data-ai
Understand onepixel runtime architecture, host-based app dispatch, and redirect analytics flow before changing behavior across routes/controllers/db.