On Sat, May 23, 2020 at 10:46:00AM +0200, Landry Breuil wrote: > Hi, > > here are two new ports, one for pgtap (https://pgtap.org/) and one for > TAP::Parser::SourceHandler::pgTAP which provides the pg_prove script, > used to run the regress tests for the upcoming 3.0.0 version of > geo/pgrouting. > > pgtap is a postgresql extension to run regress tests using the TAP framework. > > thanks to the nice testing bits from postgresql.port.mk, i can easily > run the pgtap tests themselves, and only some of them fail due to > user/ownership issues that i think cant be worked around on OpenBSD, > since we run build bits with fixed users (be it with PORTS_PRIVSEP or > not): > > # Failed test 1: "db_owner_is(db, user, desc) should pass" > # have: false > # want: true > # Failed test 3: "db_owner_is(db, user, desc) should have the proper > diagnostics" > # have: have: landry > # want: postgres > # want: > # Failed test 4: "db_owner_is(db, user) should pass" > # have: false > # want: true > # Failed test 6: "db_owner_is(db, user) should have the proper diagnostics" > # have: have: landry > # want: postgres > # want: > # Failed test 12: "db_owner_is(db, non-user) should have the proper > diagnostics" > # have: have: landry > # want: __not__postgres > # want: have: postgres > # want: __not__postgres > # Looks like you failed 5 tests of 411 > Failed 5/411 subtests > > looking for feedback from the pgsql wizards (or perl wizards even!) and oks to > import. > > Landry
Looking over pgtap. I am seeing some strange (to me) issues. It uses gmake and it's a perl port. It comes with the Perl Makefile already built. Never seen that yet. It also wants to pull in files from itself that are already installed outside of the ports tree in order to run tests. Otherwise the tests stop at: ERROR: could not open extension control file "/usr/local/share/postgresql/extension/pgtap.control": No such file or directory cp pgtap.control to /usr/local/share/postgresql/extension/pgtap.control moved things along a little further, so it is looking there. The above errors Landry had (and I also had) only occur if pgtap is installed first. The ports documentation suggests an easy fix for that by setting PGUSER=postgres this way: gmake installcheck PGUSER=postgres I tried a variety of configure and modules, but that did not work, erroring out almost right away. (cpan, modbuild, perl). Looking upstream, this is how they have the Makefile in package and on git. Makefile from submitted port: # $OpenBSD$ V = 1.1.0 COMMENT = unit testing for PostgreSQL DISTNAME = pgtap-${V} CATEGORIES = databases EXTRACT_SUFX = .zip HOMEPAGE = https://pgtap.org/ # PostgreSQL PERMIT_PACKAGE= Yes MASTER_SITES = https://api.pgxn.org/dist/pgtap/${V}/ MODULES = databases/postgresql SUBST_VARS += V USE_GMAKE = Yes BUILD_DEPENDS = databases/postgresql RUN_DEPENDS = databases/p5-TAP-Parser-SourceHandler-pgTAP TEST_DEPENDS = ${BUILD_PKGPATH} TEST_ENV+=ALLOW_MISSING_EXTENSIONS=1 MODPOSTGRESQL_TEST_CMD = ${LOCALBASE}/bin/psql -c 'CREATE EXTENSION pgtap;' && \ ${MAKE_PROGRAM} ${ALL_TEST_FLAGS} -f ${MAKE_FILE} ${TEST_TARGET} .include <bsd.port.mk> Thanks -- Chris Bennett