1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-10-23 21:28:56 +03:00
Files
pgbackrest/.gitattributes
David Steele f087c83845 Add a smoke test to verify a build against installed PostgreSQL.
The test suite is too complex and time-consuming for packagers to run, so provide a basic smoke test that exercises major functionality to show that a build works. test/smoke.py searches the paths used by the test harness for each PostgreSQL installation and runs the built pgbackrest through a full cycle for every supported version found: initdb, stanza-create, check, full backup, incremental backup, restore, and verification that the restored data matches. Each version runs in a temporary directory with its own repository and a private unix socket, so a running cluster is not disturbed.

Run the test with meson test --suite smoke. It uses only the Python standard library since meson already requires Python. The test fails rather than skips when there is no PostgreSQL to test against, since a test that silently does nothing does not verify the build. PostgreSQL will not run as root, so running as root drops to the postgres user and fails when that user does not exist.

The supported versions are read from the generated src/postgres/version.auto.h so that versions pgBackRest does not support are skipped rather than failing. The header is used rather than src/build/postgres/postgres.yaml because the latter is not shipped in the distribution.

The test is defined in test/meson.build rather than the root meson.build because unit test builds comment out all subdirs, which excludes the smoke test from them. .gitattributes ships test/smoke.py and test/meson.build in the distribution tarball, and DIST.md and the user guide document how to run it.

Add a CI job that builds on Ubuntu 24.04 and runs the smoke test against every supported version, installed from PGDG with a component added for versions that are not released yet. The version list comes from postgres.yaml so it does not need to be maintained in the workflow. The job also checks that smoke.py is formatted with black.
2026-07-16 17:38:05 +07:00

19 lines
818 B
Plaintext

# Classify all .h/c.inc files as C
*.h linguist-language=C
*.c.inc linguist-language=C
# The distribution tarball (git archive) ships only what is needed to build pgbackrest: exclude everything, then re-include the
# build inputs. src/build (code generation) is excluded because dist.sh ships the generated files instead. dist.sh also adds the
# generated docs, the .inc files, the dist marker, and a distribution README. The smoke test (test/smoke.py) and the meson.build that
# runs it are shipped so packagers can verify a build; the rest of test is excluded.
/* export-ignore
/src -export-ignore
/src/build export-ignore
/test -export-ignore
/test/* export-ignore
/test/meson.build -export-ignore
/test/smoke.py -export-ignore
/meson.build -export-ignore
/meson_options.txt -export-ignore
/LICENSE -export-ignore