forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nightlies,logictestccl: probabilistically run backup+restore during l…
…ogic tests This change introduces a nightly script that run the logictests in logictestccl to run with `COCKROACH_LOGIC_TEST_BACKUP_RESTORE_PROBABILITY` set to a non-zero value. This environment variable controls the probability of us running a backup+restore between lines of a logic test. Egs: 1.0 means that every line of the logic test will be run after a cluster backup and restore. The motivation for this change is to increase the coverage of backup+restore testing by piggybacking on our large logictest corpus. To begin with we only run tests in logictestccl with config local, but this will be gradually expanded as we work through the failure modes. Informs: cockroachdb#77130 Release note: None
- Loading branch information
1 parent
203c078
commit e426939
Showing
9 changed files
with
129 additions
and
10 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
build/teamcity/cockroach/nightlies/sqllogic_backup_restore.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))" | ||
|
||
source "$dir/teamcity-support.sh" # For $root | ||
source "$dir/teamcity-bazel-support.sh" # For run_bazel | ||
|
||
tc_start_block "Run SQL Logic Test Backup Restore" | ||
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e BUILD_VCS_NUMBER -e GITHUB_API_TOKEN -e GITHUB_REPO -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL" \ | ||
run_bazel build/teamcity/cockroach/nightlies/sqllogic_backup_restore_impl.sh | ||
tc_end_block "Run SQL Logic Test Backup Restore" |
32 changes: 32 additions & 0 deletions
32
build/teamcity/cockroach/nightlies/sqllogic_backup_restore_impl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xeuo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))" | ||
source "$dir/teamcity-bazel-support.sh" # For process_test_json | ||
|
||
bazel build //pkg/cmd/bazci //pkg/cmd/github-post //pkg/cmd/testfilter --config=ci | ||
BAZEL_BIN=$(bazel info bazel-bin --config=ci) | ||
|
||
ARTIFACTS_DIR=/artifacts | ||
GO_TEST_JSON_OUTPUT_FILE=/artifacts/test.json.txt | ||
exit_status=0 | ||
|
||
for config in local; do | ||
$BAZEL_BIN/pkg/cmd/bazci/bazci_/bazci test -- --config=ci \ | ||
//pkg/ccl/logictestccl/tests/$config/... \ | ||
--test_arg=-show-sql \ | ||
--test_env=COCKROACH_LOGIC_TEST_BACKUP_RESTORE_PROBABILITY=0.8 \ | ||
--test_env=GO_TEST_WRAP_TESTV=1 \ | ||
--test_env=GO_TEST_WRAP=1 \ | ||
--test_env=GO_TEST_JSON_OUTPUT_FILE=$GO_TEST_JSON_OUTPUT_FILE.$config \ | ||
--test_timeout=7200 \ | ||
|| exit_status=$? | ||
|
||
process_test_json \ | ||
$BAZEL_BIN/pkg/cmd/testfilter/testfilter_/testfilter \ | ||
$BAZEL_BIN/pkg/cmd/github-post/github-post_/github-post \ | ||
$ARTIFACTS_DIR \ | ||
$GO_TEST_JSON_OUTPUT_FILE \ | ||
$exit_status | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# LogicTest: local | ||
# BackupRestoreProbability: 0.0 | ||
|
||
statement ok | ||
CREATE TABLE t ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
pkg/ccl/logictestccl/testdata/logic_test/schema_change_in_txn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ go_library( | |
"//pkg/clusterversion", | ||
"//pkg/roachpb", | ||
"//pkg/util", | ||
"//pkg/util/log", | ||
], | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters