Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNnBA-0003Qj-2n for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Feb 2022 02:51:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nNnB6-0007mI-PG for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Feb 2022 02:51:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNnB6-0007m9-3R for pgsql-hackers@lists.postgresql.org; Sat, 26 Feb 2022 02:51:24 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nNnB1-0000tz-Gy for pgsql-hackers@postgresql.org; Sat, 26 Feb 2022 02:51:22 +0000 Received: by mail-il1-x12d.google.com with SMTP id f2so5798109ilq.1 for ; Fri, 25 Feb 2022 18:51:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SKP/vuFPeSDpH73dEppWPN0LBw/qfFrbTJ5qRgI82aA=; b=l7X/BbPEAkQYs0FU+3uQF0egJQL9uFpkpOqU1kiOicUjf+vJ7xpIjV23p+Ye/cbe9N A4da8wEPQtM8XJ62pvNJSRAy+W5xG+o4SeD5w++ZQuyk3qnyKMjnXkS0g0PMsh2K7b2o 4meSIfUijpReIB7wt7rVAnV447W4J24ohzjS6bJMYAAT5Apj1NYZYsLBTpCYvgXfHhDL GB1KLI5GBa+GBS9cy4d9fIjVhXPfngUmH+uzuAm17gFYDpohoRpHMvh/hTWCZoysVF0P 0vSVHAxH5mboDb2SImDWwPHQ7GTh4XH25uHMMKvmcKqG1TcJUEkRg5F4TWMH5WJjdk7Z VZvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SKP/vuFPeSDpH73dEppWPN0LBw/qfFrbTJ5qRgI82aA=; b=u34jvZymyK881ost+B04kGNYDoIXF90WIfTh27D6baJQvsv1vcc/VqxCl4ZxMcfBIq FUiOcV+3FA0LKDsY0dSL8nsnpMtO3Z5ZpAjqCLr2yJSCeUtMTTEBGp+qLr33ax1W1zVg yDG5FTKPmawEnSHxIOlV4mNCa1E0AJbcLaY422k1SwV6ASb69VfyeeRQJO9y+Q3rkPlI fKkP+jokwjEf+GcFhWBCT7apkoLNY4hVm1ubXND4QJ17U7kV1IkvvoFvWJF4EL+CQUho a+ybQvyll9slrtLwFGecmajrPe6UYLgPTh4jDcZ0AqLccvvnE3Tyn9YFpSqVeeTyPupe l00g== X-Gm-Message-State: AOAM532OA/2Gqd4g1pnEpZ+kLgzIiSIo+N+Z4xGLuSb/MPW6iiS4KOnR IkcrGkSpUtqY0CLxNXE+9ryqFg== X-Google-Smtp-Source: ABdhPJwximOUCwcKObXWD3cmUwUoE8E3RHNyBzxoXzmPGUu6xMw0BxhAS7LAQGjymrqp+s/pujzHcQ== X-Received: by 2002:a05:6e02:20ea:b0:2c2:8e29:29d with SMTP id q10-20020a056e0220ea00b002c28e29029dmr8296803ilv.18.1645843878485; Fri, 25 Feb 2022 18:51:18 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id v3-20020a5d9483000000b00640d3d4acabsm2358230ioj.44.2022.02.25.18.51.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Feb 2022 18:51:17 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 631E780086E; Fri, 25 Feb 2022 20:51:16 -0600 (CST) Date: Fri, 25 Feb 2022 20:51:16 -0600 From: Justin Pryzby To: Andres Freund Cc: Tom Lane , Robert Haas , Andrew Dunstan , pgsql-hackers@postgresql.org, Thomas Munro , Melanie Plageman , Peter Eisentraut , Daniel Gustafsson Subject: Re: Adding CI to our tree Message-ID: <20220226025116.GJ9008@telsasoft.com> References: <20220117201619.3ltudwhgk2krmoki@alap3.anarazel.de> <20220118210847.GC23027@telsasoft.com> <20220203035827.GG23027@telsasoft.com> <20220203195718.smqo5xg4ygp5qktq@alap3.anarazel.de> <20220204050403.GL23027@telsasoft.com> <20220206032339.tuyo534rfbvu4mbh@alap3.anarazel.de> <20220212220640.GL31460@telsasoft.com> <20220212222625.aph3ft466ntifrpi@alap3.anarazel.de> <20220213214213.GS31460@telsasoft.com> <20220213220709.vjz5rziuhfdpqxrg@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="x1F0m3RQhDZyj8sd" Content-Disposition: inline In-Reply-To: <20220213220709.vjz5rziuhfdpqxrg@alap3.anarazel.de> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --x1F0m3RQhDZyj8sd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This is the other half of my CI patches, which are unrelated to the TAP ones on the other thread. --x1F0m3RQhDZyj8sd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-cirrus-include-hints-how-to-install-OS-packages.patch" From 88c01c09ee26db2817629265fc12b2dbcd8c9a91 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Mon, 17 Jan 2022 00:53:04 -0600 Subject: [PATCH 1/7] cirrus: include hints how to install OS packages.. This is useful for patches during development, but once a feature is merged, new libraries should be added to the OS image files, rather than installed during every CI run forever into the future. --- .cirrus.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d10b0a82f9..1b7c36283e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -73,10 +73,11 @@ task: chown -R postgres:postgres . mkdir -p ${CCACHE_DIR} chown -R postgres:postgres ${CCACHE_DIR} - setup_cores_script: | + setup_os_script: | mkdir -m 770 /tmp/cores chown root:postgres /tmp/cores sysctl kern.corefile='/tmp/cores/%N.%P.core' + #pkg install -y ... # NB: Intentionally build without --with-llvm. The freebsd image size is # already large enough to make VM startup slow, and even without llvm @@ -180,10 +181,12 @@ task: chown -R postgres:postgres ${CCACHE_DIR} echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf su postgres -c "ulimit -l -H && ulimit -l -S" - setup_cores_script: | + setup_os_script: | mkdir -m 770 /tmp/cores chown root:postgres /tmp/cores sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core' + #apt-get update + #apt-get -y install ... configure_script: | su postgres <<-EOF @@ -237,7 +240,7 @@ task: ulimit -a -H && ulimit -a -S export - setup_cores_script: + setup_os_script: - mkdir ${HOME}/cores - sudo sysctl kern.corefile="${HOME}/cores/core.%P" @@ -384,6 +387,9 @@ task: powershell -Command get-psdrive -psprovider filesystem set + setup_os_script: | + REM choco install -y ... + configure_script: # copy errors out when using forward slashes - copy src\tools\ci\windows_build_config.pl src\tools\msvc\config.pl @@ -479,6 +485,10 @@ task: ccache_cache: folder: $CCACHE_DIR + setup_os_script: | + #apt-get update + #apt-get -y install ... + ### # Test that code can be built with gcc/clang without warnings ### -- 2.17.1 --x1F0m3RQhDZyj8sd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-cirrus-upload-changed-html-docs-as-artifacts.patch" From 7a80dfccb17f454849679ebe9abc89bd0901828a Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sat, 15 Jan 2022 11:27:28 -0600 Subject: [PATCH 2/7] cirrus: upload changed html docs as artifacts Always run doc build; to allow them to be shown in cfbot, they should not be skipped if the linux build fails. This could be done on the client side (cfbot). One advantage of doing it here is that fewer docs are uploaded - many patches won't upload docs at all. XXX: if this is run in the same task, the configure flags should probably be consistent ? https://cirrus-ci.com/task/5396696388599808 ci-os-only: linux --- .cirrus.yml | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1b7c36283e..f21b249b6f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -450,10 +450,6 @@ task: task: name: CompilerWarnings - # To limit unnecessary work only run this once the normal linux test succeeds - depends_on: - - Linux - Debian Bullseye - env: CPUS: 4 BUILD_JOBS: 4 @@ -482,6 +478,13 @@ task: clang -v export + git remote -v + git branch -a + git remote add postgres https://github.com/postgres/postgres + time git fetch -v postgres master + git log -1 postgres/master + git diff --name-only postgres/master.. + ccache_cache: folder: $CCACHE_DIR @@ -557,16 +560,35 @@ task: ### # Verify docs can be built ### - # XXX: Only do this if there have been changes in doc/ since last build always: docs_build_script: | - time ./configure \ - --cache gcc.cache \ - CC="ccache gcc" \ - CXX="ccache g++" \ - CLANG="ccache clang" - make -s -j${BUILD_JOBS} clean - time make -s -j${BUILD_JOBS} -C doc + # Do nothing if the patch doesn't update doc: + git diff --name-only --cherry-pick --exit-code postgres/master... doc && exit + + # Exercise HTML and other docs: + ./configure >/dev/null + make -s -C doc + cp -r doc new-docs + + # Build HTML docs from the parent commit + git checkout postgres/master -- doc + make -s -C doc clean + make -s -C doc html + cp -r doc old-docs + + # Copy HTML which differ into html_docs + # This will show any files which differ from files generated from postgres/master. + # Commits to postgres/master which affect doc/ will cause more files to be + # included until the patch is rebased. + mkdir html_docs + cp new-docs/src/sgml/html/*.css new-docs/src/sgml/html/*.svg html_docs/ + for f in `git diff --no-index --name-only old-docs/src/sgml/html new-docs/src/sgml/html` + do + cp $f html_docs/ + done + + html_docs_artifacts: + paths: ['html_docs/**/*.html', 'html_docs/**/*.png', 'html_docs/**/*.css'] always: upload_caches: ccache -- 2.17.1 --x1F0m3RQhDZyj8sd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-s-build-docs-as-a-separate-task.patch" From a32cb674edd03839da559dfe04b543b4d508045c Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 13 Feb 2022 03:28:00 -0600 Subject: [PATCH 3/7] s!build docs as a separate task.. I believe this'll automatically show up as a separate "column" on the cfbot page. --- .cirrus.yml | 101 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 61 insertions(+), 40 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index f21b249b6f..73b0baeaa7 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -450,6 +450,10 @@ task: task: name: CompilerWarnings + # To limit unnecessary work only run this once the normal linux test succeeds + depends_on: + - Linux - Debian Bullseye + env: CPUS: 4 BUILD_JOBS: 4 @@ -478,13 +482,6 @@ task: clang -v export - git remote -v - git branch -a - git remote add postgres https://github.com/postgres/postgres - time git fetch -v postgres master - git log -1 postgres/master - git diff --name-only postgres/master.. - ccache_cache: folder: $CCACHE_DIR @@ -557,38 +554,62 @@ task: make -s -j${BUILD_JOBS} clean time make -s -j${BUILD_JOBS} world-bin - ### - # Verify docs can be built - ### - always: - docs_build_script: | - # Do nothing if the patch doesn't update doc: - git diff --name-only --cherry-pick --exit-code postgres/master... doc && exit - - # Exercise HTML and other docs: - ./configure >/dev/null - make -s -C doc - cp -r doc new-docs - - # Build HTML docs from the parent commit - git checkout postgres/master -- doc - make -s -C doc clean - make -s -C doc html - cp -r doc old-docs - - # Copy HTML which differ into html_docs - # This will show any files which differ from files generated from postgres/master. - # Commits to postgres/master which affect doc/ will cause more files to be - # included until the patch is rebased. - mkdir html_docs - cp new-docs/src/sgml/html/*.css new-docs/src/sgml/html/*.svg html_docs/ - for f in `git diff --no-index --name-only old-docs/src/sgml/html new-docs/src/sgml/html` - do - cp $f html_docs/ - done - - html_docs_artifacts: - paths: ['html_docs/**/*.html', 'html_docs/**/*.png', 'html_docs/**/*.css'] - always: upload_caches: ccache + + +# Verify docs can be built, and upload changed docs as artifacts +task: + name: HTML docs + + env: + CPUS: 1 + + only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(docs|html).*' + + container: + image: $CONTAINER_REPO/linux_debian_bullseye_ci:latest + cpu: $CPUS + + sysinfo_script: | + id + uname -a + cat /proc/cmdline + ulimit -a -H && ulimit -a -S + export + + git remote -v + git branch -a + git remote add postgres https://github.com/postgres/postgres + time git fetch -v postgres master + git log -1 postgres/master + git diff --name-only postgres/master.. + + docs_build_script: | + # Do nothing if the patch doesn't update doc: + git diff --name-only --cherry-pick --exit-code postgres/master... doc && exit + + # Exercise HTML and other docs: + ./configure >/dev/null + make -s -C doc + cp -r doc new-docs + + # Build HTML docs from the parent commit + git checkout postgres/master -- doc + make -s -C doc clean + make -s -C doc html + cp -r doc old-docs + + # Copy HTML which differ into html_docs + # This will show any files which differ from files generated from postgres/master. + # Commits to postgres/master which affect doc/ will cause more files to be + # included until the patch is rebased. + mkdir html_docs + cp new-docs/src/sgml/html/*.css new-docs/src/sgml/html/*.svg html_docs/ + for f in `git diff --no-index --name-only old-docs/src/sgml/html new-docs/src/sgml/html` + do + cp $f html_docs/ + done + + html_docs_artifacts: + paths: ['html_docs/**/*.html', 'html_docs/**/*.png', 'html_docs/**/*.css'] -- 2.17.1 --x1F0m3RQhDZyj8sd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0004-wip-cirrus-code-coverage.patch" From d1c7b123382fee3989c7e1b1ef14057af0651862 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Mon, 17 Jan 2022 00:54:28 -0600 Subject: [PATCH 4/7] wip: cirrus: code coverage XXX: lcov should be installed in the OS image --- .cirrus.yml | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 73b0baeaa7..635ee64b50 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -174,6 +174,14 @@ task: cat /proc/cmdline ulimit -a -H && ulimit -a -S export + git remote -v + git branch -a + git remote add postgres https://github.com/postgres/postgres + time git fetch -v postgres master + git log -1 postgres/master + git diff --name-only --cherry-pick postgres/master... + #git branch parent `git merge-base postgres/master HEAD` + #git diff --name-only parent.. create_user_script: | useradd -m postgres chown -R postgres:postgres . @@ -185,13 +193,14 @@ task: mkdir -m 770 /tmp/cores chown root:postgres /tmp/cores sysctl kernel.core_pattern='/tmp/cores/%e-%s-%p.core' - #apt-get update - #apt-get -y install ... + apt-get update + apt-get -y install lcov configure_script: | su postgres <<-EOF ./configure \ --enable-cassert --enable-debug --enable-tap-tests \ + --enable-coverage \ --enable-nls \ \ ${LINUX_CONFIGURE_FEATURES} \ @@ -211,6 +220,29 @@ task: make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS} EOF + generate_coverage_report_script: | + mkdir coverage + # Coverage only for changed files + # This is useful to see coverage of newly-added code, but won't + # show added/lost coverage in files which this patch doesn't modify. + for f in `git diff --name-only --cherry-pick postgres/master... '*.c'`; + do + lcov --quiet --capture --directory "$f" + done >coverage/coverage.gcov + + time genhtml coverage/coverage.gcov --output-directory coverage --show-details --legend --quiet + cp coverage/index.html coverage/00-index.html + + # Coverage for all files: + #time lcov --quiet --capture --directory . >coverage/coverage-all.gcov + #time genhtml coverage/coverage-all.gcov --output-directory coverage-all --show-details --legend --quiet + #cp coverage-all/index.html coverage-all/00-index.html + + #git diff --name-only --cherry-pick postgres/master... '*.c' |xargs -r gcov --demangled-names -- + + coverage_artifacts: + paths: ['coverage/**/*.html', 'coverage/**/*.png', 'coverage/**/*.gcov', 'coverage/**/*.css' ] + on_failure: <<: *on_failure cores_script: src/tools/ci/cores_backtrace.sh linux /tmp/cores -- 2.17.1 --x1F0m3RQhDZyj8sd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0005-cirrus-vcregress-test-modules-contrib-with-NO_INSTAL.patch" From 226699150e3e224198fc297689add21bece51c4b Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 9 Jan 2022 18:25:02 -0600 Subject: [PATCH 5/7] cirrus/vcregress: test modules/contrib with NO_INSTALLCHECK=1 --- .cirrus.yml | 4 +- contrib/basic_archive/Makefile | 2 +- contrib/pg_stat_statements/Makefile | 2 +- contrib/test_decoding/Makefile | 2 +- src/test/modules/snapshot_too_old/Makefile | 2 +- src/test/modules/worker_spi/Makefile | 2 +- src/tools/msvc/vcregress.pl | 46 +++++++++++++++++++--- 7 files changed, 48 insertions(+), 12 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 635ee64b50..b56bdd337f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -447,9 +447,9 @@ task: test_isolation_script: | %T_C% perl src/tools/msvc/vcregress.pl isolationcheck test_modules_script: | - %T_C% perl src/tools/msvc/vcregress.pl modulescheck + %T_C% perl src/tools/msvc/vcregress.pl modulescheck install test_contrib_script: | - %T_C% perl src/tools/msvc/vcregress.pl contribcheck + %T_C% perl src/tools/msvc/vcregress.pl contribcheck install stop_script: | tmp_install\bin\pg_ctl.exe stop -D tmp_check/db -l tmp_check/postmaster.log test_ssl_script: | diff --git a/contrib/basic_archive/Makefile b/contrib/basic_archive/Makefile index 14d036e1c4..246358973f 100644 --- a/contrib/basic_archive/Makefile +++ b/contrib/basic_archive/Makefile @@ -4,7 +4,7 @@ MODULES = basic_archive PGFILEDESC = "basic_archive - basic archive module" REGRESS = basic_archive -REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/basic_archive/basic_archive.conf +REGRESS_OPTS = --temp-config=$(top_srcdir)/contrib/basic_archive/basic_archive.conf NO_INSTALLCHECK = 1 diff --git a/contrib/pg_stat_statements/Makefile b/contrib/pg_stat_statements/Makefile index 7fabd96f38..d732e1ade7 100644 --- a/contrib/pg_stat_statements/Makefile +++ b/contrib/pg_stat_statements/Makefile @@ -15,7 +15,7 @@ PGFILEDESC = "pg_stat_statements - execution statistics of SQL statements" LDFLAGS_SL += $(filter -lm, $(LIBS)) -REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/pg_stat_statements/pg_stat_statements.conf +REGRESS_OPTS = --temp-config=$(top_srcdir)/contrib/pg_stat_statements/pg_stat_statements.conf REGRESS = pg_stat_statements oldextversions # Disabled because these tests require "shared_preload_libraries=pg_stat_statements", # which typical installcheck users do not have (e.g. buildfarm clients). diff --git a/contrib/test_decoding/Makefile b/contrib/test_decoding/Makefile index 36929dd97d..465e5d365d 100644 --- a/contrib/test_decoding/Makefile +++ b/contrib/test_decoding/Makefile @@ -11,7 +11,7 @@ ISOLATION = mxact delayed_startup ondisk_startup concurrent_ddl_dml \ oldest_xmin snapshot_transfer subxact_without_top concurrent_stream \ twophase_snapshot slot_creation_error -REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/test_decoding/logical.conf +REGRESS_OPTS = --temp-config=$(top_srcdir)/contrib/test_decoding/logical.conf ISOLATION_OPTS = --temp-config $(top_srcdir)/contrib/test_decoding/logical.conf # Disabled because these tests require "wal_level=logical", which diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..752a0039fd 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -5,7 +5,7 @@ EXTRA_CLEAN = $(pg_regress_clean_files) ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index -ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf +ISOLATION_OPTS = --temp-config=$(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which # typical installcheck users do not have (e.g. buildfarm clients). diff --git a/src/test/modules/worker_spi/Makefile b/src/test/modules/worker_spi/Makefile index cbf9b2e37f..d9f7d9bab6 100644 --- a/src/test/modules/worker_spi/Makefile +++ b/src/test/modules/worker_spi/Makefile @@ -9,7 +9,7 @@ PGFILEDESC = "worker_spi - background worker example" REGRESS = worker_spi # enable our module in shared_preload_libraries for dynamic bgworkers -REGRESS_OPTS = --temp-config $(top_srcdir)/src/test/modules/worker_spi/dynamic.conf +REGRESS_OPTS = --temp-config=$(top_srcdir)/src/test/modules/worker_spi/dynamic.conf # Disable installcheck to ensure we cover dynamic bgworkers. NO_INSTALLCHECK = 1 diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index e2b0db0879..7bcc709200 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -442,6 +442,7 @@ sub plcheck sub subdircheck { my $module = shift; + my $installcheck = shift || 1; if ( !-d "$module/sql" || !-d "$module/expected" @@ -451,7 +452,7 @@ sub subdircheck } chdir $module; - my @tests = fetchTests(); + my @tests = fetchTests($installcheck); # Leave if no tests are listed in the module. if (scalar @tests == 0) @@ -461,6 +462,7 @@ sub subdircheck } my @opts = fetchRegressOpts(); + push @opts, "--temp-instance=tmp_check" if $installcheck == -1; # Special processing for python transform modules, see their respective # Makefiles for more details regarding Python-version specific @@ -488,7 +490,7 @@ sub subdircheck print "Checking $module\n"; my @args = ( "$topdir/$Config/pg_regress/pg_regress", - "--bindir=${topdir}/${Config}/psql", + "--bindir=$tmp_installdir/bin", "--dbname=contrib_regression", @opts, @tests); print join(' ', @args), "\n"; system(@args); @@ -498,6 +500,8 @@ sub subdircheck sub contribcheck { + my $mode = shift || ''; + chdir "../../../contrib"; my $mstat = 0; foreach my $module (glob("*")) @@ -515,12 +519,25 @@ sub contribcheck my $status = $? >> 8; $mstat ||= $status; } + + # As above, but creates new DB instance for each module. For CI. + if ($mode eq "install") + { + foreach my $module (glob("*")) + { + subdircheck("$module", -1); + $mstat ||= $? >> 8; + } + } + exit $mstat if $mstat; return; } sub modulescheck { + my $mode = shift || ''; + chdir "../../../src/test/modules"; my $mstat = 0; foreach my $module (glob("*")) @@ -529,6 +546,17 @@ sub modulescheck my $status = $? >> 8; $mstat ||= $status; } + + # As above, but creates new DB instance for each module. For CI. + if ($mode eq "install") + { + foreach my $module (glob("*")) + { + subdircheck("$module", -1); + $mstat ||= $? >> 8; + } + } + exit $mstat if $mstat; return; } @@ -698,6 +726,7 @@ sub fetchRegressOpts # option starting with "--". @opts = grep { !/\$\(/ && /^--/ } map { (my $x = $_) =~ s/\Q$(top_builddir)\E/\"$topdir\"/; $x; } + map { (my $x = $_) =~ s/\Q$(top_srcdir)\E/\"$topdir\"/; $x; } split(/\s+/, $1); } if ($m =~ /^\s*ENCODING\s*=\s*(\S+)/m) @@ -723,14 +752,19 @@ sub fetchTests my $m = <$handle>; close($handle); my $t = ""; + my $installcheck = shift || 1; $m =~ s{\\\r?\n}{}g; - # A module specifying NO_INSTALLCHECK does not support installcheck, - # so bypass its run by returning an empty set of tests. if ($m =~ /^\s*NO_INSTALLCHECK\s*=\s*\S+/m) { - return (); + # Skip modules marked installcheck unless running installcheck tests. + return () if $installcheck == 1; + } + else + { + # Skip modules not marked installcheck if running installcheck tests. + return () if $installcheck == -1; } if ($m =~ /^REGRESS\s*=\s*(.*)$/gm) @@ -796,6 +830,8 @@ sub usage "\nOptions for : (used by check and installcheck)\n", " serial serial mode\n", " parallel parallel mode\n", + "\nOptions for : (used by contribcheck and modulescheck)\n", + " install also run tests which require a new instance\n", "\nOption for : for taptest\n", " TEST_DIR (required) directory where tests reside\n"; exit(1); -- 2.17.1 --x1F0m3RQhDZyj8sd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0006-wip-cirrus-windows-save-tmp_install-as-an-artifact.patch" From 08933bcd93d4f57ad73ab6df2f1627b93e61b459 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 16 Jan 2022 12:51:13 -0600 Subject: [PATCH 6/7] wip: cirrus/windows: save tmp_install as an artifact.. ..to allow users to easily download compiled binaries to try a patch. If they don't have a development environment handy or not familiar with compilation. XXX: maybe this should be conditional or commented out ? ci-os-only: windows --- .cirrus.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index b56bdd337f..0d6d6a749d 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -472,6 +472,14 @@ task: cd src/tools/msvc %T_C% perl vcregress.pl ecpgcheck + always: + compress_install_script: + - powershell Compress-Archive tmp_install tmp_install.zip + - zipinfo tmp_install.zip + + install_artifacts: + path: 'tmp_install.zip' + on_failure: <<: *on_failure crashlog_artifacts: -- 2.17.1 --x1F0m3RQhDZyj8sd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0007-wip-cirrus-windows-add-compiler_warnings_script.patch" From a7d2bba6f51d816412fb645b0d4821c36ee5c400 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 20 Feb 2022 15:01:59 -0600 Subject: [PATCH 7/7] wip: cirrus/windows: add compiler_warnings_script I'm not sure how to write this test in windows shell; it's also not easy to write it in posix sh, since windows shell is somehow interpretting && and ||... ci-os-only: windows https://cirrus-ci.com/task/6183879907213312 https://cirrus-ci.com/task/4876271443247104 --- .cirrus.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0d6d6a749d..be38f74aa5 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -396,7 +396,8 @@ task: # ForceNoAlign prevents msbuild from introducing line-breaks for long lines # disable file tracker, we're never going to rebuild, and it slows down the # build - MSBFLAGS: -m -verbosity:minimal "-consoleLoggerParameters:Summary;ForceNoAlign" /p:TrackFileAccess=false -nologo + # -fileLoggerParameters1: write to msbuild.warn.log. + MSBFLAGS: -m -verbosity:minimal "-consoleLoggerParameters:Summary;ForceNoAlign" /p:TrackFileAccess=false -nologo -fileLoggerParameters1:warningsonly;logfile=msbuild.warn.log # If tests hang forever, cirrus eventually times out. In that case log # output etc is not uploaded, making the problem hard to debug. Of course @@ -480,6 +481,10 @@ task: install_artifacts: path: 'tmp_install.zip' + # Success if the file doesn't exist or is empty, else fail + compiler_warnings_script: + - sh -exc 'f=msbuild.warn.log; if [ -s "$f" ]; then cat "$f"; exit 1; else exit 0; fi' + on_failure: <<: *on_failure crashlog_artifacts: -- 2.17.1 --x1F0m3RQhDZyj8sd--