• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

coverallsapp / coverage-reporter / 31819844232
95%

Build:
DEFAULT BRANCH: master
Ran 14 Aug 2026 04:34PM UTC
Jobs 1
Files 42
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Aug 2026 04:32PM UTC coverage: 94.07% (-0.1%) from 94.171%
31819844232

push

github

web-flow
Fix order-dependent flakiness in webhook specs (#179)

`spec/coverage_reporter/api/webhook_spec.cr` intermittently failed in CI with:

    Failure: `subject.send_request` raised WebMock::NetConnectNotAllowedError

Root cause: the spec's expected request body assumes `Config#to_h` yields only
the repo token, which holds only when no CI provider is detected. Under GitHub
Actions the real GITHUB_* variables are present, so Config auto-detects CI and
`#to_h` gains service_name, service_number and friends. webmock.cr matches
bodies by exact string equality, so the stub no longer matched any request and
WebMock raised NetConnectNotAllowedError.

Whether that happened depended on spec order. `config_spec` clears those
variables in its own before_each/after_each hooks, so if it ran first the
environment was already scrubbed and webhook_spec passed. The suite runs with
`config.randomize`, so the failure appeared and disappeared at random.

This is environment-dependent as well as order-dependent, which is why it never
reproduced locally: there are no GITHUB_* variables on a developer machine.

Fix: extract `delete_env_vars` from config_spec into `spec/support/env_helper.cr`
(spec_helper already requires `./support/*`) and call it from webhook_spec's
hooks, making the spec deterministic regardless of ambient environment or order.

Supersedes the approach previously on this branch, which used a block matcher --
`WebMock.stub(...).with do |request|`. That never compiled, because webmock.cr's
`Stub#with(query, body, headers)` takes no block; the block form is Ruby WebMock's
API, not this shard's. That is why this branch had failing CI since 2025-09-20.

Verified: full suite passes 124/124 both with GITHUB_* set (previously 2
failures) and without, and `make lint` is clean.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

936 of 995 relevant lines covered (94.07%)

2.14 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
97.92
-2.08% src/coverage_reporter/api/jobs.cr
Jobs
ID Job ID Ran Files Coverage
1 31819844232.1 14 Aug 2026 04:34PM UTC 42
94.07
GitHub Action Run
Source Files on build 31819844232
  • Tree
  • List 42
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #31819844232
  • e764c86b on github
  • Prev Build on master (#31757375160)
  • Next Build on master (#31819930636)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc