From edbd5963c48efc266415a50f7cff8470d2f9a6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zachar?= Date: Tue, 7 Oct 2025 15:23:09 +0200 Subject: [PATCH] Add gating Install postgresql-test-rpm-macros directly as it is not shipped --- .fmf/version | 1 + gating.yaml | 6 ++++++ plan.fmf | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plan.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..2c7ed80 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/plan.fmf b/plan.fmf new file mode 100644 index 0000000..b6c7277 --- /dev/null +++ b/plan.fmf @@ -0,0 +1,39 @@ +execute: + how: tmt + +environment: + pybasever: '3.14' + +prepare+: + - how: shell + script: useradd testuser + +discover: + how: shell + dist-git-source: true + tests: + - name: bundled tests + test: | + # package is built but not shipped on c10s, postgresql16 is the srpm + dnf install -y "https://kojihub.stream.centos.org/kojifiles/vol/koji02/packages/postgresql16/$(rpm -q postgresql-server --qf '%{version}/%{release}/noarch/postgresql-test-rpm-macros-%{version}-%{release}.noarch.rpm')" + + chmod a+Xw -R $TMT_SOURCE_DIR && + runuser testuser --preserve-environment -c ' + cd $(dirname $TMT_SOURCE_DIR/psycopg2-*/tests) && + + export PGTESTS_LOCALE=C.UTF-8 && + . "/usr/share/postgresql-setup/postgresql_pkg_tests.sh" && + pgtests_start && + + export PSYCOPG2_TESTDB=${PGTESTS_DATABASES##*:} && + export PSYCOPG2_TESTDB_HOST=$PGHOST && + export PSYCOPG2_TESTDB_PORT=$PGPORT && + + python${pybasever} -c "import tests; tests.unittest.main(defaultTest=\"tests.test_suite\")" --verbose + ' && + chmod a+Xw -R $TMT_SOURCE_DIR + + require: + - python${pybasever}-psycopg2 + - python${pybasever} + - postgresql16-server