1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-03 14:52:21 +02:00

Remove duplicate tests from command/infoTest.

Tests that are duplicated are being removed from the info command unit tests. Specifically tests where the only thing different was whether a lock was held or not which affects only the status display. Removing these tests will reduce churn in the upcoming multi-repo support.
This commit is contained in:
Cynthia Shang 2021-01-05 15:14:16 -05:00 committed by GitHub
parent a7491182dc
commit 656e711296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,57 +168,7 @@ testRun(void)
"put archive info to file");
// archive section will cross reference backup db-id 2 to archive db-id 3 but db section will only use the db-ids from
// backup.info
TEST_RESULT_STR_Z(
infoRender(),
"["
"{"
"\"archive\":["
"{"
"\"database\":{"
"\"id\":2"
"},"
"\"id\":\"9.4-3\","
"\"max\":null,"
"\"min\":null"
"}"
"],"
"\"backup\":[],"
"\"cipher\":\"aes-256-cbc\","
"\"db\":["
"{"
"\"id\":1,"
"\"system-id\":6569239123849665666,"
"\"version\":\"9.3\""
"},"
"{"
"\"id\":2,"
"\"system-id\":6569239123849665679,"
"\"version\":\"9.4\""
"}"
"],"
"\"name\":\"stanza1\","
"\"status\":{"
"\"code\":2,"
"\"lock\":{\"backup\":{\"held\":false}},"
"\"message\":\"no valid backups\""
"}"
"}"
"]",
"json - single stanza, no valid backups");
harnessCfgLoad(cfgCmdInfo, argListText);
TEST_RESULT_STR_Z(
infoRender(),
"stanza: stanza1\n"
" status: error (no valid backups)\n"
" cipher: aes-256-cbc\n"
"\n"
" db (current)\n"
" wal archive min/max (9.4-3): none present\n",
"text - single stanza, no valid backups");
// Repeat prior tests while a backup lock is held
// backup.info. Execute while a backup lock is held.
HARNESS_FORK_BEGIN()
{
HARNESS_FORK_CHILD_BEGIN(0, false)
@ -370,108 +320,7 @@ testRun(void)
harnessInfoChecksum(content)),
"put backup info to file");
TEST_RESULT_STR_Z(
infoRender(),
"["
"{"
"\"archive\":["
"{"
"\"database\":{"
"\"id\":1"
"},"
"\"id\":\"9.4-1\","
"\"max\":\"000000020000000000000003\","
"\"min\":\"000000010000000000000002\""
"},"
"{"
"\"database\":{"
"\"id\":3"
"},"
"\"id\":\"9.4-3\","
"\"max\":null,"
"\"min\":null"
"}"
"],"
"\"backup\":["
"{"
"\"archive\":{"
"\"start\":null,"
"\"stop\":null"
"},"
"\"backrest\":{"
"\"format\":5,"
"\"version\":\"2.04\""
"},"
"\"database\":{"
"\"id\":1"
"},"
"\"info\":{"
"\"delta\":26897030,"
"\"repository\":{"
"\"delta\":3159,"
"\"size\":3159776"
"},"
"\"size\":26897030"
"},"
"\"label\":\"20181116-154756F\","
"\"prior\":null,"
"\"reference\":null,"
"\"timestamp\":{"
"\"start\":1542383276,"
"\"stop\":1542383289"
"},"
"\"type\":\"full\""
"}"
"],"
"\"cipher\":\"none\","
"\"db\":["
"{"
"\"id\":1,"
"\"system-id\":6569239123849665679,"
"\"version\":\"9.4\""
"},"
"{"
"\"id\":2,"
"\"system-id\":6569239123849665666,"
"\"version\":\"9.3\""
"},"
"{"
"\"id\":3,"
"\"system-id\":6569239123849665679,"
"\"version\":\"9.4\""
"}"
"],"
"\"name\":\"stanza1\","
"\"status\":{"
"\"code\":0,"
"\"lock\":{\"backup\":{\"held\":false}},"
"\"message\":\"ok\""
"}"
"}"
"]",
"json - single stanza, valid backup, no priors, no archives in latest DB");
harnessCfgLoad(cfgCmdInfo, argListText);
TEST_RESULT_STR_Z(
infoRender(),
"stanza: stanza1\n"
" status: ok\n"
" cipher: none\n"
"\n"
" db (prior)\n"
" wal archive min/max (9.4-1): 000000010000000000000002/000000020000000000000003\n"
"\n"
" full backup: 20181116-154756F\n"
" timestamp start/stop: 2018-11-16 15:47:56 / 2018-11-16 15:48:09\n"
" wal start/stop: n/a\n"
" database size: 25.7MB, backup size: 25.7MB\n"
" repository size: 3MB, repository backup size: 3KB\n"
"\n"
" db (current)\n"
" wal archive min/max (9.4-3): none present\n",
"text - single stanza, valid backup, no priors, no archives in latest DB");
// Repeat prior tests while a backup lock is held
// Execute while a backup lock is held
HARNESS_FORK_BEGIN()
{
HARNESS_FORK_CHILD_BEGIN(0, false)