Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm EnableAllSupportedFeatures & add AllGatewayFeatures #1907

Closed

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Apr 4, 2023

  • With Initial Mesh (GAMMA) conformance tests #1878 the existing flag EnableAllSupportedFeatures used in implementations to run conformance tests pertaining to all Gateway/Ingress features will now also run Mesh conformance tests which might not be the intent.
  • rm EnableAllSupportedFeatures and ask Ingress implementations to set SupportedFeatures to AllGatewayFeatures to achieve the same intent as before. Mesh implementations that also support Gateway features can set SupportedFeatures to AllFeatures.

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

the `EnableAllSupportedFeatures` flag has been removed. You can set `SupportedFeatures` to `AllGatewayFeatures` to run all tests related to Gateway/Ingress or you may set `SupportedFeatures` to `AllFeatures` to run all tests related to Gateway as well as Mesh

* With kubernetes-sigs#1878
the existing flag `EnableAllSupportedFeatures` used in implementations
to run conformance tests pertaining to all Gateway/Ingress features will
now also run Mesh conformance tests which might not be the intent.
* rm `EnableAllSupportedFeatures` and ask Ingress implementations to set
  `SupportedFeatures` to `AllGatewayFeatures` to achieve the same
  intent as before. Mesh implementations that also support Gateway
  features can set `SupportedFeatures` to `AllFeatures`.

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 4, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: arkodg
Once this PR has been reviewed and has the lgtm label, please assign shaneutt for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 4, 2023
@arkodg
Copy link
Contributor Author

arkodg commented Apr 4, 2023

ptal @shaneutt

Copy link
Member

@sunjayBhatia sunjayBhatia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think theres anything correlating the passed in string AllGatewayFeatures or AllFeatures to the right list of tests when using go test ./conformance -supported-features=...? Looks good when using your own suite but when using go test on the suite from this repo it only runs the tests from StandardCoreFeatures

conformance/utils/suite/features.go Outdated Show resolved Hide resolved
@arkodg
Copy link
Contributor Author

arkodg commented Apr 5, 2023

I don't think theres anything correlating the passed in string AllGatewayFeatures or AllFeatures to the right list of tests when using go test ./conformance -supported-features=...? Looks good when using your own suite but when using go test on the suite from this repo it only runs the tests from StandardCoreFeatures

looks like some parse logic exists here

func parseSupportedFeatures(f string) sets.Set[suite.SupportedFeature] {

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
@sunjayBhatia
Copy link
Member

sunjayBhatia commented Apr 5, 2023

I don't think theres anything correlating the passed in string AllGatewayFeatures or AllFeatures to the right list of tests when using go test ./conformance -supported-features=...? Looks good when using your own suite but when using go test on the suite from this repo it only runs the tests from StandardCoreFeatures

looks like some parse logic exists here

func parseSupportedFeatures(f string) sets.Set[suite.SupportedFeature] {

I tried it out and only StandardCoreFeatures tests are run, everything else is skipped

$ go test -v -timeout=20m ./conformance -gateway-class=contour -supported-features=AllGatewayFeatures
=== RUN   TestConformance
    conformance_test.go:54: Running conformance tests with contour GatewayClass
         cleanup: true
         debug: false
         supported features: [AllGatewayFeatures]
         exempt features: []
...
=== RUN   TestConformance/HTTPRouteCrossNamespace
    suite.go:200: Skipping HTTPRouteCrossNamespace: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteDisallowedKind
    suite.go:200: Skipping HTTPRouteDisallowedKind: suite does not support HTTPRoute
...

AllGatewayFeatures is parsed but when we filter tests that does not actually result in any tests being run outside of StandardCoreFeatures which are added by default:

@arkodg
Copy link
Contributor Author

arkodg commented Apr 5, 2023

I don't think theres anything correlating the passed in string AllGatewayFeatures or AllFeatures to the right list of tests when using go test ./conformance -supported-features=...? Looks good when using your own suite but when using go test on the suite from this repo it only runs the tests from StandardCoreFeatures

looks like some parse logic exists here

func parseSupportedFeatures(f string) sets.Set[suite.SupportedFeature] {

I tried it out and only StandardCoreFeatures tests are run, everything else is skipped

$ go test -v -timeout=20m ./conformance -gateway-class=contour -supported-features=AllGatewayFeatures
=== RUN   TestConformance
    conformance_test.go:54: Running conformance tests with contour GatewayClass
         cleanup: true
         debug: false
         supported features: [AllGatewayFeatures]
         exempt features: []
...
=== RUN   TestConformance/HTTPRouteCrossNamespace
    suite.go:200: Skipping HTTPRouteCrossNamespace: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteDisallowedKind
    suite.go:200: Skipping HTTPRouteDisallowedKind: suite does not support HTTPRoute
...

AllGatewayFeatures is parsed but when we filter tests that does not actually result in any tests being run outside of StandardCoreFeatures which are added by default:

thanks for pointing this out. If support for the supported-features flag is broken on main, imo, would be better to raise a separate issue and tackle it in a another PR

@sunjayBhatia
Copy link
Member

thanks for pointing this out. If support for the supported-features flag is broken on main, imo, would be better to raise a separate issue and tackle it in a another PR

This is specific to the added new features. This PR adds two new feature "sets" that can be used when you're writing your own suite, but the new feature names are not actually respected when using -supported-features. Yes they are passed through but this is a problem because no tests are actually tagged with AllGatewayFeatures or AllFeatures (because these new "features" are a collection of features). When a user does -supported-features=AllFeatures if we don't want to tag every test with AllFeatures, then we need to add (in this change) something that translates that passed in string to a set of tests for the suite to run, otherwise the suite logic from here will just run StandardCoreFeatures:

if s.SupportedFeatures == nil {
s.SupportedFeatures = StandardCoreFeatures
} else {
for feature := range StandardCoreFeatures {
s.SupportedFeatures.Insert(feature)
}
}

@arkodg
Copy link
Contributor Author

arkodg commented Apr 5, 2023

thanks for pointing this out. If support for the supported-features flag is broken on main, imo, would be better to raise a separate issue and tackle it in a another PR

This is specific to the added new features. This PR adds two new feature "sets" that can be used when you're writing your own suite, but the new feature names are not actually respected when using -supported-features. Yes they are passed through but this is a problem because no tests are actually tagged with AllGatewayFeatures or AllFeatures (because these new "features" are a collection of features). When a user does -supported-features=AllFeatures if we don't want to tag every test with AllFeatures, then we need to add (in this change) something that translates that passed in string to a set of tests for the suite to run, otherwise the suite logic from here will just run StandardCoreFeatures:

if s.SupportedFeatures == nil {
s.SupportedFeatures = StandardCoreFeatures
} else {
for feature := range StandardCoreFeatures {
s.SupportedFeatures.Insert(feature)
}
}

seeing this issue on main w/o this PR change

git log -n1
commit ccc922b1f186d519fcab9a2c430864a3b60e63ca (HEAD -> main, upstream/main)
Merge: 8dde5080 2acae499
Author: Kubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com>
Date:   Tue Apr 4 09:53:42 2023 -0700

    Merge pull request #1894 from shaneutt/shaneutt/mesh-conformance-machinery-patch
    
    Conformance Tests: No implicit test runs without features

🐳 ~/go-workspace/src/github.com/kubernetes-sigs/gateway-api/conformance$ go test -v ./conformance_test.go -args -gateway-class=envoy-gateway -supported-features=AllFeatures debug=true
=== RUN   TestConformance
    conformance_test.go:54: Running conformance tests with envoy-gateway GatewayClass
         cleanup: true
         debug: false
         enable all features: false 
         supported features: [AllFeatures]
         exempt features: []
........
=== RUN   TestConformance/HTTPRouteQueryParamMatching
    suite.go:203: Skipping HTTPRouteQueryParamMatching: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteRedirectHostAndStatus
    suite.go:203: Skipping HTTPRouteRedirectHostAndStatus: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteRedirectPath
    suite.go:203: Skipping HTTPRouteRedirectPath: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteRedirectPort
    suite.go:203: Skipping HTTPRouteRedirectPort: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteRedirectScheme
    suite.go:203: Skipping HTTPRouteRedirectScheme: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteReferenceGrant
    suite.go:203: Skipping HTTPRouteReferenceGrant: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteRequestHeaderModifier
    suite.go:203: Skipping HTTPRouteRequestHeaderModifier: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteResponseHeaderModifier
    suite.go:203: Skipping HTTPRouteResponseHeaderModifier: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteRewriteHost
    suite.go:203: Skipping HTTPRouteRewriteHost: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteRewritePath
    suite.go:203: Skipping HTTPRouteRewritePath: suite does not support HTTPRoute
=== RUN   TestConformance/HTTPRouteSimpleSameNamespace
    suite.go:203: Skipping HTTPRouteSimpleSameNamespace: suite does not support HTTPRoute
=== RUN   TestConformance/MeshBasic
    suite.go:203: Skipping MeshBasic: suite does not support Mesh
=== RUN   TestConformance/MeshTrafficSplit
    suite.go:203: Skipping MeshTrafficSplit: suite does not support Mesh
=== RUN   TestConformance/TLSRouteSimpleSameNamespace
    suite.go:203: Skipping TLSRouteSimpleSameNamespace: suite does not support TLSRoute

@sunjayBhatia
Copy link
Member

seeing this issue on main w/o this PR change

right, the -all-features flag covered that use case before, now that is taken away there is no way to run all the features in the suite via go test or AllGatewayFeatures

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 25, 2023
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I don't mean to put a damper on this PR, but since this isn't making it into v0.7.0 anyway, and it's looking likely that v0.8.0 will actually just get collided into v1.0.0 where we will have conformance profiles which enable subscribing to large groups of tests maybe we can pass on this one for now? Or is there some really strong need I'm misunderstanding?

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 3, 2023
@arkodg
Copy link
Contributor Author

arkodg commented May 3, 2023

closing since its not needed but a good to have

@arkodg arkodg closed this May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants