Skip to content

Gate PR coverage with diff-cover - #6

Merged
tescalada merged 2 commits into
mainfrom
try-diff-cover
Jul 19, 2026
Merged

tescalada merged 2 commits into
mainfrom
try-diff-cover

Conversation

@tescalada

@tescalada tescalada commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Replaces the per-file coverage baseline with diff-cover, which fails a PR when its changed lines fall below a coverage threshold.

  • scripts/run_coverage.sh: builds the test image, runs the suite, and runs diff-cover against the compare branch (origin/main, --fail-under 90; both overridable via env).
  • CI installs uv and runs that script.
  • Adds the SETUPTOOLS_SCM_PRETEND_VERSION build arg so the test image builds from a git worktree.

@tescalada tescalada changed the title [demo] diff-cover coverage gate Gate PR coverage with diff-cover Jul 18, 2026
@tescalada
tescalada force-pushed the try-diff-cover branch 4 times, most recently from 73aec00 to 5a009a0 Compare July 19, 2026 13:13
@github-actions

github-actions Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Coverage

Coverage report
FileStmtsMissCoverMissing
sparkmeter
   __version__.py16288%32, 38
   _wsgi_mount_smoketest.py97970%19–152
   app.py3151197%19–20, 111, 368–375, 552–554, 675, 682–683
   asgi.py74740%19–166
   cli.py42686%59–70
   cli_app.py880%4–20
   cli_prompts.py151220%8–12, 17–21, 26–28
   conftest.py181995%51–52, 85–86, 108–120, 209
   controller.py2444283%183, 207–208, 531, 585–642
   debug_memory.py32320%6–63
   periodic.py563145%60–66, 71–75, 80–84, 93–98, 103–111, 124–128
   sentry_proxy.py342235%38, 44–47, 56–65, 73–82
   servercommand.py1127236%47, 56–60, 64–69, 73–78, 82–85, 89–90, 101–103, 112–181
sparkmeter/alembic/versions
   0.32_merge_sms_tables.py46393%61–67
   0.77_snapshot_support.py128298%340, 401
sparkmeter/api
   customerviews0.py283199%301
   historyviews0.py1149219%49–55, 69–72, 81–131, 144–175, 185–216, 230–257
sparkmeter/config
   configparameter.py57296%80, 111
sparkmeter/database
   alchemy.py54493%61–63, 74
   database.py232399%497, 579–580
   ormobject.py55198%65
   session.py21210%12–62
   types.py54394%91–92, 125
sparkmeter/ground
   groundcommand.py201050%20–35
sparkmeter/history
   historyview.py351654%30–31, 41–54, 65–72
sparkmeter/meter
   meterdomain.py7722797%892, 1805–1806, 1817–1868, 1911
sparkmeter/metering
   api.py27967%66–76
   cli.py2275874%158, 174–175, 184, 193, 198–201, 203, 234, 238–244, 281–297, 301–335, 456–458
   dispatch.py741678%78–80, 85–97, 185
   events.py1053468%56, 75–77, 109–112, 118–193, 240
   lifespan.py74740%13–133
   reconcile.py1134362%84–107, 119–120, 129, 135–138, 140–143, 169, 259–262, 266–269, 273–276, 287
sparkmeter/metering/tools
   cli_client.py825829%46–52, 56–61, 65–70, 83–107, 115–148, 153–166
sparkmeter/misc
   datetimeutils.py65395%115–117
sparkmeter/system
   systemcommand.py67593%35, 130–132, 134–135
sparkmeter/tariff
   tariffcommand.py821582%27–44
sparkmeter/transaction
   transactionview.py167199%71
sparkmeter/user
   userdomain.py1871294%416–434
sparkmeter/web
   unittestutils.py1741194%30–38, 269, 278, 344, 346
   views.py72199%71
TOTAL1265294393% 

Tests Skipped Failures Errors Time
1266 0 💤 0 ❌ 0 🔥 3m 49s ⏱️

@tescalada
tescalada force-pushed the try-diff-cover branch 2 times, most recently from ca05b7c to 25e8ece Compare July 19, 2026 13:26
@github-actions

github-actions Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.

@tescalada
tescalada marked this pull request as ready for review July 19, 2026 15:55
@tescalada
tescalada merged commit a2f7f95 into main Jul 19, 2026
5 checks passed
@tescalada
tescalada deleted the try-diff-cover branch July 19, 2026 15:56
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.

1 participant