Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
test,Makefile: Add more test information in README.md (#646) (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored May 7, 2020
1 parent 222be9c commit 10ef809
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ integration_test: check_third_party_binary

compatibility_test: check_third_party_binary
@which bin/dm-tracer.test
@which bin/dm-master.test.current
@which bin/dm-worker.test.current
@which bin/dm-master.test.previous
@which bin/dm-worker.test.previous
@which bin/dm-master.test
@which bin/dm-worker.test
cp bin/dm-master.test bin/dm-master.test.current
cp bin/dm-worker.test bin/dm-worker.test.current
cp bin/dm-master.test bin/dm-master.test.previous
cp bin/dm-worker.test bin/dm-worker.test.previous
tests/compatibility_run.sh ${CASE}

# unify cover mode in coverage files, more details refer to tests/_utils/run_dm_ctl
Expand Down
28 changes: 21 additions & 7 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

## Preparations

1. The following executables must be copied or generated or linked into these locations, `mydumper` and `sync_diff_inspector` can be downloaded from [tidb-enterprise-tools-latest-linux-amd64](http://download.pingcap.org/tidb-enterprise-tools-latest-linux-amd64.tar.gz):
1. The following executables must be copied or generated or linked into these locations, `mydumper` and `sync_diff_inspector` can be downloaded from [tidb-enterprise-tools-latest-linux-amd64](http://download.pingcap.org/tidb-enterprise-tools-latest-linux-amd64.tar.gz), `tidb-server` can be downloaded from [tidb-master-linux-amd64](https://download.pingcap.org/tidb-master-linux-amd64.tar.gz):

* `bin/tidb-server`
* `bin/sync_diff_inspector`
* `bin/mydumper`
* `bin/dm-master.test` # generated by `make dm_integration_test_build`
* `bin/dm-worker.test` # generated by `make dm_integration_test_build`
* `bin/dm-master.test.current` # used for compatibility test, need renamed from `bin/dm-master.test` by manual
* `bin/dm-worker.test.current` # used for compatibility test, need renamed from `bin/dm-worker.test` by manual
* `bin/dm-master.test.previous` # used for compatibility test, need renamed from `bin/dm-master.test` by manual
* `bin/dm-worker.test.previous` # used for compatibility test, need renamed from `bin/dm-worker.test` by manual
* `bin/dm-master.test.current` # generated from `bin/dm-master.test` by `make compatibility_test`
* `bin/dm-worker.test.current` # generated from `bin/dm-worker.test` by `make compatibility_test`
* `bin/dm-master.test.previous` # generated from `bin/dm-master.test` by `make compatibility_test`
* `bin/dm-worker.test.previous` # generated from `bin/dm-worker.test` by `make compatibility_test`
* [gh-ost](https://github.com/github/gh-ost) # must be added to path, or you can `export GHOST_BINARY=/path/to/gh-ost-binary`
* [pt-online-schema-change](https://www.percona.com/doc/percona-toolkit/LATEST/pt-online-schema-change.html) # must be added to path, or you can `export PTOSC_BINARY=/path/to/pt-osc-binary`

Expand All @@ -34,7 +34,14 @@

1. Run `make dm_integration_test_build` to generate DM related binary for integration test

2. Run `make integration_test` to execute the integration tests. This command will
2. Setup two MySQL servers with binlog enabled first and set `GTID_MODE=ON`, export proper environment variables. Variables and their default values are showed in following table.

| MySQL | Host | Port| PASSWORD |
| :------------ | :---------- | :------ | :---- |
| MySQL1 | `MYSQL_HOST1` / `127.0.0.1` | `MYSQL_PORT1` / `3306` | `MYSQL_PASSWORD1` / `123456` |
| MySQL2 | `MYSQL_HOST2` / `127.0.0.1` | `MYSQL_PORT2` / `3307` | `MYSQL_PASSWORD2` / `123456` |

3. Run `make integration_test` to execute the integration tests. This command will

1. Check that all required executables exist.
2. Execute `tests/run.sh`
Expand All @@ -53,7 +60,14 @@

Run `make compatibility_test` will run compatibility test.

2. Run other test with different version's dm-master and dm-worker
2. Setup two MySQL servers with binlog enabled first and set `GTID_MODE=ON`, export proper environment variable. Variables and their default values are showed in following table.

| MySQL | Host | Port| PASSWORD |
| :------------ | :---------- | :------ | :---- |
| MySQL1 | `MYSQL_HOST1` / `127.0.0.1` | `MYSQL_PORT1` / `3306` | `MYSQL_PASSWORD1` / `123456` |
| MySQL2 | `MYSQL_HOST2` / `127.0.0.1` | `MYSQL_PORT2` / `3307` | `MYSQL_PASSWORD2` / `123456` |

3. Run other test with different version's dm-master and dm-worker

Run `make compatibility_test CASE={test_case}`, for example, `make compatibility_test CASE=http_apis` will run test `http_apis` with previous dm-master and current dm-worker, and also current dm-master and previous dm-worker. The `test_case` can be `all`, and will run all the test cases.

Expand Down

0 comments on commit 10ef809

Please sign in to comment.