1
0
Fork 0

Add versioning for Gateway API Conformance Test Report

This commit is contained in:
Romain 2024-08-30 17:14:03 +02:00 committed by GitHub
parent 5ed972ccd8
commit 51f7f610c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 76 additions and 11 deletions

View file

@ -17,7 +17,6 @@ import (
"github.com/testcontainers/testcontainers-go/modules/k3s"
"github.com/testcontainers/testcontainers-go/network"
"github.com/traefik/traefik/v3/integration/try"
"github.com/traefik/traefik/v3/pkg/version"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/util/sets"
kclientset "k8s.io/client-go/kubernetes"
@ -191,7 +190,7 @@ func (s *K8sConformanceSuite) TestK8sGatewayAPIConformance() {
Organization: "traefik",
Project: "traefik",
URL: "https://traefik.io/",
Version: version.Version,
Version: *k8sConformanceTraefikVersion,
Contact: []string{"@traefik/maintainers"},
},
ConformanceProfiles: sets.New(ksuite.GatewayHTTPConformanceProfileName, ksuite.GatewayGRPCConformanceProfileName),
@ -220,12 +219,17 @@ func (s *K8sConformanceSuite) TestK8sGatewayAPIConformance() {
report, err := cSuite.Report()
require.NoError(s.T(), err, "failed generating conformance report")
// Ignore report date to avoid diff with CI job.
// However, we can track the date of the report thanks to the commit.
// TODO: to publish this report automatically, we have to figure out how to handle the date diff.
report.Date = "-"
rawReport, err := yaml.Marshal(report)
require.NoError(s.T(), err)
s.T().Logf("Conformance report:\n%s", string(rawReport))
require.NoError(s.T(), os.MkdirAll("./conformance-reports", 0o755))
outFile := filepath.Join("conformance-reports", fmt.Sprintf("%s-%s-%s-report.yaml", report.GatewayAPIChannel, report.Version, report.Mode))
require.NoError(s.T(), os.MkdirAll("./conformance-reports/"+report.GatewayAPIVersion, 0o755))
outFile := filepath.Join("conformance-reports/"+report.GatewayAPIVersion, fmt.Sprintf("%s-%s-%s-report.yaml", report.GatewayAPIChannel, report.Version, report.Mode))
require.NoError(s.T(), os.WriteFile(outFile, rawReport, 0o600))
s.T().Logf("Report written to: %s", outFile)
}