Split more tests to speed up Travis run

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2022-09-09 11:28:35 -06:00
parent 925f57ccc2
commit 29224c8ea9
10 changed files with 5923 additions and 5861 deletions

View File

@@ -23,11 +23,15 @@ jobs:
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 cluster tests (1)"
env: TEST_SUITE=js_cluster_tests_1
- name: "Run JetStream cluster tests (2)"
env: TEST_SUITE=js_cluster_tests_2
- name: "Run JetStream super cluster tests"
env: TEST_SUITE=js_super_cluster_tests
- name: "Run non JetStream tests from the server package"
- name: "Run MQTT tests"
env: TEST_SUITE=mqtt_tests
- name: "Run non JetStream/MQTT tests from 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

View File

@@ -32,38 +32,54 @@ elif [ "$1" = "js_tests" ]; then
# Run JetStream non-clustered tests. By convention, all JS tests start
# 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.
# tests by using the `skip_js_cluster_tests`, `skip_js_cluster_tests_2`
# and `skip_js_super_cluster_tests` build tags.
go test -race -v -run=TestJetStream ./server -tags=skip_js_cluster_tests,skip_js_super_cluster_tests -count=1 -vet=off -timeout=30m -failfast
go test -race -v -run=TestJetStream ./server -tags=skip_js_cluster_tests,skip_js_cluster_tests_2,skip_js_super_cluster_tests -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "js_cluster_tests" ]; then
elif [ "$1" = "js_cluster_tests_1" ]; then
# Run JetStream clustered tests. By convention, all JS cluster tests
# start with `TestJetStreamCluster`.
# start with `TestJetStreamCluster`. Will run the first batch of tests,
# excluding the ones with the tag skip_js_cluster_tests_2.
go test -race -v -run=TestJetStreamCluster ./server -count=1 -vet=off -timeout=30m -failfast
go test -race -v -run=TestJetStreamCluster ./server -tags=skip_js_cluster_tests_2 -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "js_cluster_tests_2" ]; then
# Run JetStream clustered tests. By convention, all JS cluster tests
# start with `TestJetStreamCluster`. Will run the second batch of tests,
# excluding the ones with the tag skip_js_cluster_tests.
go test -race -v -run=TestJetStreamCluster ./server -tags=skip_js_cluster_tests -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`.
# tests start with `TestJetStreamSuperCluster`.
go test -race -v -run=TestJetStreamSuperCluster ./server -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "js_chaos_tests" ]; then
# Run JetStream chaos tests. By convention, all JS cluster chaos
# tests with `TestJetStreamChaos`.
# Run JetStream chaos tests. By convention, all JS cluster chaos tests
# start with `TestJetStreamChaos`.
go test -race -v -p=1 -run=TestJetStreamChaos ./server -tags=js_chaos_tests -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "mqtt_tests" ]; then
# Run MQTT tests. By convention, all MQTT tests start with `TestMQTT`.
go test -race -v -run=TestMQTT ./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
# JS tests by using the `skip_js_tests` build tag.
# JS tests by using the `skip_js_tests` build tag and MQTT tests by
# using the `skip_mqtt_tests`
go test -race -v -p=1 ./server/... -tags=skip_js_tests -count=1 -vet=off -timeout=30m -failfast
go test -race -v -p=1 ./server/... -tags=skip_js_tests,skip_mqtt_tests -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "non_srv_pkg_tests" ]; then

View File

@@ -3095,7 +3095,7 @@ func TestFileStoreStreamFailToRollBug(t *testing.T) {
// We had a case where a consumer state had a redelivered record that had seq of 0.
// This was causing the server to panic.
func TestBadConsumerState(t *testing.T) {
func TestFileStoreBadConsumerState(t *testing.T) {
bs := []byte("\x16\x02\x01\x01\x03\x02\x01\x98\xf4\x8a\x8a\f\x01\x03\x86\xfa\n\x01\x00\x01")
if cs, err := decodeConsumerState(bs); err != nil || cs == nil {
t.Fatalf("Expected to not throw error, got %v and %+v", err, cs)

View File

@@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !skip_js_tests && !skip_js_cluster_tests
// +build !skip_js_tests,!skip_js_cluster_tests
//go:build !skip_js_tests && !skip_js_cluster_tests && !skip_js_cluster_tests_2
// +build !skip_js_tests,!skip_js_cluster_tests,!skip_js_cluster_tests_2
package server

View File

@@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !skip_js_tests && !skip_js_cluster_tests
// +build !skip_js_tests,!skip_js_cluster_tests
//go:build !skip_js_tests && !skip_js_cluster_tests && !skip_js_cluster_tests_2
// +build !skip_js_tests,!skip_js_cluster_tests,!skip_js_cluster_tests_2
package server

View File

@@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !skip_js_tests && !skip_js_cluster_tests
// +build !skip_js_tests,!skip_js_cluster_tests
//go:build !skip_js_tests && !skip_js_cluster_tests && !skip_js_cluster_tests_2
// +build !skip_js_tests,!skip_js_cluster_tests,!skip_js_cluster_tests_2
package server

File diff suppressed because it is too large Load Diff

View File

@@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !skip_js_tests && !skip_js_cluster_tests && !skip_js_super_cluster_tests
// +build !skip_js_tests,!skip_js_cluster_tests,!skip_js_super_cluster_tests
//go:build !skip_js_tests && !skip_js_cluster_tests && !skip_js_cluster_tests_2 && !skip_js_super_cluster_tests
// +build !skip_js_tests,!skip_js_cluster_tests,!skip_js_cluster_tests_2,!skip_js_super_cluster_tests
package server

View File

@@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !skip_mqtt_tests
// +build !skip_mqtt_tests
package server
import (