Skip to content

Commit

Permalink
create global variable for nameWithInvalidSize
Browse files Browse the repository at this point in the history
  • Loading branch information
jamyct committed Dec 12, 2024
1 parent bc21a2f commit 2c83da8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 0 additions & 5 deletions test/apis/v1alpha1/api_validation_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var _ = Describe("Test networking v1alpha1 API validation", func() {

Context("Test MultiClusterService API validation - invalid cases", func() {
It("should deny creating API with invalid name size", func() {
var nameWithInvalidSize = "abcdef-123456789-123456789-123456789-123456789-123456789-123456789-123456789"

// Create the API.
multiClusterServiceName := &v1alpha1.MultiClusterService{
Expand Down Expand Up @@ -210,7 +209,6 @@ var _ = Describe("Test networking v1alpha1 API validation", func() {

Context("Test ServiceExport API validation - invalid cases", func() {
It("should deny creating API with invalid name size", func() {
var nameWithInvalidSize = "abcdef-123456789-123456789-123456789-123456789-123456789-123456789-123456789"

// Create the API.
serviceExportName := &v1alpha1.ServiceExport{
Expand Down Expand Up @@ -352,7 +350,6 @@ var _ = Describe("Test networking v1alpha1 API validation", func() {

Context("Test ServiceImport API validation - invalid cases", func() {
It("should deny creating API with invalid name size", func() {
var nameWithInvalidSize = "abcdef-123456789-123456789-123456789-123456789-123456789-123456789-123456789"

// Create the API.
serviceImportName := &v1alpha1.ServiceImport{
Expand Down Expand Up @@ -494,7 +491,6 @@ var _ = Describe("Test networking v1alpha1 API validation", func() {

Context("Test TrafficManagerProfile API validation - invalid cases", func() {
It("should deny creating API with invalid name size", func() {
var nameWithInvalidSize = "abcdef-123456789-123456789-123456789-123456789-123456789-123456789-123456789"

// Create the API.
trafficManagerProfileName := &v1alpha1.TrafficManagerProfile{
Expand Down Expand Up @@ -690,7 +686,6 @@ var _ = Describe("Test networking v1alpha1 API validation", func() {

Context("Test TrafficManagerBackend API validation - invalid cases", func() {
It("should deny creating API with invalid name size", func() {
var nameWithInvalidSize = "abcdef-123456789-123456789-123456789-123456789-123456789-123456789-123456789"

// Create the API.
trafficManagerBackendName := &v1alpha1.TrafficManagerBackend{
Expand Down
11 changes: 6 additions & 5 deletions test/apis/v1alpha1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import (
)

var (
hubTestEnv *envtest.Environment
hubClient client.Client
ctx context.Context
cancel context.CancelFunc
testNamespace = "testnamespace"
hubTestEnv *envtest.Environment
hubClient client.Client
ctx context.Context
cancel context.CancelFunc
testNamespace = "testnamespace"
nameWithInvalidSize = "abcdef-123456789-123456789-123456789-123456789-123456789-123456789-123456789"
)

func TestAPIs(t *testing.T) {
Expand Down

0 comments on commit 2c83da8

Please sign in to comment.