зеркало из https://github.com/github/vitess-gh.git
Add site_test Makefile target to run only recommended pre-install tests.
This commit is contained in:
Родитель
b951da47c6
Коммит
7aed34e8e9
34
Makefile
34
Makefile
|
@ -4,14 +4,17 @@
|
|||
|
||||
MAKEFLAGS = -s
|
||||
|
||||
.PHONY: all build test clean unit_test unit_test_cover unit_test_race queryservice_test integration_test bson
|
||||
.PHONY: all build test clean unit_test unit_test_cover unit_test_race queryservice_test integration_test bson site_test site_integration_test
|
||||
|
||||
all: build test
|
||||
|
||||
build:
|
||||
go install ./go/...
|
||||
|
||||
# Set VT_TEST_FLAGS to pass flags to python tests.
|
||||
# For example, verbose output: export VT_TEST_FLAGS=-v
|
||||
test: unit_test queryservice_test integration_test
|
||||
site_test: unit_test site_integration_test
|
||||
|
||||
clean:
|
||||
go clean -i ./go/...
|
||||
|
@ -39,8 +42,21 @@ queryservice_test:
|
|||
time test/queryservice_test.py -e vttablet $$VT_TEST_FLAGS || exit 1 ; \
|
||||
fi
|
||||
|
||||
#export VT_TEST_FLAGS=-v for instance
|
||||
integration_test_files = clone.py \
|
||||
# These tests should be run by users to check that Vitess works in their environment.
|
||||
site_integration_test_files = \
|
||||
keyrange_test.py \
|
||||
keyspace_test.py \
|
||||
mysqlctl.py \
|
||||
secure.py \
|
||||
tabletmanager.py \
|
||||
update_stream.py \
|
||||
vtdb_test.py \
|
||||
vtgatev2_test.py \
|
||||
zkocc_test.py
|
||||
|
||||
# These tests should be run by developers after making code changes.
|
||||
integration_test_files = \
|
||||
clone.py \
|
||||
initial_sharding_bytes.py \
|
||||
initial_sharding.py \
|
||||
keyrange_test.py \
|
||||
|
@ -76,6 +92,18 @@ integration_test:
|
|||
echo ; \
|
||||
done
|
||||
|
||||
site_integration_test:
|
||||
cd test ; \
|
||||
for t in $(site_integration_test_files) ; do \
|
||||
echo $$(date): Running test/$$t... ; \
|
||||
output=$$(time ./$$t $$VT_TEST_FLAGS 2>&1) ; \
|
||||
if [[ $$? != 0 ]]; then \
|
||||
echo "$$output" >&2 ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
echo ; \
|
||||
done
|
||||
|
||||
# this rule only works if bootstrap.sh was successfully ran in ./java
|
||||
java_test:
|
||||
cd java && mvn verify
|
||||
|
|
|
@ -16,7 +16,7 @@ If you run into issues or have questions, you can use our mailing list: vitess@g
|
|||
* [Memcached](http://memcached.org): Used for the rowcache.
|
||||
* [Python](http://python.org): For the client and testing.
|
||||
|
||||
## Installation
|
||||
## Building
|
||||
|
||||
[Install Go](http://golang.org/doc/install).
|
||||
|
||||
|
@ -40,13 +40,56 @@ export MYSQL_FLAVOR=MariaDB
|
|||
make build
|
||||
```
|
||||
|
||||
To run the tests:
|
||||
## Testing
|
||||
|
||||
The full set of tests included in the default _make_ and _make test_ targets
|
||||
is intended for use by Vitess developers to verify code changes.
|
||||
These tests simulate a small cluster by launching many servers on the local
|
||||
machine, so they require a lot of resources (minimum 8GB RAM and SSD recommended).
|
||||
|
||||
If you are only interested in checking that Vitess is working in your
|
||||
environment, you can run a set of lighter tests:
|
||||
|
||||
``` sh
|
||||
make # run the tests
|
||||
make site_test
|
||||
```
|
||||
|
||||
Note: If you see failing tests, it may be that your disk is too slow for the testsuite, leading to timeouts. You might try [testing against a ramdisk](TestingOnARamDisk.markdown).
|
||||
### Common Test Issues
|
||||
|
||||
Many common failures come from running the full developer test suite
|
||||
(_make_ or _make test_) on an underpowered machine. If you still get
|
||||
these errors with the lighter set of site tests (*make site_test*),
|
||||
please let us know on the mailing list.
|
||||
|
||||
#### Node already exists, port in use, etc.
|
||||
|
||||
Sometimes a failed test may leave behind orphaned processes.
|
||||
If you use the default settings, you can find these by looking for
|
||||
*vtdataroot* in the command line, since every process is told to put
|
||||
its files there with a command line flag. For example:
|
||||
|
||||
``` sh
|
||||
pgrep -f -l '(vtdataroot|VTDATAROOT)' # list Vitess processes
|
||||
pkill -f '(vtdataroot|VTDATAROOT)' # kill Vitess processes
|
||||
```
|
||||
|
||||
#### Too many connections to MySQL, or other timeouts
|
||||
|
||||
This often means your disk is too slow. If you don't have access to an SSD,
|
||||
you can try [testing against a ramdisk](TestingOnARamDisk.markdown).
|
||||
|
||||
#### Connection refused to tablet, MySQL socket not found, etc.
|
||||
|
||||
This could mean you ran out of RAM and a server crashed when it tried to allocate more.
|
||||
Some of the heavier tests currently require up to 8GB RAM.
|
||||
|
||||
#### Connection refused in zkctl test
|
||||
|
||||
This could indicate that no Java Runtime is installed.
|
||||
|
||||
#### Running out of disk space
|
||||
|
||||
Some of the larger tests use up to 4GB of temporary space on disk.
|
||||
|
||||
## Setting up a cluster
|
||||
TODO: Expand on all sections
|
||||
|
|
Загрузка…
Ссылка в новой задаче