Skip to content

Commit

Permalink
chore: trial renamed to provisional
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Sep 10, 2024
1 parent a73ef5a commit 91d21c0
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 65 deletions.
4 changes: 2 additions & 2 deletions conformance/apis/v1/conformancereport.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ type ConformanceReport struct {
// profile that was enabled for a test run.
ProfileReports []ProfileReport `json:"profiles"`

// SucceededTrialTests is a list of the names of the trial tests that
// SucceededProvisionalTests is a list of the names of the provisional tests that
// have been successfully run.
SucceededTrialTests []string `json:"succeededTrialTests,omitempty"`
SucceededProvisionalTests []string `json:"succeededProvisionalTests,omitempty"`
}

// Implementation provides metadata information on the downstream
Expand Down
2 changes: 1 addition & 1 deletion conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func DefaultOptions(t *testing.T) suite.ConformanceOptions {
SkipTests: skipTests,
SupportedFeatures: supportedFeatures,
TimeoutConfig: conformanceconfig.DefaultTimeoutConfig(),
SkipTrialTests: *flags.SkipTrialTests,
SkipProvisionalTests: *flags.SkipProvisionalTests,
}
}

Expand Down
2 changes: 1 addition & 1 deletion conformance/tests/udproute-simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var UDPRouteTest = suite.ConformanceTest{
features.SupportUDPRoute,
features.SupportGateway,
},
Trial: true,
Provisional: true,
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
t.Run("Simple UDP request matching UDPRoute should reach coredns backend", func(t *testing.T) {
namespace := "gateway-conformance-infra"
Expand Down
2 changes: 1 addition & 1 deletion conformance/utils/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ var (
AllowCRDsMismatch = flag.Bool("allow-crds-mismatch", false, "Flag to allow the suite not to fail in case there is a mismatch between CRDs versions and channels.")
ConformanceProfiles = flag.String("conformance-profiles", "", "Comma-separated list of the conformance profiles to run")
ReportOutput = flag.String("report-output", "", "The file where to write the conformance report")
SkipTrialTests = flag.Bool("skip-trial-tests", false, "Whether to skip trial tests")
SkipProvisionalTests = flag.Bool("skip-provisional-tests", false, "Whether to skip provisional tests")
)
2 changes: 1 addition & 1 deletion conformance/utils/suite/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type ConformanceTest struct {
Slow bool
Parallel bool
Test func(*testing.T, *ConformanceTestSuite)
Trial bool
Provisional bool
}

// Run runs an individual tests, applying and cleaning up the required manifests
Expand Down
10 changes: 5 additions & 5 deletions conformance/utils/suite/reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ type testResult struct {
type resultType string

var (
testSucceeded resultType = "SUCCEEDED"
testFailed resultType = "FAILED"
testSkipped resultType = "SKIPPED"
testNotSupported resultType = "NOT_SUPPORTED"
testTrialSkipped resultType = "TRIAL_SKIPPED"
testSucceeded resultType = "SUCCEEDED"
testFailed resultType = "FAILED"
testSkipped resultType = "SKIPPED"
testNotSupported resultType = "NOT_SUPPORTED"
testProvisionalSkipped resultType = "PROVISIONAL_SKIPPED"
)

type profileReportsMap map[ConformanceProfileName]confv1.ProfileReport
Expand Down
40 changes: 20 additions & 20 deletions conformance/utils/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type ConformanceTestSuite struct {
SupportedFeatures sets.Set[features.FeatureName]
TimeoutConfig config.TimeoutConfig
SkipTests sets.Set[string]
SkipTrialTests bool
SkipProvisionalTests bool
RunTest string
ManifestFS []fs.FS
UsableNetworkAddresses []v1beta1.GatewayAddress
Expand Down Expand Up @@ -145,8 +145,8 @@ type ConformanceOptions struct {
// SkipTests contains all the tests not to be run and can be used to opt out
// of specific tests
SkipTests []string
// SkipTrialTests indicates whether or not to skip trial tests.
SkipTrialTests bool
// SkipProvisionalTests indicates whether or not to skip provisional tests.
SkipProvisionalTests bool
// RunTest is a single test to run, mostly for development/debugging convenience.
RunTest string

Expand Down Expand Up @@ -251,7 +251,7 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite,
TimeoutConfig: options.TimeoutConfig,
SkipTests: sets.New(options.SkipTests...),
RunTest: options.RunTest,
SkipTrialTests: options.SkipTrialTests,
SkipProvisionalTests: options.SkipProvisionalTests,
ManifestFS: options.ManifestFS,
UsableNetworkAddresses: options.UsableNetworkAddresses,
UnusableNetworkAddresses: options.UnusableNetworkAddresses,
Expand Down Expand Up @@ -435,8 +435,8 @@ func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest) er
if suite.SkipTests.Has(test.ShortName) {
res = testSkipped
}
if suite.SkipTrialTests && test.Trial {
res = testTrialSkipped
if suite.SkipProvisionalTests && test.Provisional {
res = testProvisionalSkipped
}
if !suite.SupportedFeatures.HasAll(test.Features...) {
res = testNotSupported
Expand Down Expand Up @@ -493,14 +493,14 @@ func (suite *ConformanceTestSuite) Report() (*confv1.ConformanceReport, error) {
}
sort.Strings(testNames)
profileReports := newReports()
succeededTrialTestSet := sets.Set[string]{}
succeededProvisionalTestSet := sets.Set[string]{}
for _, tN := range testNames {
tr := suite.results[tN]
if tr.result == testTrialSkipped {
if tr.result == testProvisionalSkipped {
continue
}
if tr.result == testSucceeded && tr.test.Trial {
succeededTrialTestSet.Insert(tN)
if tr.result == testSucceeded && tr.test.Provisional {
succeededProvisionalTestSet.Insert(tN)
}
conformanceProfiles := getConformanceProfilesForTest(tr.test, suite.conformanceProfiles).UnsortedList()
sort.Slice(conformanceProfiles, func(i, j int) bool {
Expand All @@ -510,9 +510,9 @@ func (suite *ConformanceTestSuite) Report() (*confv1.ConformanceReport, error) {
profileReports.addTestResults(*profile, tr)
}
}
var succeededTrialTests []string
if len(succeededTrialTestSet) > 0 {
succeededTrialTests = sets.List(succeededTrialTestSet)
var succeededProvisionalTests []string
if len(succeededProvisionalTestSet) > 0 {
succeededProvisionalTests = sets.List(succeededProvisionalTestSet)
}

profileReports.compileResults(suite.extendedSupportedFeatures, suite.extendedUnsupportedFeatures)
Expand All @@ -522,13 +522,13 @@ func (suite *ConformanceTestSuite) Report() (*confv1.ConformanceReport, error) {
APIVersion: confv1.GroupVersion.String(),
Kind: "ConformanceReport",
},
Date: time.Now().Format(time.RFC3339),
Mode: suite.mode,
Implementation: suite.implementation,
GatewayAPIVersion: suite.apiVersion,
GatewayAPIChannel: suite.apiChannel,
ProfileReports: profileReports.list(),
SucceededTrialTests: succeededTrialTests,
Date: time.Now().Format(time.RFC3339),
Mode: suite.mode,
Implementation: suite.implementation,
GatewayAPIVersion: suite.apiVersion,
GatewayAPIChannel: suite.apiChannel,
ProfileReports: profileReports.list(),
SucceededProvisionalTests: succeededProvisionalTests,
}, nil
}

Expand Down
68 changes: 34 additions & 34 deletions conformance/utils/suite/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ var (
ShortName: "extendedTest",
Features: []features.FeatureName{extendedFeature},
}
coreTrialTest = ConformanceTest{
ShortName: "coreTrialTest",
Features: []features.FeatureName{coreFeature},
Trial: true,
coreProvisionalTest = ConformanceTest{
ShortName: "coreProvisionalTest",
Features: []features.FeatureName{coreFeature},
Provisional: true,
}
extendedTrialTest = ConformanceTest{
ShortName: "extendedTrialTest",
Features: []features.FeatureName{extendedFeature},
Trial: true,
extendedProvisionalTest = ConformanceTest{
ShortName: "extendedProvisionalTest",
Features: []features.FeatureName{extendedFeature},
Provisional: true,
}
)

Expand All @@ -220,7 +220,7 @@ func TestSuiteReport(t *testing.T) {
features sets.Set[features.FeatureName]
extendedSupportedFeatures map[ConformanceProfileName]sets.Set[features.FeatureName]
profiles sets.Set[ConformanceProfileName]
skipTrialTests bool
skipProvisionalTests bool
results map[string]testResult
expectedReport confv1.ConformanceReport
expectedError error
Expand All @@ -241,13 +241,13 @@ func TestSuiteReport(t *testing.T) {
result: testSucceeded,
test: extendedTest,
},
coreTrialTest.ShortName: {
coreProvisionalTest.ShortName: {
result: testSucceeded,
test: coreTrialTest,
test: coreProvisionalTest,
},
extendedTrialTest.ShortName: {
extendedProvisionalTest.ShortName: {
result: testSucceeded,
test: extendedTrialTest,
test: extendedProvisionalTest,
},
},
expectedReport: confv1.ConformanceReport{
Expand All @@ -272,9 +272,9 @@ func TestSuiteReport(t *testing.T) {
},
},
},
SucceededTrialTests: []string{
coreTrialTest.ShortName,
extendedTrialTest.ShortName,
SucceededProvisionalTests: []string{
coreProvisionalTest.ShortName,
extendedProvisionalTest.ShortName,
},
},
},
Expand All @@ -294,13 +294,13 @@ func TestSuiteReport(t *testing.T) {
result: testSkipped,
test: extendedTest,
},
coreTrialTest.ShortName: {
coreProvisionalTest.ShortName: {
result: testSucceeded,
test: coreTrialTest,
test: coreProvisionalTest,
},
extendedTrialTest.ShortName: {
result: testTrialSkipped,
test: extendedTrialTest,
extendedProvisionalTest.ShortName: {
result: testProvisionalSkipped,
test: extendedProvisionalTest,
},
},
expectedReport: confv1.ConformanceReport{
Expand Down Expand Up @@ -332,19 +332,19 @@ func TestSuiteReport(t *testing.T) {
},
},
},
SucceededTrialTests: []string{
coreTrialTest.ShortName,
SucceededProvisionalTests: []string{
coreProvisionalTest.ShortName,
},
},
},
{
name: "skip trial tests",
name: "skip provisional tests",
features: sets.New(coreFeature, extendedFeature),
extendedSupportedFeatures: map[ConformanceProfileName]sets.Set[features.FeatureName]{
testProfileName: sets.New(extendedFeature),
},
profiles: sets.New(testProfileName),
skipTrialTests: true,
profiles: sets.New(testProfileName),
skipProvisionalTests: true,
results: map[string]testResult{
coreTest.ShortName: {
result: testSucceeded,
Expand All @@ -354,13 +354,13 @@ func TestSuiteReport(t *testing.T) {
result: testSucceeded,
test: extendedTest,
},
coreTrialTest.ShortName: {
result: testTrialSkipped,
test: coreTrialTest,
coreProvisionalTest.ShortName: {
result: testProvisionalSkipped,
test: coreProvisionalTest,
},
extendedTrialTest.ShortName: {
result: testTrialSkipped,
test: extendedTrialTest,
extendedProvisionalTest.ShortName: {
result: testProvisionalSkipped,
test: extendedProvisionalTest,
},
},
expectedReport: confv1.ConformanceReport{
Expand Down Expand Up @@ -399,11 +399,11 @@ func TestSuiteReport(t *testing.T) {
SupportedFeatures: tc.features,
extendedSupportedFeatures: tc.extendedSupportedFeatures,
results: tc.results,
SkipTrialTests: tc.skipTrialTests,
SkipProvisionalTests: tc.skipProvisionalTests,
}
report, err := suite.Report()
assert.Equal(t, tc.expectedReport.ProfileReports, report.ProfileReports)
assert.Equal(t, tc.expectedReport.SucceededTrialTests, report.SucceededTrialTests)
assert.Equal(t, tc.expectedReport.SucceededProvisionalTests, report.SucceededProvisionalTests)
assert.Equal(t, tc.expectedError, err)
})
}
Expand Down

0 comments on commit 91d21c0

Please sign in to comment.