Contributing
Getting Started
Section titled “Getting Started”- Fork the repository
- Clone your fork
- Create a feature branch
git clone https://github.com/YOUR_USERNAME/warpdl.gitcd warpdlgit checkout -b feat/my-featureDevelopment Setup
Section titled “Development Setup”# Install dependenciesgo mod download
# Buildmake build
# Run testsgo test ./...Testing
Section titled “Testing”WarpDL follows a testing trophy: most confidence comes from local real-component integration tests, backed by focused unit tests, with a selective layer of binary-level CLI/daemon E2E.
| Layer | Where | What it covers |
|---|---|---|
| Unit | *_test.go beside each package |
Focused logic and validation, security boundaries (paths, credentials, auth flows), concurrency and race behaviour, fuzz seeds. |
| Local integration (the bulk) | package tests in pkg/, internal/, cmd/ |
Real components in-process: daemon sockets and pipes, download manager and segment engine, real HTTP test servers serving range requests. No internet access needed. |
| CLI/daemon E2E (selective) | tests/e2e/ behind the e2e build tag |
Builds the actual binary, runs a real daemon, drives CLI commands against a local HTTP server, and asserts the downloaded artifact, including byte-level content checks. |
| External mirrors (advisory) | tests/e2e/ TestCLIDownload_* |
Availability probes against public download mirrors. They confirm the engine still works against real-world hosts; they are not a correctness gate. |
Run the default suite — unit tests plus local real-component integration:
go test ./... # everything without build tagsgo test ./... -count=1 # CI form: bypass the test cachego test -race -short ./... # race detector; -short trims the long stress casesCoverage must stay at or above 80% for both the total and every package
(scripts/check_coverage.sh, configured by COVERAGE_MIN and
COVERAGE_MIN_PER_PKG). A package with no test files fails the same check.
Do not lower these thresholds.
Run the local CLI/daemon E2E suite (no external network required):
go test -v -tags=e2e -skip '^TestCLIDownload_' -count=1 -timeout=10m ./tests/e2e/go test -v -tags=e2e -run TestScheduledDownload_StartAt ./tests/e2e/ # single scenario-skip is the supported go test flag for exclusion (RE2 has no negative
lookahead), and ^TestCLIDownload_ names the external-mirror group.
External mirror checks are advisory and need internet access; CI runs them as a non-blocking matrix, so a mirror outage or regional block says nothing about a change:
go test -v -tags=e2e -run TestCLIDownload_ASH -timeout=10m ./tests/e2e/Cover new behaviour at the layer that actually exercises it: focused unit tests for isolated logic, local integration when the behaviour spans components, and E2E only for CLI/daemon flows that no local test can reproduce.
Commit Message Format
Section titled “Commit Message Format”Follow conventional commits:
<area>: <type>: <message>
<description>Areas: core, daemon, cli, api, extl, credman, docs, debug
Types: feat, fix, refactor, perf, test, chore, temp
Example:
core,daemon: feat: add parallel segment mergingPull Request Process
Section titled “Pull Request Process”- Ensure tests pass:
go test ./... - Format code:
go fmt ./... - Update docs if needed
- Submit PR against
mainbranch
Code of Conduct
Section titled “Code of Conduct”Be respectful and constructive. See CODE_OF_CONDUCT.md.
