higress-group/higress

Optimize the e2e testing framework to support testing of resource modifications

開放

#814 建立於 2024年2月2日

 (0 則留言) (0 個反應) (1 位負責人)Go (1,219 個分叉)github user discovery
area/e2ehelp wantedlevel/challenge

倉庫指標

星標
 (9,036 顆星)
PR 合併指標
 (平均合併 7天 9小時) (30 天內合併 18 個 PR)

描述

Why do you need it?

https://github.com/alibaba/higress/blob/29c95ea5571e459a7f230016ceaf96b1dc8e3df9/test/e2e/conformance/tests/httproute-app-root.go#L29-L34

Currently, for manifest resources, only tests after creation are supported, and modified tests are not supported.

How could it be?

Add the concept of stage to the test case. Each stage can modify or delete the manifest, and complete a staged test based on the stage.

And the manifest is not deleted after the stage is completed. Only when the overall test case is completed, all manifests created in the test case are deleted.

It might be configured like this:

var HTTPRouteAppRoot = suite.ConformanceTest{
	ShortName:   "HTTPRouteAppRoot",
	Description: "The Ingress in the higress-conformance-infra namespace uses the app root.",
	Manifests:   []string{"tests/httproute-app-root-base.yaml"},
	Features:    []suite.SupportedFeature{suite.HTTPConformanceFeature},
        Stages:  []suite.ConformanceStageTestUnit {
                {
                    Manifests:   []string{"tests/httproute-app-root-stage-1.yaml","tests/httproute-app-route-temp.yaml"},
             	    Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {},
                },
                {
                    Manifests:   []string{"tests/httproute-app-root-stage-2.yaml"},
                    DeleteManifests: []string{"tests/httproute-app-route-temp.yaml"},
             	    Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {},
                },
         }

貢獻者指南