Skip to content

Commit 4f8e572

Browse files
authored
Merge pull request #2327 from sayboras/tam/remove-experiment-tag
conformance-profile: Remove experimental build tag
2 parents 74562ef + 14c1d85 commit 4f8e572

File tree

10 files changed

+20
-51
lines changed

10 files changed

+20
-51
lines changed

conformance/apis/v1alpha1/conformancereport.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63
@@ -71,7 +68,7 @@ type Implementation struct {
7168
// addresses.
7269
// Rather than Github usernames or email addresses you can provide a URL to the relevant
7370
// support pages for the project. Ideally this would be something like the issue creation page
74-
// on a repository, but for projects without a publicly exposed repository a general support
71+
// on a repository, but for projects without a publicly exposed repository a general support
7572
// page URL can be provided.
7673
Contact []string `json:"contact"`
7774
}

conformance/apis/v1alpha1/doc.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63
@@ -30,7 +27,7 @@ limitations under the License.
3027
// features, then you should not use them. If you would like to opt into these
3128
// unreleased features use Go build tags to enable them, e.g.:
3229
//
33-
// $ GOFLAGS='-tags=experimental' go test ./conformance/... -args ${CONFORMANCE_ARGS}
30+
// $ go test ./conformance/... -args ${CONFORMANCE_ARGS}
3431
//
3532
// Please note that everything here is considered experimental and subject to
3633
// change. Expect breaking changes and/or complete removals if you start using

conformance/apis/v1alpha1/profilereport.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63

conformance/apis/v1alpha1/result.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63

conformance/apis/v1alpha1/statistics.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63

conformance/experimental_conformance_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63
@@ -84,7 +81,7 @@ func TestExperimentalConformance(t *testing.T) {
8481
implementation, err = suite.ParseImplementation(
8582
*flags.ImplementationOrganization,
8683
*flags.ImplementationProject,
87-
*flags.ImplementationUrl,
84+
*flags.ImplementationURL,
8885
*flags.ImplementationVersion,
8986
*flags.ImplementationContact,
9087
)
@@ -143,7 +140,7 @@ func writeReport(logf func(string, ...any), report confv1a1.ConformanceReport, o
143140
}
144141

145142
if output != "" {
146-
if err = os.WriteFile(output, rawReport, 0644); err != nil {
143+
if err = os.WriteFile(output, rawReport, 0o600); err != nil {
147144
return err
148145
}
149146
}

conformance/utils/flags/experimental_flags.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63
@@ -27,7 +24,7 @@ import "flag"
2724
var (
2825
ImplementationOrganization = flag.String("organization", "", "Implementation's Organization to issue conformance to")
2926
ImplementationProject = flag.String("project", "", "Implementation's project to issue conformance to")
30-
ImplementationUrl = flag.String("url", "", "Implementation's url to issue conformance to")
27+
ImplementationURL = flag.String("url", "", "Implementation's url to issue conformance to")
3128
ImplementationVersion = flag.String("version", "", "Implementation's version to issue conformance to")
3229
ImplementationContact = flag.String("contact", "", "Comma-separated list of contact information for the maintainers")
3330
ConformanceProfiles = flag.String("conformance-profiles", "", "Comma-separated list of the conformance profiles to run")

conformance/utils/suite/experimental_profiles.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63
@@ -118,7 +115,7 @@ func getConformanceProfileForName(name ConformanceProfileName) (ConformanceProfi
118115
}
119116

120117
// getConformanceProfilesForTest retrieves the ConformanceProfiles a test belongs to.
121-
func getConformanceProfilesForTest(test ConformanceTest, conformanceProfiles sets.Set[ConformanceProfileName]) (sets.Set[*ConformanceProfile], error) {
118+
func getConformanceProfilesForTest(test ConformanceTest, conformanceProfiles sets.Set[ConformanceProfileName]) sets.Set[*ConformanceProfile] {
122119
matchingConformanceProfiles := sets.New[*ConformanceProfile]()
123120
for _, conformanceProfileName := range conformanceProfiles.UnsortedList() {
124121
cp := conformanceProfileMap[conformanceProfileName]
@@ -134,5 +131,5 @@ func getConformanceProfilesForTest(test ConformanceTest, conformanceProfiles set
134131
}
135132
}
136133

137-
return matchingConformanceProfiles, nil
134+
return matchingConformanceProfiles
138135
}

conformance/utils/suite/experimental_reports.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63
@@ -21,6 +18,7 @@ package suite
2118

2219
import (
2320
"k8s.io/apimachinery/pkg/util/sets"
21+
2422
confv1a1 "sigs.k8s.io/gateway-api/conformance/apis/v1alpha1"
2523
)
2624

@@ -66,7 +64,6 @@ func (p profileReportsMap) addTestResults(conformanceProfile ConformanceProfile,
6664
report.Extended = &confv1a1.ExtendedStatus{}
6765
}
6866
report.Extended.Statistics.Passed++
69-
7067
} else {
7168
report.Core.Statistics.Passed++
7269
}
@@ -118,21 +115,23 @@ func (p profileReportsMap) list() (profileReports []confv1a1.ProfileReport) {
118115
func (p profileReportsMap) compileResults(supportedFeaturesMap map[ConformanceProfileName]sets.Set[SupportedFeature], unsupportedFeaturesMap map[ConformanceProfileName]sets.Set[SupportedFeature]) {
119116
for key, report := range p {
120117
// report the overall result for core features
121-
if report.Core.Failed > 0 {
118+
switch {
119+
case report.Core.Failed > 0:
122120
report.Core.Result = confv1a1.Failure
123-
} else if report.Core.Skipped > 0 {
121+
case report.Core.Skipped > 0:
124122
report.Core.Result = confv1a1.Partial
125-
} else {
123+
default:
126124
report.Core.Result = confv1a1.Success
127125
}
128126

129127
if report.Extended != nil {
130128
// report the overall result for extended features
131-
if report.Extended.Failed > 0 {
129+
switch {
130+
case report.Extended.Failed > 0:
132131
report.Extended.Result = confv1a1.Failure
133-
} else if report.Extended.Skipped > 0 {
132+
case report.Extended.Skipped > 0:
134133
report.Extended.Result = confv1a1.Partial
135-
} else {
134+
default:
136135
report.Extended.Result = confv1a1.Success
137136
}
138137
}

conformance/utils/suite/experimental_suite.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build experimental
2-
// +build experimental
3-
41
/*
52
Copyright 2023 The Kubernetes Authors.
63
@@ -29,6 +26,7 @@ import (
2926

3027
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3128
"k8s.io/apimachinery/pkg/util/sets"
29+
3230
"sigs.k8s.io/gateway-api/conformance"
3331
confv1a1 "sigs.k8s.io/gateway-api/conformance/apis/v1alpha1"
3432
"sigs.k8s.io/gateway-api/conformance/utils/config"
@@ -196,7 +194,7 @@ func (suite *ExperimentalConformanceTestSuite) Run(t *testing.T, tests []Conform
196194
suite.lock.Lock()
197195
if suite.running {
198196
suite.lock.Unlock()
199-
return fmt.Errorf("can't run the test suite multiple times in parallel: the test suite is already running.")
197+
return fmt.Errorf("can't run the test suite multiple times in parallel: the test suite is already running")
200198
}
201199

202200
// if the test suite is not currently running, reset reporting and start a
@@ -251,11 +249,7 @@ func (suite *ExperimentalConformanceTestSuite) Report() (*confv1a1.ConformanceRe
251249

252250
profileReports := newReports()
253251
for _, testResult := range suite.results {
254-
conformanceProfiles, err := getConformanceProfilesForTest(testResult.test, suite.conformanceProfiles)
255-
if err != nil {
256-
return nil, err
257-
}
258-
252+
conformanceProfiles := getConformanceProfilesForTest(testResult.test, suite.conformanceProfiles)
259253
for _, profile := range conformanceProfiles.UnsortedList() {
260254
profileReports.addTestResults(*profile, testResult)
261255
}
@@ -290,7 +284,7 @@ func ParseImplementation(org, project, url, version, contact string) (*confv1a1.
290284
if version == "" {
291285
return nil, errors.New("implementation's version can not be empty")
292286
}
293-
contacts := strings.SplitN(contact, ",", -1)
287+
contacts := strings.Split(contact, ",")
294288
if len(contacts) == 0 {
295289
return nil, errors.New("implementation's contact can not be empty")
296290
}

0 commit comments

Comments
 (0)