From 57dc37234731c780bfe7e712e33ff32eff937438 Mon Sep 17 00:00:00 2001 From: Botond Szirtes Date: Tue, 15 Jul 2025 13:50:36 +0200 Subject: [PATCH 1/2] Add strings.ToLower to test case skipping condition Signed-off-by: Botond Szirtes --- tests_interdomain/interdomain_test.go | 3 ++- tests_ovs_extended/feature_ovs_test.go | 3 ++- tests_single/feature_test.go | 9 +++++---- tests_single/ovs_test.go | 7 ++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests_interdomain/interdomain_test.go b/tests_interdomain/interdomain_test.go index 858b5f9fb..e80f87fd5 100644 --- a/tests_interdomain/interdomain_test.go +++ b/tests_interdomain/interdomain_test.go @@ -21,6 +21,7 @@ package interdomain import ( + "strings" "testing" "github.com/stretchr/testify/suite" @@ -55,7 +56,7 @@ type msmSuite struct { } func (s *msmSuite) BeforeTest(suiteName, testName string) { - if testName == "TestNsm_istio" { + if strings.ToLower(testName) == "testnsm_istio" { s.T().Skip() } } diff --git a/tests_ovs_extended/feature_ovs_test.go b/tests_ovs_extended/feature_ovs_test.go index 8b478841f..d4336abad 100644 --- a/tests_ovs_extended/feature_ovs_test.go +++ b/tests_ovs_extended/feature_ovs_test.go @@ -20,6 +20,7 @@ package ovsextra_test import ( "flag" + "strings" "testing" "github.com/networkservicemesh/integration-tests/extensions/parallel" @@ -35,7 +36,7 @@ type kindFeatOvsSuite struct { } func (s *kindFeatOvsSuite) BeforeTest(suiteName, testName string) { - if testName == "TestWebhook_smartvf" { + if strings.ToLower(testName) == "testwebhook_smartvf" { s.T().Skip() } } diff --git a/tests_single/feature_test.go b/tests_single/feature_test.go index 7ae018a58..012db7372 100644 --- a/tests_single/feature_test.go +++ b/tests_single/feature_test.go @@ -20,6 +20,7 @@ package single import ( "flag" + "strings" "testing" "github.com/stretchr/testify/suite" @@ -40,11 +41,11 @@ type calicoFeatureSuite struct { } func (s *calicoFeatureSuite) BeforeTest(suiteName, testName string) { - switch testName { + switch strings.ToLower(testName) { case - "TestNse_composition", - "TestVl3_basic", - "TestVl3_scale_from_zero": + "testnse_composition", + "testvl3_basic", + "testvl3_scale_from_zero": s.T().Skip() } } diff --git a/tests_single/ovs_test.go b/tests_single/ovs_test.go index bd6b490ed..11dc0f0d8 100644 --- a/tests_single/ovs_test.go +++ b/tests_single/ovs_test.go @@ -18,6 +18,7 @@ package single import ( "flag" + "strings" "testing" "github.com/networkservicemesh/integration-tests/extensions/parallel" @@ -35,10 +36,10 @@ type kindOvsSuite struct { } func (s *kindOvsSuite) BeforeTest(suiteName, testName string) { - switch testName { + switch strings.ToLower(testName) { case - "TestSmartVF2SmartVF", - "TestKernel2KernelVLAN": + "testsmartvf2smartvf", + "testkernel2kernelvlan": s.T().Skip() } } From 73dd4e34ce3e540b98b94173659173a92750d3fc Mon Sep 17 00:00:00 2001 From: Botond Szirtes Date: Tue, 15 Jul 2025 14:05:08 +0200 Subject: [PATCH 2/2] fix golangci-lint Signed-off-by: Botond Szirtes --- tests_interdomain/interdomain_test.go | 4 +++- tests_ovs_extended/feature_ovs_test.go | 4 +++- tests_single/feature_test.go | 2 ++ tests_single/ovs_test.go | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests_interdomain/interdomain_test.go b/tests_interdomain/interdomain_test.go index e80f87fd5..95bd6c300 100644 --- a/tests_interdomain/interdomain_test.go +++ b/tests_interdomain/interdomain_test.go @@ -4,6 +4,8 @@ // // Copyright (c) 2024 Pragmagic Inc. and/or its affiliates. // +// Copyright (c) 2025 Nordix and/or its affiliates. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +58,7 @@ type msmSuite struct { } func (s *msmSuite) BeforeTest(suiteName, testName string) { - if strings.ToLower(testName) == "testnsm_istio" { + if strings.EqualFold(testName, "testnsm_istio") { s.T().Skip() } } diff --git a/tests_ovs_extended/feature_ovs_test.go b/tests_ovs_extended/feature_ovs_test.go index d4336abad..3bce47f71 100644 --- a/tests_ovs_extended/feature_ovs_test.go +++ b/tests_ovs_extended/feature_ovs_test.go @@ -2,6 +2,8 @@ // // Copyright (c) 2024 Pragmagic Inc. and/or its affiliates. // +// Copyright (c) 2025 Nordix and/or its affiliates. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,7 +38,7 @@ type kindFeatOvsSuite struct { } func (s *kindFeatOvsSuite) BeforeTest(suiteName, testName string) { - if strings.ToLower(testName) == "testwebhook_smartvf" { + if strings.EqualFold(testName, "testwebhook_smartvf") { s.T().Skip() } } diff --git a/tests_single/feature_test.go b/tests_single/feature_test.go index 012db7372..d02daa8d9 100644 --- a/tests_single/feature_test.go +++ b/tests_single/feature_test.go @@ -2,6 +2,8 @@ // // Copyright (c) 2024 Pragmagic Inc. and/or its affiliates. // +// Copyright (c) 2025 Nordix and/or its affiliates. +// // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/tests_single/ovs_test.go b/tests_single/ovs_test.go index 11dc0f0d8..08a7f4632 100644 --- a/tests_single/ovs_test.go +++ b/tests_single/ovs_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2024 Nordix Foundation. +// Copyright (c) 2023-2025 Nordix Foundation. // // SPDX-License-Identifier: Apache-2.0 //