Repository navigation
[+] add SQL test coverage with pgcov - #850
Open
pashagolub wants to merge 7 commits into
Open
pashagolub wants to merge 7 commits into
pashagolub wants to merge 7 commits into
Conversation
Coverage Report for CI Build 37968521412Warning No base build found for commit Coverage: 87.931%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
pgcov
Adds *_test.sql files next to the schema scripts and a CI job that runs them with pgcov against a PostgreSQL service, reporting LCOV to Coveralls under the 'sql' flag. cron_test.sql intentionally fails until cron.sql is fixed: the RAISE EXCEPTION hint concatenates strings with + instead of ||, so unrecognised cron values raise 42725 instead of the intended message.
The hint was built with `+` instead of `||`, so an unrecognized cron
value raised 42725 (operator does not exist) instead of the intended
'Value ("...") not recognized' error. Found by cron_test.sql under pgcov.
Migration 00850 replaces the function on existing installations.
The pgcrypto scan in secrets_test.go now skips *_test.sql scripts,
which are not shipped.
pashagolub
force-pushed
the
feat/sql-coverage-pgcov
branch
from
October 7, 2026 18:14
8ea1c4d to
761db50
Compare
pashagolub
marked this pull request as ready for review
October 9, 2026 17:19
pashagolub
added this pull request to stack #864
October 9, 2026 17:48
postgresql007
self-requested a review
October 9, 2026 19:46
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #863, which fixes the bug these tests found. Merge #863 first.
Adds tests for the schema SQL. pgcov
v0.0.1runs them and the coverage goes to Coveralls.The
*_test.sqlfiles are not embedded, so the Go build does not change.secrets_test.goskips them in its DDL scan. Error cases go through apg_temp.raises(stmt, expected_state)helper.The new
test-sqlCI job:.pgcov/(pgcov's local output) goes into.gitignore.Evidence
master,cron_test.sqlfails becausecron_split_to_arrays('foo * * * *')raises 42725 instead ofValue ("foo") not recognized. [*] fix error hint intimetable.cron_split_to_arrays#863 fixes that.After: local run against PostgreSQL 18 on top of [*] fix error hint in
timetable.cron_split_to_arrays#863:Merge Danger
Door: two-way
Only tests, CI and
.gitignorechange. Reverting the PR removes them.Blast Radius: CI
The new
test-sqljob and thesqlCoveralls flag can fail or change the coverage numbers on other PRs. No runtime code changes.Known pgcov limitations (follow-ups)
RAISE EXCEPTIONpaths show as uncovered, because NOTIFY is transactional.sqlnumber is higher than pgcov's executable percentage.