提交 d837c305 编写于 作者: P Pengzhou Tang 提交者: Tang Pengzhou

Organize all resgroup tests to the same directory

resource group tests are messing up isolation2 directory, this commits
move them all to the same directory to be tidy and organized, it also
handle the sub directory in input/output directory for resgroup.
上级 7789b1a5
...@@ -47,4 +47,4 @@ installcheck: all gpdiff.pl gpstringsubs.pl ...@@ -47,4 +47,4 @@ installcheck: all gpdiff.pl gpstringsubs.pl
./pg_isolation2_regress --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_isolation2 --psqldir='$(PSQLDIR)' --inputdir=$(srcdir) --ao-dir=uao --schedule=$(srcdir)/isolation2_schedule ./pg_isolation2_regress --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_isolation2 --psqldir='$(PSQLDIR)' --inputdir=$(srcdir) --ao-dir=uao --schedule=$(srcdir)/isolation2_schedule
installcheck-resgroup: all gpdiff.pl gpstringsubs.pl installcheck-resgroup: all gpdiff.pl gpstringsubs.pl
./pg_isolation2_regress --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_resgroup --psqldir='$(PSQLDIR)' --inputdir=$(srcdir) --dbname=isolation2resgrouptest --schedule=$(srcdir)/isolation2_resgroup_schedule ./pg_isolation2_regress --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_resgroup --psqldir='$(PSQLDIR)' --inputdir=$(srcdir) --resgroup-dir=resgroup --dbname=isolation2resgrouptest --schedule=$(srcdir)/isolation2_resgroup_schedule
test: enable_resgroup_validate test: resgroup/enable_resgroup_validate
test: enable_resgroup test: resgroup/enable_resgroup
# basic syntax # basic syntax
test: resgroup_syntax test: resgroup/resgroup_syntax
test: resgroup_transaction test: resgroup/resgroup_transaction
# functions # functions
test: resgroup_concurrency test: resgroup/resgroup_concurrency
test: resgroup_alter_concurrency test: resgroup/resgroup_alter_concurrency
test: resgroup_memory_statistic test: resgroup/resgroup_memory_statistic
test: resgroup_memory_limit test: resgroup/resgroup_memory_limit
test: resgroup_cpu_rate_limit test: resgroup/resgroup_cpu_rate_limit
# memory spill tests # memory spill tests
test: resgroup_memory_hashagg_spill test: resgroup/resgroup_memory_hashagg_spill
test: resgroup_memory_hashjoin_spill test: resgroup/resgroup_memory_hashjoin_spill
test: resgroup_memory_materialize_spill test: resgroup/resgroup_memory_materialize_spill
test: resgroup_memory_sisc_mat_sort test: resgroup/resgroup_memory_sisc_mat_sort
test: resgroup_memory_sisc_sort_spill test: resgroup/resgroup_memory_sisc_sort_spill
test: resgroup_memory_sort_spill test: resgroup/resgroup_memory_sort_spill
test: resgroup_memory_spilltodisk test: resgroup/resgroup_memory_spilltodisk
# regression tests # regression tests
test: resgroup_recreate test: resgroup/resgroup_recreate
test: disable_resgroup test: resgroup/disable_resgroup
...@@ -101,6 +101,7 @@ static char *srcdir = NULL; ...@@ -101,6 +101,7 @@ static char *srcdir = NULL;
static _stringlist *extraroles = NULL; static _stringlist *extraroles = NULL;
static char *initfile = NULL; static char *initfile = NULL;
static char *aodir = NULL; static char *aodir = NULL;
static char *resgroupdir = NULL;
/* internal variables */ /* internal variables */
static const char *progname; static const char *progname;
...@@ -630,7 +631,7 @@ generate_uao_sourcefiles(char *src_dir, char *dest_dir, char *suffix, replacemen ...@@ -630,7 +631,7 @@ generate_uao_sourcefiles(char *src_dir, char *dest_dir, char *suffix, replacemen
* in the "dest" directory, replacing the ".source" prefix in their names with * in the "dest" directory, replacing the ".source" prefix in their names with
* the given suffix. * the given suffix.
*/ */
static void static int
convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix) convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix)
{ {
char abs_srcdir[MAXPGPATH]; char abs_srcdir[MAXPGPATH];
...@@ -638,7 +639,6 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix) ...@@ -638,7 +639,6 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix)
char testtablespace[MAXPGPATH]; char testtablespace[MAXPGPATH];
char indir[MAXPGPATH]; char indir[MAXPGPATH];
char cgroup_mnt_point[MAXPGPATH]; char cgroup_mnt_point[MAXPGPATH];
replacements repls; replacements repls;
struct stat st; struct stat st;
int ret; int ret;
...@@ -676,7 +676,7 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix) ...@@ -676,7 +676,7 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix)
* No warning, to avoid noise in tests that do not have * No warning, to avoid noise in tests that do not have
* these directories; for example, ecpg, contrib and src/pl. * these directories; for example, ecpg, contrib and src/pl.
*/ */
return; return count;
} }
names = pgfnames(indir); names = pgfnames(indir);
...@@ -746,6 +746,7 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix) ...@@ -746,6 +746,7 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix)
char line[1024]; char line[1024];
bool has_tokens = false; bool has_tokens = false;
if (aodir && strncmp(*name, aodir, strlen(aodir)) == 0 && if (aodir && strncmp(*name, aodir, strlen(aodir)) == 0 &&
(strlen(*name) < 8 || strcmp(*name + strlen(*name) - 7, ".source") != 0)) (strlen(*name) < 8 || strcmp(*name + strlen(*name) - 7, ".source") != 0))
{ {
...@@ -755,6 +756,15 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix) ...@@ -755,6 +756,15 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix)
continue; continue;
} }
if (resgroupdir && strncmp(*name, resgroupdir, strlen(resgroupdir)) == 0 &&
(strlen(*name) < 8 || strcmp(*name + strlen(*name) - 7, ".source") != 0))
{
snprintf(srcfile, MAXPGPATH, "%s/%s", source, *name);
snprintf(destfile, MAXPGPATH, "%s/%s/%s", dest_dir, dest, *name);
count += convert_sourcefiles_in(srcfile, dest_dir, destfile, suffix);
continue;
}
/* reject filenames not finishing in ".source" */ /* reject filenames not finishing in ".source" */
if (strlen(*name) < 8) if (strlen(*name) < 8)
continue; continue;
...@@ -824,6 +834,8 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix) ...@@ -824,6 +834,8 @@ convert_sourcefiles_in(char *source, char * dest_dir, char *dest, char *suffix)
} }
pgfnames_cleanup(names); pgfnames_cleanup(names);
return count;
} }
/* Create the .sql, .out and .yml files from the .source files, if any */ /* Create the .sql, .out and .yml files from the .source files, if any */
...@@ -2362,6 +2374,7 @@ help(void) ...@@ -2362,6 +2374,7 @@ help(void)
printf(_(" --init-file=GPD_INIT_FILE init file to be used for gpdiff\n")); printf(_(" --init-file=GPD_INIT_FILE init file to be used for gpdiff\n"));
printf(_(" --ao-dir=DIR directory name prefix containing generic\n")); printf(_(" --ao-dir=DIR directory name prefix containing generic\n"));
printf(_(" UAO row and column tests\n")); printf(_(" UAO row and column tests\n"));
printf(_(" --resgroup-dir=DIR directory name prefix containing resgroup tests\n"));
printf(_("\n")); printf(_("\n"));
printf(_("Options for \"temp-install\" mode:\n")); printf(_("Options for \"temp-install\" mode:\n"));
printf(_(" --no-locale use C locale\n")); printf(_(" --no-locale use C locale\n"));
...@@ -2414,6 +2427,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc ...@@ -2414,6 +2427,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
{"temp-config", required_argument, NULL, 19}, {"temp-config", required_argument, NULL, 19},
{"init-file", required_argument, NULL, 20}, {"init-file", required_argument, NULL, 20},
{"ao-dir", required_argument, NULL, 21}, {"ao-dir", required_argument, NULL, 21},
{"resgroup-dir", required_argument, NULL, 22},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
...@@ -2517,6 +2531,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc ...@@ -2517,6 +2531,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
break; break;
case 21: case 21:
aodir = strdup(optarg); aodir = strdup(optarg);
break;
case 22:
resgroupdir = strdup(optarg);
break; break;
default: default:
/* getopt_long already emitted a complaint */ /* getopt_long already emitted a complaint */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册