swarm-ci-metrics: move the settings and pass logic out of main and test it
main read the environment inline and held the per-repo pass, the certificate gauges and the verdict, so none of it could run in a test. Each is now a function with its inputs as arguments: - Env::read takes a lookup closure in place of std::env (same read order), var names a missing setting by its full variable. - finish, skip_counts, wanted_repo, walk_done, trimmed and cert_gauges hold the branches that were inline. - A pass talks to the forge, the identity provider and the collector through a Remote trait. Live is the daemon's HTTP implementation, and the tests' stand-in answers from memory, so no test opens a socket. - post_request builds the collector request and refused the refusal text, so both are tested without a connection. x509-cert becomes a dev-dependency (the workspace already pins it) for the test certificate. Behaviour is the same. Refs #6811
This commit is contained in:
parent
e8a6a4dfdb
commit
e88de09d72
1 changed files with 1022 additions and 119 deletions
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue