mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 21:35:52 +00:00
test: run integration tests in parallel (#16035)
This commit is contained in:
parent
6167aef641
commit
bb71d045e1
@ -49,7 +49,7 @@ steps:
|
|||||||
install-gotestsum: &install-gotestsum
|
install-gotestsum: &install-gotestsum
|
||||||
name: install gotestsum
|
name: install gotestsum
|
||||||
environment:
|
environment:
|
||||||
GOTESTSUM_RELEASE: 1.6.4
|
GOTESTSUM_RELEASE: 1.9.0
|
||||||
command: |
|
command: |
|
||||||
ARCH=`uname -m`
|
ARCH=`uname -m`
|
||||||
if [[ "$ARCH" == "aarch64" ]]; then
|
if [[ "$ARCH" == "aarch64" ]]; then
|
||||||
@ -869,12 +869,16 @@ jobs:
|
|||||||
cd ./test/integration/consul-container
|
cd ./test/integration/consul-container
|
||||||
docker run --rm consul:local consul version
|
docker run --rm consul:local consul version
|
||||||
gotestsum \
|
gotestsum \
|
||||||
|
--raw-command \
|
||||||
--format=short-verbose \
|
--format=short-verbose \
|
||||||
--debug \
|
--debug \
|
||||||
--rerun-fails=3 \
|
--rerun-fails=3 \
|
||||||
--packages="./..." \
|
--packages="./..." \
|
||||||
-- \
|
-- \
|
||||||
|
go test \
|
||||||
|
-p=4 \
|
||||||
-timeout=30m \
|
-timeout=30m \
|
||||||
|
-json \
|
||||||
./... \
|
./... \
|
||||||
--target-image consul \
|
--target-image consul \
|
||||||
--target-version local \
|
--target-version local \
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
// - Create an example static-client sidecar, then register both the service and sidecar with Consul
|
// - Create an example static-client sidecar, then register both the service and sidecar with Consul
|
||||||
// - Make sure a call to the client sidecar local bind port returns a response from the upstream, static-server
|
// - Make sure a call to the client sidecar local bind port returns a response from the upstream, static-server
|
||||||
func TestBasicConnectService(t *testing.T) {
|
func TestBasicConnectService(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
cluster := createCluster(t)
|
cluster := createCluster(t)
|
||||||
|
|
||||||
clientService := createServices(t, cluster)
|
clientService := createServices(t, cluster)
|
||||||
|
@ -13,6 +13,8 @@ import (
|
|||||||
|
|
||||||
// Given a 3-server cluster, when the leader is elected, then leader's isLeader is 1 and non-leader's 0
|
// Given a 3-server cluster, when the leader is elected, then leader's isLeader is 1 and non-leader's 0
|
||||||
func TestLeadershipMetrics(t *testing.T) {
|
func TestLeadershipMetrics(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
opts := libcluster.BuildOptions{
|
opts := libcluster.BuildOptions{
|
||||||
InjectAutoEncryption: true,
|
InjectAutoEncryption: true,
|
||||||
InjectGossipEncryption: true,
|
InjectGossipEncryption: true,
|
||||||
|
@ -47,6 +47,8 @@ import (
|
|||||||
// - Terminate the server nodes in the exporting cluster
|
// - Terminate the server nodes in the exporting cluster
|
||||||
// - Make sure there is still service connectivity from the importing cluster
|
// - Make sure there is still service connectivity from the importing cluster
|
||||||
func TestPeering_RotateServerAndCAThenFail_(t *testing.T) {
|
func TestPeering_RotateServerAndCAThenFail_(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.TargetVersion)
|
accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.TargetVersion)
|
||||||
var (
|
var (
|
||||||
acceptingCluster = accepting.Cluster
|
acceptingCluster = accepting.Cluster
|
||||||
|
@ -29,6 +29,8 @@ const (
|
|||||||
// - logs for exceeding
|
// - logs for exceeding
|
||||||
|
|
||||||
func TestServerRequestRateLimit(t *testing.T) {
|
func TestServerRequestRateLimit(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
type action struct {
|
type action struct {
|
||||||
function func(client *api.Client) error
|
function func(client *api.Client) error
|
||||||
rateLimitOperation string
|
rateLimitOperation string
|
||||||
|
@ -6,16 +6,18 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/consul/api"
|
|
||||||
"github.com/hashicorp/consul/sdk/testutil/retry"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/hashicorp/consul/api"
|
||||||
|
"github.com/hashicorp/consul/sdk/testutil/retry"
|
||||||
libcluster "github.com/hashicorp/consul/test/integration/consul-container/libs/cluster"
|
libcluster "github.com/hashicorp/consul/test/integration/consul-container/libs/cluster"
|
||||||
"github.com/hashicorp/consul/test/integration/consul-container/libs/utils"
|
"github.com/hashicorp/consul/test/integration/consul-container/libs/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Test upgrade a cluster of latest version to the target version
|
// Test upgrade a cluster of latest version to the target version
|
||||||
func TestStandardUpgradeToTarget_fromLatest(t *testing.T) {
|
func TestStandardUpgradeToTarget_fromLatest(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
type testcase struct {
|
type testcase struct {
|
||||||
oldversion string
|
oldversion string
|
||||||
targetVersion string
|
targetVersion string
|
||||||
|
@ -4,15 +4,17 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/consul/api"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/hashicorp/consul/api"
|
||||||
libcluster "github.com/hashicorp/consul/test/integration/consul-container/libs/cluster"
|
libcluster "github.com/hashicorp/consul/test/integration/consul-container/libs/cluster"
|
||||||
"github.com/hashicorp/consul/test/integration/consul-container/libs/utils"
|
"github.com/hashicorp/consul/test/integration/consul-container/libs/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Test health check GRPC call using Target Servers and Latest GA Clients
|
// Test health check GRPC call using Target Servers and Latest GA Clients
|
||||||
func TestTargetServersWithLatestGAClients(t *testing.T) {
|
func TestTargetServersWithLatestGAClients(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
const (
|
const (
|
||||||
numServers = 3
|
numServers = 3
|
||||||
numClients = 1
|
numClients = 1
|
||||||
@ -50,11 +52,15 @@ func TestTargetServersWithLatestGAClients(t *testing.T) {
|
|||||||
|
|
||||||
// Test health check GRPC call using Mixed (majority latest) Servers and Latest GA Clients
|
// Test health check GRPC call using Mixed (majority latest) Servers and Latest GA Clients
|
||||||
func TestMixedServersMajorityLatestGAClient(t *testing.T) {
|
func TestMixedServersMajorityLatestGAClient(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testMixedServersGAClient(t, false)
|
testMixedServersGAClient(t, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test health check GRPC call using Mixed (majority target) Servers and Latest GA Clients
|
// Test health check GRPC call using Mixed (majority target) Servers and Latest GA Clients
|
||||||
func TestMixedServersMajorityTargetGAClient(t *testing.T) {
|
func TestMixedServersMajorityTargetGAClient(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
testMixedServersGAClient(t, true)
|
testMixedServersGAClient(t, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/consul/api"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/hashicorp/consul/api"
|
||||||
libassert "github.com/hashicorp/consul/test/integration/consul-container/libs/assert"
|
libassert "github.com/hashicorp/consul/test/integration/consul-container/libs/assert"
|
||||||
libtopology "github.com/hashicorp/consul/test/integration/consul-container/libs/topology"
|
libtopology "github.com/hashicorp/consul/test/integration/consul-container/libs/topology"
|
||||||
"github.com/hashicorp/consul/test/integration/consul-container/libs/utils"
|
"github.com/hashicorp/consul/test/integration/consul-container/libs/utils"
|
||||||
@ -16,6 +16,8 @@ import (
|
|||||||
// TestPeering_UpgradeToTarget_fromLatest checks peering status after dialing cluster
|
// TestPeering_UpgradeToTarget_fromLatest checks peering status after dialing cluster
|
||||||
// and accepting cluster upgrade
|
// and accepting cluster upgrade
|
||||||
func TestPeering_UpgradeToTarget_fromLatest(t *testing.T) {
|
func TestPeering_UpgradeToTarget_fromLatest(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
type testcase struct {
|
type testcase struct {
|
||||||
oldversion string
|
oldversion string
|
||||||
targetVersion string
|
targetVersion string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user