mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Split JS cluster and super clusters tests and compile only on 1.16
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
27
.travis.yml
27
.travis.yml
@@ -8,7 +8,6 @@ vm:
|
||||
language: go
|
||||
go:
|
||||
- 1.17.x
|
||||
- 1.16.x
|
||||
|
||||
addons:
|
||||
apt:
|
||||
@@ -16,13 +15,25 @@ addons:
|
||||
- rpm
|
||||
go_import_path: github.com/nats-io/nats-server
|
||||
|
||||
env:
|
||||
- TEST_SUITE=compile
|
||||
- TEST_SUITE=no_race_tests
|
||||
- TEST_SUITE=js_tests
|
||||
- TEST_SUITE=js_cluster_tests
|
||||
- TEST_SUITE=srv_pkg_non_js_tests
|
||||
- TEST_SUITE=non_srv_pkg_tests
|
||||
jobs:
|
||||
include:
|
||||
- name: "Compile and various checks"
|
||||
env: TEST_SUITE=compile
|
||||
- name: "Run TestNoRace tests"
|
||||
env: TEST_SUITE=no_race_tests
|
||||
- name: "Run JetStream tests"
|
||||
env: TEST_SUITE=js_tests
|
||||
- name: "Run JetStream cluster tests"
|
||||
env: TEST_SUITE=js_cluster_tests
|
||||
- name: "Run JetStream super cluster tests"
|
||||
env: TEST_SUITE=js_super_cluster_tests
|
||||
- name: "Run non JetStreams tests form the server package"
|
||||
env: TEST_SUITE=srv_pkg_non_js_tests
|
||||
- name: "Run all tests from all other packages"
|
||||
env: TEST_SUITE=non_srv_pkg_tests
|
||||
- name: "Compile and various checks with older Go release"
|
||||
go: 1.16.x
|
||||
env: TEST_SUITE=compile
|
||||
|
||||
script: ./runTestsOnTravis.sh $TEST_SUITE
|
||||
|
||||
|
||||
@@ -28,18 +28,26 @@ elif [ "$1" = "no_race_tests" ]; then
|
||||
elif [ "$1" = "js_tests" ]; then
|
||||
|
||||
# Run JetStream non-clustere tests. By convention, all JS tests start
|
||||
# with `TestJetStream`. We exclude the clustered tests by using the
|
||||
# `skip_js_cluster_tests` build tag.
|
||||
# with `TestJetStream`. We exclude the clustered and super-clustered
|
||||
# tests by using the `skip_js_cluster_tests` and `skip_js_super_cluster_tests`
|
||||
# build tags.
|
||||
|
||||
go test -race -v -run=TestJetStream ./server -tags=skip_js_cluster_tests -count=1 -vet=off -timeout=30m -failfast
|
||||
go test -race -v -run=TestJetStream ./server -tags=skip_js_cluster_tests,skip_js_super_cluster_tests -count=1 -vet=off -timeout=30m -failfast
|
||||
|
||||
elif [ "$1" = "js_cluster_tests" ]; then
|
||||
|
||||
# Run JetStream clustered tests. By convention, all JS clustered tests
|
||||
# Run JetStream clustered tests. By convention, all JS cluster tests
|
||||
# start with `TestJetStreamCluster`.
|
||||
|
||||
go test -race -v -run=TestJetStreamCluster ./server -count=1 -vet=off -timeout=30m -failfast
|
||||
|
||||
elif [ "$1" = "js_super_cluster_tests" ]; then
|
||||
|
||||
# Run JetStream super clustered tests. By convention, all JS super cluster
|
||||
# tests with `TestJetStreamSuperCluster`.
|
||||
|
||||
go test -race -v -run=TestJetStreamSuperCluster ./server -count=1 -vet=off -timeout=30m -failfast
|
||||
|
||||
elif [ "$1" = "srv_pkg_non_js_tests" ]; then
|
||||
|
||||
# Run all non JetStream tests in the server package. We exclude the
|
||||
|
||||
17
server/README.md
Normal file
17
server/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Tests
|
||||
|
||||
Tests that run on Travis have been split into jobs that run in their own VM in parallel. This reduces the overall running time but also is allowing recycling of a job when we get a flapper as opposed to have to recycle the whole test suite.
|
||||
|
||||
## JetStream Tests
|
||||
|
||||
For JetStream tests, we need to observe a naming convention so that no tests are omitted when running on Travis.
|
||||
|
||||
The script `runTestsOnTravis.sh` will run a given job based on the definition found in "`.travis.yml`".
|
||||
|
||||
As for the naming convention:
|
||||
|
||||
- All JetStream tests name should start with `TestJetStream`
|
||||
- Cluster tests should go into `jetstream_cluster_test.go` and start with `TestJetStreamCluster`
|
||||
- Super-cluster tests should go into `jetstream_super_cluster_test.go` and start with `TestJetStreamSuperCluster`
|
||||
|
||||
Not following this convention means that some tests may not be executed on Travis.
|
||||
File diff suppressed because it is too large
Load Diff
2421
server/jetstream_super_cluster_test.go
Normal file
2421
server/jetstream_super_cluster_test.go
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user