From a41aa7e14198df938e6101efa9c03b11d733c98e Mon Sep 17 00:00:00 2001 From: Andrey Sokolov Date: Mon, 29 Dec 2025 10:39:54 +0300 Subject: [PATCH] gpcontrib_tests --- .github/workflows/build-gpdb.yml | 20 +- gpcontrib/Makefile | 192 ++++++------------ gpcontrib/orafce/Makefile | 10 +- .../yagp_hooks_collector/sql/yagp_cursors.sql | 9 + .../yagp_hooks_collector/sql/yagp_dist.sql | 9 + .../yagp_hooks_collector/sql/yagp_select.sql | 9 + .../sql/yagp_utf8_trim.sql | 9 + .../yagp_hooks_collector/sql/yagp_utility.sql | 9 + 8 files changed, 119 insertions(+), 148 deletions(-) diff --git a/.github/workflows/build-gpdb.yml b/.github/workflows/build-gpdb.yml index 7ce4b4ec31b..b8f6d526f53 100644 --- a/.github/workflows/build-gpdb.yml +++ b/.github/workflows/build-gpdb.yml @@ -111,10 +111,6 @@ jobs: "pg_settings":{"optimizer":"on"}, "extension":"pgaudit" }, - {"test":"gpcontrib-yagp-hooks-collector", - "make_configs":["gpcontrib/yagp_hooks_collector:installcheck"], - "extension":"yagp_hooks_collector" - }, {"test":"ic-expandshrink", "make_configs":["src/test/isolation2:installcheck-expandshrink"] }, @@ -153,19 +149,7 @@ jobs: "contrib/xml2:installcheck"] }, {"test":"ic-gpcontrib", - "make_configs":["gpcontrib/gp_array_agg:installcheck", - "gpcontrib/gp_debug_numsegments:installcheck", - "gpcontrib/gp_distribution_policy:installcheck", - "gpcontrib/gp_error_handling:installcheck", - "gpcontrib/gp_inject_fault:installcheck", - "gpcontrib/gp_internal_tools:installcheck", - "gpcontrib/gp_legacy_string_agg:installcheck", - "gpcontrib/gp_percentile_agg:installcheck", - "gpcontrib/gp_sparse_vector:installcheck", - "gpcontrib/gp_subtransaction_overflow:installcheck", - "gpcontrib/gpmapreduce:installcheck", - "gpcontrib/orafce:installcheck", - "gpcontrib/pgaudit:installcheck"] + "make_configs":["gpcontrib:installcheck"] }, {"test":"ic-parallel-retrieve-cursor", "make_configs":["src/test/isolation2:installcheck-parallel-retrieve-cursor"] @@ -1033,7 +1017,7 @@ jobs: # set env for debian build export BUILD_DESTINATION=/opt/greenplum-db-6 - if ! su - gpadmin -c "cd ${SRC_DIR} && ./configure --with-perl --with-python --with-libxml --enable-mapreduce --with-gssapi --prefix=${BUILD_DESTINATION} --with-ldap --enable-gpperfmon --with-pam --with-openssl --disable-pxf --enable-ic-proxy --enable-orafce --without-mdblocales --with-zstd --enable-tap-tests --with-yagp-hooks-collector"; then + if ! su - gpadmin -c "cd ${SRC_DIR} && ./configure --with-perl --with-python --with-libxml --enable-mapreduce --with-gssapi --prefix=${BUILD_DESTINATION} --with-ldap --enable-gpperfmon --with-pam --with-openssl --disable-pxf --enable-ic-proxy --enable-orafce --without-mdblocales --with-zstd --enable-tap-tests --with-yagp-hooks-collector --enable_debug_extensions"; then echo "::error::Configure script failed" exit 1 fi diff --git a/gpcontrib/Makefile b/gpcontrib/Makefile index 1af39741c56..30129dd98be 100644 --- a/gpcontrib/Makefile +++ b/gpcontrib/Makefile @@ -1,146 +1,88 @@ -# protect the default target for this file from the targets in Makefile.global -default: all +# gpcontrib/Makefile +subdir = gpcontrib top_builddir = .. include $(top_builddir)/src/Makefile.global -.PHONY: all install clean distclean gpcloud mapreduce pgaudit sr_plan - -# -# targets built via top_builddir/GNUmakefile -# -recurse_targets = "" - -ifeq "$(enable_debug_extensions)" "yes" - recurse_targets = gp_sparse_vector \ - gp_distribution_policy \ - gp_parallel_retrieve_cursor \ - gp_internal_tools \ - gp_pitr \ - gp_debug_numsegments \ - gp_inject_fault \ - gp_replica_check \ - gp_legacy_string_agg \ - gp_array_agg \ - gp_percentile_agg \ - gp_error_handling \ - gp_subtransaction_overflow \ - gp_check_functions \ - gp_aux_catalog \ - gp_interconnect_stats \ - temp_tables_stat +SUBDIRS = \ + gp_array_agg \ + gp_aux_catalog \ + gp_check_functions \ + gp_distribution_policy \ + gp_error_handling \ + gp_interconnect_stats \ + gp_internal_tools \ + gp_legacy_string_agg \ + gp_parallel_retrieve_cursor \ + gp_parser \ + gp_percentile_agg \ + gp_pitr \ + gp_sparse_vector \ + gp_subtransaction_overflow \ + jsonlog-gpdb \ + temp_tables_stat + +ifeq ($(enable_debug_extensions),yes) +SUBDIRS += gp_debug_numsegments gp_inject_fault gp_replica_check else - recurse_targets = gp_sparse_vector \ - gp_distribution_policy \ - gp_parallel_retrieve_cursor \ - gp_internal_tools \ - gp_pitr \ - gp_parser \ - jsonlog-gpdb \ - gp_legacy_string_agg \ - gp_array_agg \ - gp_percentile_agg \ - gp_error_handling \ - gp_subtransaction_overflow \ - gp_check_functions \ - gp_aux_catalog \ - gp_interconnect_stats \ - temp_tables_stat +ALWAYS_SUBDIRS += gp_debug_numsegments gp_inject_fault gp_replica_check endif ifeq "$(with_yagp_hooks_collector)" "yes" - recurse_targets += yagp_hooks_collector +SUBDIRS += yagp_hooks_collector +else +ALWAYS_SUBDIRS += yagp_hooks_collector endif + ifeq "$(with_zstd)" "yes" - recurse_targets += zstd +SUBDIRS += zstd +else +ALWAYS_SUBDIRS += zstd endif + ifeq "$(with_quicklz)" "yes" - recurse_targets += quicklz +SUBDIRS += quicklz +else +ALWAYS_SUBDIRS += quicklz endif -$(call recurse,all install clean distclean, $(recurse_targets)) - -all: gpcloud mapreduce orafce yezzey sr_plan pgaudit - -yezzey: - @if [ "$(enable_yezzey)" = "yes" ]; then \ - $(MAKE) -C yezzey - fi - -gpcloud: - @if [ "$(enable_gpcloud)" = "yes" ]; then \ - $(MAKE) -C gpcloud && \ - $(MAKE) -C gpcloud/bin/gpcheckcloud; \ - fi - -mapreduce: - @if [ "$(enable_mapreduce)" = "yes" ]; then \ - $(MAKE) -C gpmapreduce; \ - fi - -orafce: - @if [ "$(enable_orafce)" = "yes" ]; then \ - $(MAKE) -C orafce NO_PGXS=true; \ - fi -sr_plan: - @if [ "$(enable_sr_plan)" = "yes" ]; then \ - $(MAKE) -C sr_plan NO_PGXS=true; \ - fi +ifeq "$(enable_yezzey)" "yes" +SUBDIRS += yezzey +else +ALWAYS_SUBDIRS += yezzey +endif -pgaudit: - @if [ "$(enable_pgaudit)" = "yes" ]; then \ - $(MAKE) -C pgaudit NO_PGXS=true; \ - fi +ifeq "$(enable_mapreduce)" "yes" +SUBDIRS += gpmapreduce +else +ALWAYS_SUBDIRS += gpmapreduce +endif +ifeq "$(enable_orafce)" "yes" +SUBDIRS += orafce +else +ALWAYS_SUBDIRS += orafce +endif -install: - @if [ "$(enable_gpcloud)" = "yes" ]; then \ - $(MAKE) -C gpcloud install && \ - $(MAKE) -C gpcloud/bin/gpcheckcloud install; \ - fi - @if [ "$(enable_yezzey)" = "yes" ]; then \ - $(MAKE) -C yezzey install; \ - fi - @if [ "$(enable_mapreduce)" = "yes" ]; then \ - $(MAKE) -C gpmapreduce install; \ - fi - @if [ "$(enable_orafce)" = "yes" ]; then \ - $(MAKE) -C orafce NO_PGXS=true install; \ - fi - @if [ "$(enable_pgaudit)" = "yes" ]; then \ - $(MAKE) -C pgaudit NO_PGXS=true install; \ - fi - @if [ "$(enable_sr_plan)" = "yes" ]; then \ - $(MAKE) -C sr_plan NO_PGXS=true install; \ - fi +ifeq "$(enable_sr_plan)" "yes" +SUBDIRS += sr_plan +else +ALWAYS_SUBDIRS += sr_plan +endif -clean: - if [ "$(enable_mapreduce)" = "yes" ]; then $(MAKE) -C gpmapreduce clean; fi - if [ "$(enable_gpcloud)" = "yes" ]; then $(MAKE) -C gpcloud cleanall; fi - if [ "$(enable_yezzey)" = "yes" ]; then $(MAKE) -C yezzey cleanall; fi - if [ "${enable_orafce}" = "yes" ]; then $(MAKE) -C orafce NO_PGXS=true clean; fi - if [ "${enable_sr_plan}" = "yes" ]; then $(MAKE) -C sr_plan clean; fi - if [ "${enable_pgaudit}" = "yes" ]; then $(MAKE) -C pgaudit clean; fi +ifeq "$(enable_pgaudit)" "yes" +SUBDIRS += pgaudit +else +ALWAYS_SUBDIRS += pgaudit +endif +ifeq "$(enable_gpcloud)" "yes" +SUBDIRS += gpcloud gpcloud/bin/gpcheckcloud +else +ALWAYS_SUBDIRS += gpcloud gpcloud/bin/gpcheckcloud +endif -distclean: - if [ "$(enable_mapreduce)" = "yes" ]; then $(MAKE) -C gpmapreduce distclean; fi - if [ "$(enable_gpcloud)" = "yes" ]; then $(MAKE) -C gpcloud distclean; fi - if [ "$(enable_yezzey)" = "yes" ]; then $(MAKE) -C yezzey distclean; fi - if [ "${enable_orafce}" = "yes" ]; then $(MAKE) -C orafce NO_PGXS=true distclean; fi -installcheck: - $(MAKE) -C gp_internal_tools installcheck - $(MAKE) -C gp_array_agg installcheck - $(MAKE) -C gp_aux_catalog installcheck - if [ "$(enable_mapreduce)" = "yes" ]; then \ - $(MAKE) -C gpmapreduce installcheck; \ - fi - if [ "$(enable_orafce)" = "yes" ]; then $(MAKE) -C orafce installcheck; fi - if [ "$(with_zstd)" = "yes" ]; then $(MAKE) -C zstd installcheck; fi - if [ "$(with_quicklz)" = "yes" ]; then $(MAKE) -C quicklz installcheck; fi - $(MAKE) -C gp_sparse_vector installcheck - $(MAKE) -C gp_percentile_agg installcheck - $(MAKE) -C gp_subtransaction_overflow installcheck - $(MAKE) -C gp_check_functions installcheck - if [ "${enable_pgaudit}" = "yes" ]; then $(MAKE) -C pgaudit installcheck; fi +$(call recurse,all install clean distclean) +$(call recurse,installcheck,$(filter-out yezzey, $(SUBDIRS))) +$(recurse_always) diff --git a/gpcontrib/orafce/Makefile b/gpcontrib/orafce/Makefile index 0283e154fa3..4f89868b1f7 100644 --- a/gpcontrib/orafce/Makefile +++ b/gpcontrib/orafce/Makefile @@ -19,15 +19,15 @@ EXTRA_CLEAN = sqlparse.c sqlparse.h sqlscan.c y.tab.c y.tab.h #override CFLAGS += -pedantic -ifdef NO_PGXS +ifdef USE_PGXS +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) +else subdir = contrib/$(MODULE_big) top_builddir = ../../ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk -else -PG_CONFIG = pg_config -PGXS := $(shell $(PG_CONFIG) --pgxs) -include $(PGXS) endif # Disable -Wimplicit-fallthrough for this module, since it is hard to change some diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_cursors.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_cursors.sql index f56351e0d43..629e9765861 100644 --- a/gpcontrib/yagp_hooks_collector/sql/yagp_cursors.sql +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_cursors.sql @@ -1,3 +1,8 @@ +-- start_ignore +\! gpconfig -c shared_preload_libraries -v 'yagp_hooks_collector' +\! gpstop -raiq +\c +-- end_ignore CREATE EXTENSION yagp_hooks_collector; CREATE FUNCTION yagp_status_order(status text) @@ -83,3 +88,7 @@ RESET yagpcc.enable; RESET yagpcc.report_nested_queries; RESET yagpcc.enable_utility; RESET yagpcc.ignored_users_list; +-- start_ignore +\! gpconfig -r shared_preload_libraries +\! gpstop -raiq +-- end_ignore diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_dist.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_dist.sql index d5519d0cd96..2d00c05ebcd 100644 --- a/gpcontrib/yagp_hooks_collector/sql/yagp_dist.sql +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_dist.sql @@ -1,3 +1,8 @@ +-- start_ignore +\! gpconfig -c shared_preload_libraries -v 'yagp_hooks_collector' +\! gpstop -raiq +\c +-- end_ignore CREATE EXTENSION yagp_hooks_collector; CREATE OR REPLACE FUNCTION yagp_status_order(status text) @@ -86,3 +91,7 @@ RESET yagpcc.enable; RESET yagpcc.report_nested_queries; RESET yagpcc.enable_utility; RESET yagpcc.ignored_users_list; +-- start_ignore +\! gpconfig -r shared_preload_libraries +\! gpstop -raiq +-- end_ignore diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_select.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_select.sql index 90e972ae4c1..e3b7f0193b1 100644 --- a/gpcontrib/yagp_hooks_collector/sql/yagp_select.sql +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_select.sql @@ -1,3 +1,8 @@ +-- start_ignore +\! gpconfig -c shared_preload_libraries -v 'yagp_hooks_collector' +\! gpstop -raiq +\c +-- end_ignore CREATE EXTENSION yagp_hooks_collector; CREATE OR REPLACE FUNCTION yagp_status_order(status text) @@ -67,3 +72,7 @@ RESET yagpcc.enable; RESET yagpcc.report_nested_queries; RESET yagpcc.enable_utility; RESET yagpcc.ignored_users_list; +-- start_ignore +\! gpconfig -r shared_preload_libraries +\! gpstop -raiq +-- end_ignore diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_utf8_trim.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_utf8_trim.sql index c3053e4af0c..7a71b27a200 100644 --- a/gpcontrib/yagp_hooks_collector/sql/yagp_utf8_trim.sql +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_utf8_trim.sql @@ -1,3 +1,8 @@ +-- start_ignore +\! gpconfig -c shared_preload_libraries -v 'yagp_hooks_collector' +\! gpstop -raiq +\c +-- end_ignore CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; CREATE OR REPLACE FUNCTION get_marked_query(marker TEXT) @@ -43,3 +48,7 @@ RESET yagpcc.enable; RESET yagpcc.ignored_users_list; DROP EXTENSION yagp_hooks_collector; +-- start_ignore +\! gpconfig -r shared_preload_libraries +\! gpstop -raiq +-- end_ignore diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_utility.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_utility.sql index cf9c1d253d0..2d9fac37a55 100644 --- a/gpcontrib/yagp_hooks_collector/sql/yagp_utility.sql +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_utility.sql @@ -1,3 +1,8 @@ +-- start_ignore +\! gpconfig -c shared_preload_libraries -v 'yagp_hooks_collector' +\! gpstop -raiq +\c +-- end_ignore CREATE EXTENSION yagp_hooks_collector; CREATE OR REPLACE FUNCTION yagp_status_order(status text) @@ -133,3 +138,7 @@ RESET yagpcc.enable; RESET yagpcc.report_nested_queries; RESET yagpcc.enable_utility; RESET yagpcc.ignored_users_list; +-- start_ignore +\! gpconfig -r shared_preload_libraries +\! gpstop -raiq +-- end_ignore