Skip to content

chore: overhaul the test suite - #152

Merged
rustatian merged 2 commits into
masterfrom
chore/overhaul-test-suite
Aug 18, 2026
Merged

rustatian merged 2 commits into
masterfrom
chore/overhaul-test-suite

Conversation

@rustatian

Copy link
Copy Markdown
Member

Wave 2 overhaul, and the last of the infra group. 1893 lines of e2e across three files, 20 tests, 22 fixed sleeps.

The gzip file was a parallel copy of the suite. 452 lines repeating every scenario from the main file with one extra dial option. gzip is now a dial option rather than a second suite, so those four cases reuse the same configs and helpers.

Mutual TLS had no negative case. The suite asserted only that a properly certified client succeeds — a server that ignored client_auth_type: require_and_verify_client_cert would have passed every test. Added the case where a client presents no certificate and must be refused.

Dial helpers cover the three connection kinds the configs need: plaintext, TLS trusting the test CA, and mutual TLS with the client certificate. Each test now says which one it wants instead of rebuilding tls.Config inline — that block appeared five times.

Split by theme: request/response, TLS, gzip, reflection, observability (metrics, status, otel, otlp). The status test also gained an unregistered plugin name, which must report nothing rather than matching whatever it is asked for.

A gitignore rule that never worked. .gitignore read ./tests/test-certs/**; a leading ./ makes the pattern match nothing, so the generated certificates — including private keys — were not actually ignored. Anyone running the suite locally could commit them. Now tests/test-certs/.

Local results: root unit 25.3%, e2e 68.1%, merged 81.9% against a current badge of 78%. Full suite including every TLS case runs in ~25s and is stable across 3 consecutive shuffled runs — verified here with mkcert-generated certificates, matching what CI builds.

Two corrections I made after reading the originals rather than assuming:

  • the "multiple" config is about multiple proto files, and the original asserted the health service, not a second echo service
  • issue 1193 is about the Serve error carrying the worker's full stdout garbage, not an rpc error to the caller

CI: -coverpkg named only the root package, so codec, parser and proxy were never measured. The e2e step also listed test files by name, so a newly added file simply would not run — both now use ./.... Dropped -failfast, unfolded the ee step from a single escaped line into a readable block, and added the coverage guard.

Replace the per-test endure boilerplate with a Start helper and dial
helpers for the three connection kinds the configs need: plaintext, TLS
trusting the test CA, and mutual TLS presenting the client certificate.
The 22 fixed sleeps are gone.

The gzip file repeated every scenario from the main file with one extra
dial option, 452 lines for four cases. It now reuses the same configs
and helpers, so gzip is a dial option rather than a parallel suite.

Add the negative half of mutual TLS: a client that presents no
certificate must be refused. The suite only ever asserted the success
path, so a server that ignored client_auth_type would have passed.

Split the rest by theme: request/response, TLS, gzip, reflection and
observability. The status test gains an unregistered plugin name, which
must report nothing rather than matching.

Fix the test-certs ignore rule. It read ./tests/test-certs/**, and the
leading ./ makes the pattern match nothing, so generated certificates
and their private keys were never actually ignored.
coverpkg named the root package only, so codec, parser and proxy went
unmeasured, and the e2e step listed test files by name so a new file
would not run. Drop -failfast, unfold the ee step from a single escaped
line, and fail the codecov job when the merged summary maps to no plugin
source.
Copilot AI lite review requested due to automatic review settings August 17, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.41%. Comparing base (25672bc) to head (5b09109).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
+ Coverage   78.38%   78.41%   +0.03%     
==========================================
  Files           7       10       +3     
  Lines         495      746     +251     
==========================================
+ Hits          388      585     +197     
- Misses         80      117      +37     
- Partials       27       44      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rustatian rustatian self-assigned this Aug 18, 2026
@rustatian
rustatian merged commit a3a8f79 into master Aug 18, 2026
9 checks passed
@rustatian
rustatian deleted the chore/overhaul-test-suite branch August 18, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants