remove the skipping of slow tests in go-tests-ce and go-test-enterprise (#20139)

* remove the skipping of slow tests in go-tests-ce and go-test-enterprise

* add license header
This commit is contained in:
John Murret 2024-01-10 20:39:34 -07:00 committed by GitHub
parent 7d92a5dfd6
commit 3fa4a21edd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -270,7 +270,6 @@ jobs:
runs-on: ${{ needs.setup.outputs.compute-large }} runs-on: ${{ needs.setup.outputs.compute-large }}
repository-name: ${{ github.repository }} repository-name: ${{ github.repository }}
go-tags: "" go-tags: ""
go-test-flags: "${{ (github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')) && '-short' || '' }}"
go-version: ${{ needs.get-go-version.outputs.go-version }} go-version: ${{ needs.get-go-version.outputs.go-version }}
permissions: permissions:
id-token: write # NOTE: this permission is explicitly required for Vault auth. id-token: write # NOTE: this permission is explicitly required for Vault auth.
@ -293,7 +292,6 @@ jobs:
runs-on: ${{ needs.setup.outputs.compute-large }} runs-on: ${{ needs.setup.outputs.compute-large }}
repository-name: ${{ github.repository }} repository-name: ${{ github.repository }}
go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consuldev' || '' }}" go-tags: "${{ github.event.repository.name == 'consul-enterprise' && 'consulent consuldev' || '' }}"
go-test-flags: "${{ (github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')) && '-short' || '' }}"
go-version: ${{ needs.get-go-version.outputs.go-version }} go-version: ${{ needs.get-go-version.outputs.go-version }}
permissions: permissions:
id-token: write # NOTE: this permission is explicitly required for Vault auth. id-token: write # NOTE: this permission is explicitly required for Vault auth.

View File

@ -11,6 +11,7 @@ import (
"github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/acl"
external "github.com/hashicorp/consul/agent/grpc-external" external "github.com/hashicorp/consul/agent/grpc-external"
"github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/lib/testhelpers"
"github.com/hashicorp/consul/proto/private/pboperator" "github.com/hashicorp/consul/proto/private/pboperator"
"github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/sdk/testutil/retry"
"google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/insecure"
@ -25,6 +26,8 @@ import (
func TestOperatorBackend_TransferLeader(t *testing.T) { func TestOperatorBackend_TransferLeader(t *testing.T) {
t.Parallel() t.Parallel()
testhelpers.SkipFlake(t)
conf := testClusterConfig{ conf := testClusterConfig{
Datacenter: "dc1", Datacenter: "dc1",
Servers: 3, Servers: 3,

View File

@ -0,0 +1,14 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package testhelpers
import (
"os"
"testing"
)
func SkipFlake(t *testing.T) {
if os.Getenv("RUN_FLAKEY_TESTS") != "true" {
t.Skip("Skipped because marked as flake.")
}
}