Integration harness for Unpackerr. Unpackerr stays a binary this repo starts. Tests fake Starr queue APIs, build small archives at runtime, and assert extracts through Unpackerr's HTTP API and the filesystem.
go_test → harness → fake Starr (GET /api/v3/queue or /api/v1/queue)
↘ unpackerr binary → download dirs / folder watches
GET /api/queue GET /api/history
- Go 1.27+
- Host tools:
rar,zip/unzip, and7z(or7zz/7za). A missing tool skips only the tests that need it. - An Unpackerr binary:
UNPACKERR_BIN=/path/to/unpackerr, or- a sibling checkout at
../unpackerr(this repo runsgo buildthere)
make test-unit # faker/fixture/harness unit tests
make test # go test -tags=integration -timeout 5m ./test/...
UNPACKERR_BIN=/usr/local/bin/unpackerr make testTimers in the generated TOML are short (interval / start_delay around
200ms–1s). Folder poll is off (interval = "0s") unless a test sets it.
Current Unpackerr still floors Starr interval and start_delay at 15s, so
extract assertions wait up to a minute. Restart tests reuse the same config
dir so unpackerr.history.jsonl can restore the live queue.
CI tests spawn Unpackerr. For a manual session you run two daemons yourself and inject queue rows:
-
Fake Starr (all four apps on one port):
go run ./cmd/faker -listen 127.0.0.1:8989 # or: make faker && ./fakerRoutes are
/sonarr,/radarr,/lidarr,/readarr. Point Unpackerr at:[[sonarr]] url = "http://127.0.0.1:8989/sonarr" api_key = "unpackerr-inttest-starr-key-32ch" [[radarr]] url = "http://127.0.0.1:8989/radarr" api_key = "unpackerr-inttest-starr-key-32ch" [[lidarr]] url = "http://127.0.0.1:8989/lidarr" api_key = "unpackerr-inttest-starr-key-32ch" [[readarr]] url = "http://127.0.0.1:8989/readarr" api_key = "unpackerr-inttest-starr-key-32ch"
-
Start Unpackerr yourself (GUI,
make dev, whatever) and watch the UI. -
Inject items. Either stage a built-in layout, or point at a folder you already have:
make inject ./inject -a sonarr -b rar ./inject -a all -b zip -size 32m -compress # four apps, slower extract ./inject -a sonarr -t Some.Show.S01E01 -p /abs/path/to/download-pand-tare mutually exclusive with-b.-aacceptssonarr,radarr,lidarr,readarr, a comma list, orall.-bwrites under-d(default./downloads).-sizeis the payload (4k,32m,1g);-compressuses real compression so the progress meter has something to do.-status downloadingleaves the row transferring until you:curl -sS -X POST http://127.0.0.1:8989/sonarr/debug/complete/1 curl -sS -X POST http://127.0.0.1:8989/sonarr/debug/drop/1
Built-ins:
rar,zip,7z,recursive(zip-in-zip),nests(three inner zips),subs(archive inSeason.01/),depth(archives at different folder depths),volumes,r00,password(folder name{{hunter2}}),empty,rarzip,syncthing(.tmpsibling).
internal/starrfake— in-memory queue, pagination,X-Api-Key, four-app hubinternal/fixtures— NFO/txt + urandom payloads; rar/zip/7z at test startinternal/harness— named[folder.*]/[sonarr.*]TOML, restart,/api/queueretryinternal/httpcap— records webhook JSON (unpackerr_eventtype,data, titles)internal/write— slow chunked writer for folderstart_delayinternal/inject— CLI that stages patterns and POSTs/debug/addcmd/faker— long-running fake Starr (/{app}/api/...)cmd/inject— feed faker without spawning Unpackerrtest/—//go:build integration
Do not commit binary archives. GitHub Actions installs rar / p7zip-full /
zip, checks out Unpackerr (UNPACKERR_REF, default main), builds it, and
runs the integration tag.