Browse Source

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
pull/20167/head
John Murret 11 months ago committed by GitHub
parent
commit
3fa4a21edd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/go-tests.yml
  2. 3
      agent/consul/operator_backend_test.go
  3. 14
      lib/testhelpers/testhelpers.go

2
.github/workflows/go-tests.yml

@ -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.

3
agent/consul/operator_backend_test.go

@ -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,

14
lib/testhelpers/testhelpers.go

@ -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.")
}
}
Loading…
Cancel
Save