with one click
test
// Run onepixel unit and e2e tests with correct env setup, coverage artifacts, and troubleshooting guidance for GeoIP/network-related failures.
// Run onepixel unit and e2e tests with correct env setup, coverage artifacts, and troubleshooting guidance for GeoIP/network-related failures.
Reference for all onepixel API endpoints, their HTTP methods, paths, auth requirements, and behavior.
Understand onepixel database topology by environment, data ownership across app/events stores, and initialization/migration behavior.
Understand onepixel runtime architecture, host-based app dispatch, and redirect analytics flow before changing behavior across routes/controllers/db.
Build and run onepixel binaries, generate Swagger docs when needed, and produce cross-platform release artifacts.
Apply onepixel repository conventions for env loading, DB backend selection, auth locals, error payloads, and shortcode semantics.
| name | test |
| description | Run onepixel unit and e2e tests with correct env setup, coverage artifacts, and troubleshooting guidance for GeoIP/network-related failures. |
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.out