Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add new task for integration tests of sync_diff_inspector #12060

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@ clean:
sync-diff-inspector:
$(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/sync_diff_inspector ./sync_diff_inspector

sync-diff-inspector-integration_test: failpoint-enable sync-diff-inspector failpoint-disable
@which bin/tidb-server
@which bin/tikv-server
@which bin/pd-server
@which bin/sync_diff_inspector
@which bin/dumpling
@which bin/loader
@which bin/importer
cd sync_diff_inspector && ln -sf ../bin .
cd sync_diff_inspector && ./tests/run.sh

dm: dm-master dm-worker dmctl dm-syncer

dm-master:
Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This folder contains all tests which relies on external service such as TiDB.

3. The user executing the tests must have permission to create the folder

`/tmp/tidb_tools_test`. All test artifacts will be written into this folder.
`/tmp/sync_diff_inspector_test`. All test artifacts will be written into this folder.

## Running

Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/_utils/check_contains
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# argument 2 is the filename

set -eu
OUT_DIR=/tmp/tidb_tools_test
OUT_DIR=/tmp/sync_diff_inspector_test

if ! grep -Fq "$1" "$2"; then
echo "TEST FAILED: '$2' DOES NOT CONTAIN '$1'"
Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/_utils/check_contains_count
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# argument 3 is the match count

set -eu
OUT_DIR=/tmp/tidb_tools_test
OUT_DIR=/tmp/sync_diff_inspector_test

count=$(grep -F "$1" "$2" | wc -l)

Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/_utils/check_contains_regex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# argument 2 is the filename

set -eu
OUT_DIR=/tmp/tidb_tools_test
OUT_DIR=/tmp/sync_diff_inspector_test

if ! grep -q "$1" "$2"; then
echo "TEST FAILED: '$2' DOES NOT CONTAIN '$1'"
Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

OUT_DIR=/tmp/tidb_tools_test
OUT_DIR=/tmp/sync_diff_inspector_test

# assign default value to mysql config
if [[ -z ${MYSQL_HOST+x} ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ chunk-size = 10
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ chunk-size = 50
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ chunk-size = 500
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex

cd "$(dirname "$0")"

OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
rm -rf $OUT_DIR
mkdir -p $OUT_DIR

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["tidb1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["tidb1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -ex

cd "$(dirname "$0")"
OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql
rm -rf $OUT_DIR
rm -rf $FIX_DIR
mkdir -p $OUT_DIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/sync_diff_inspector/json/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")"

OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
rm -rf $OUT_DIR
mkdir -p $OUT_DIR

Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/sync_diff_inspector/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd "$(dirname "$0")"
# check mysql status
check_db_status "${MYSQL_HOST}" "${MYSQL_PORT}" mysql "."

BASE_DIR=/tmp/tidb_tools_test/sync_diff_inspector
BASE_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector
OUT_DIR=$BASE_DIR/output

mkdir -p $OUT_DIR || true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target-table = "test" # 目标表名
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target-table = "tbl"
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target-schema = "router_test_1"
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target-table = "tbl"
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target-table = "tbl"
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/sync_diff_inspector/shard/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")"

OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
rm -rf $OUT_DIR
mkdir -p $OUT_DIR

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["tidb1"]

Expand Down
4 changes: 2 additions & 2 deletions sync_diff_inspector/tests/sync_diff_inspector/snapshot/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e

cd "$(dirname "$0")"

OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql
rm -rf $OUT_DIR
rm -rf $FIX_DIR
mkdir -p $OUT_DIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["tidb1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e

cd "$(dirname "$0")"

OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql
rm -rf $OUT_DIR
rm -rf $FIX_DIR
mkdir -p $OUT_DIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ skip-non-existing-table = true
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ target-table = "t5"

######################### Task config #########################
[task]
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["mysql1", "mysql2"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex

cd "$(dirname "$0")"

OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
rm -rf $OUT_DIR
mkdir -p $OUT_DIR

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["tidb1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -ex

cd "$(dirname "$0")"
OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql
rm -rf $OUT_DIR
rm -rf $FIX_DIR
mkdir -p $OUT_DIR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ check-struct-only = false
# 2 log: sync-diff.log
# 3 summary: summary.txt
# 4 checkpoint: a dir
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output"
output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output"

source-instances = ["tidb1"]

Expand Down
2 changes: 1 addition & 1 deletion sync_diff_inspector/tests/sync_diff_inspector/tls/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONF_PATH=$(cd ../../conf && pwd)
CA_PATH="$CONF_PATH/root.crt"
CERT_PATH="$CONF_PATH/client.crt"
KEY_PATH="$CONF_PATH/client.key"
OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output
OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output
rm -rf $OUT_DIR
mkdir -p $OUT_DIR

Expand Down
Loading