Skip to content

Commit 2942445

Browse files
committed
fix: use validator.PhaseDeployment constant in tests
Replace string literal "deployment" with validator.PhaseDeployment to fix goconst lint error in CI.
1 parent dc8323f commit 2942445

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/validator/checks/deployment/expected_resources_check_unit_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"testing"
2121

2222
"github.com/NVIDIA/aicr/pkg/recipe"
23+
"github.com/NVIDIA/aicr/pkg/validator"
2324
"github.com/NVIDIA/aicr/pkg/validator/checks"
2425
appsv1 "k8s.io/api/apps/v1"
2526
corev1 "k8s.io/api/core/v1"
@@ -443,8 +444,8 @@ func TestValidateExpectedResourcesRegistration(t *testing.T) {
443444
t.Errorf("Name = %v, want expected-resources", check.Name)
444445
}
445446

446-
if check.Phase != "deployment" {
447-
t.Errorf("Phase = %v, want deployment", check.Phase)
447+
if check.Phase != string(validator.PhaseDeployment) {
448+
t.Errorf("Phase = %v, want %v", check.Phase, validator.PhaseDeployment)
448449
}
449450

450451
if check.Description == "" {

pkg/validator/checks/deployment/helm_values_check_unit_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/NVIDIA/aicr/pkg/measurement"
2323
"github.com/NVIDIA/aicr/pkg/recipe"
2424
"github.com/NVIDIA/aicr/pkg/snapshotter"
25+
"github.com/NVIDIA/aicr/pkg/validator"
2526
"github.com/NVIDIA/aicr/pkg/validator/checks"
2627
)
2728

@@ -319,8 +320,8 @@ func TestCheckHelmValuesRegistration(t *testing.T) {
319320
t.Errorf("Name = %v, want helm-values", check.Name)
320321
}
321322

322-
if check.Phase != "deployment" { //nolint:goconst // test literal
323-
t.Errorf("Phase = %v, want deployment", check.Phase)
323+
if check.Phase != string(validator.PhaseDeployment) {
324+
t.Errorf("Phase = %v, want %v", check.Phase, validator.PhaseDeployment)
324325
}
325326

326327
if check.Description == "" {

0 commit comments

Comments
 (0)