Add versioning for Gateway API Conformance Test Report
This commit is contained in:
parent
5ed972ccd8
commit
51f7f610c9
7 changed files with 76 additions and 11 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue