1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-05 23:56:58 +03:00

Remove pg_regress' never-documented "ignore" feature.

We aren't using this anymore in the wake of commit 09d517773,
so delete it.  We can always revert this if some future use
emerges, but I think our standards for test quality are now
high enough that that will never happen.

Discussion: https://postgr.es/m/4173840.1673290336@sss.pgh.pa.us
This commit is contained in:
Tom Lane 2023-01-09 20:34:26 -05:00
parent 09d517773f
commit bd8d453e9b

View File

@ -111,7 +111,6 @@ static bool postmaster_running = false;
static int success_count = 0; static int success_count = 0;
static int fail_count = 0; static int fail_count = 0;
static int fail_ignore_count = 0;
static bool directory_exists(const char *dir); static bool directory_exists(const char *dir);
static void make_directory(const char *dir); static void make_directory(const char *dir);
@ -1529,7 +1528,6 @@ run_schedule(const char *schedule, test_start_function startfunc,
instr_time starttimes[MAX_PARALLEL_TESTS]; instr_time starttimes[MAX_PARALLEL_TESTS];
instr_time stoptimes[MAX_PARALLEL_TESTS]; instr_time stoptimes[MAX_PARALLEL_TESTS];
int statuses[MAX_PARALLEL_TESTS]; int statuses[MAX_PARALLEL_TESTS];
_stringlist *ignorelist = NULL;
char scbuf[1024]; char scbuf[1024];
FILE *scf; FILE *scf;
int line_num = 0; int line_num = 0;
@ -1566,20 +1564,6 @@ run_schedule(const char *schedule, test_start_function startfunc,
continue; continue;
if (strncmp(scbuf, "test: ", 6) == 0) if (strncmp(scbuf, "test: ", 6) == 0)
test = scbuf + 6; test = scbuf + 6;
else if (strncmp(scbuf, "ignore: ", 8) == 0)
{
c = scbuf + 8;
while (*c && isspace((unsigned char) *c))
c++;
add_stringlist_item(&ignorelist, c);
/*
* Note: ignore: lines do not run the test, they just say that
* failure of this test when run later on is to be ignored. A bit
* odd but that's how the shell-script version did it.
*/
continue;
}
else else
{ {
fprintf(stderr, _("syntax error in schedule file \"%s\" line %d: %s\n"), fprintf(stderr, _("syntax error in schedule file \"%s\" line %d: %s\n"),
@ -1714,29 +1698,10 @@ run_schedule(const char *schedule, test_start_function startfunc,
} }
if (differ) if (differ)
{
bool ignore = false;
_stringlist *sl;
for (sl = ignorelist; sl != NULL; sl = sl->next)
{
if (strcmp(tests[i], sl->str) == 0)
{
ignore = true;
break;
}
}
if (ignore)
{
status(_("failed (ignored)"));
fail_ignore_count++;
}
else
{ {
status(_("FAILED")); status(_("FAILED"));
fail_count++; fail_count++;
} }
}
else else
{ {
status(_("ok ")); /* align with FAILED */ status(_("ok ")); /* align with FAILED */
@ -1762,8 +1727,6 @@ run_schedule(const char *schedule, test_start_function startfunc,
} }
} }
free_stringlist(&ignorelist);
fclose(scf); fclose(scf);
} }
@ -2516,7 +2479,7 @@ regression_main(int argc, char *argv[],
* conserve disk space. (If there were errors, we leave the instance in * conserve disk space. (If there were errors, we leave the instance in
* place for possible manual investigation.) * place for possible manual investigation.)
*/ */
if (temp_instance && fail_count == 0 && fail_ignore_count == 0) if (temp_instance && fail_count == 0)
{ {
header(_("removing temporary instance")); header(_("removing temporary instance"));
if (!rmtree(temp_instance, true)) if (!rmtree(temp_instance, true))
@ -2529,28 +2492,15 @@ regression_main(int argc, char *argv[],
/* /*
* Emit nice-looking summary message * Emit nice-looking summary message
*/ */
if (fail_count == 0 && fail_ignore_count == 0) if (fail_count == 0)
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
_(" All %d tests passed. "), _(" All %d tests passed. "),
success_count); success_count);
else if (fail_count == 0) /* fail_count=0, fail_ignore_count>0 */ else
snprintf(buf, sizeof(buf),
_(" %d of %d tests passed, %d failed test(s) ignored. "),
success_count,
success_count + fail_ignore_count,
fail_ignore_count);
else if (fail_ignore_count == 0) /* fail_count>0 && fail_ignore_count=0 */
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
_(" %d of %d tests failed. "), _(" %d of %d tests failed. "),
fail_count, fail_count,
success_count + fail_count); success_count + fail_count);
else
/* fail_count>0 && fail_ignore_count>0 */
snprintf(buf, sizeof(buf),
_(" %d of %d tests failed, %d of these failures ignored. "),
fail_count + fail_ignore_count,
success_count + fail_count + fail_ignore_count,
fail_ignore_count);
putchar('\n'); putchar('\n');
for (i = strlen(buf); i > 0; i--) for (i = strlen(buf); i > 0; i--)