-
Notifications
You must be signed in to change notification settings - Fork 192
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
NE-1260: Add Makefile target to run Gateway API conformance tests #1176
NE-1260: Add Makefile target to run Gateway API conformance tests #1176
Conversation
@lihongan: This pull request references NE-1260 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.19.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/assign @grzpiotrowski |
/test e2e-aws-operator |
hack/gatewayapi-conformance.sh
Outdated
|
||
oc wait --for=condition=Accepted=true gatewayclass/gateway-conformance --timeout=300s | ||
|
||
echo "All gatewayclass ststus:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in status
hack/gatewayapi-conformance.sh
Outdated
fi | ||
echo "Gateway API CRD bundle-version: ${BUNDLE_VERSION}" | ||
|
||
echo "Creat GatewayClass gateway-conformance" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in Create
hack/gatewayapi-conformance.sh
Outdated
sed -i "s/MaxTimeToConsistency: 30/MaxTimeToConsistency: 90/g" conformance/utils/config/timeout.go | ||
|
||
echo "Start Gateway API Conformance Testing" | ||
go test ./conformance -v -timeout 0 -run TestConformance -args --supported-features=Gateway,HTTPRoute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering should we also include the ReferenceGrant
in the arg for testing, besides the Gateway
and HTTPRoute
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should include the ReferenceGrant
in the arg.
/retest |
/test e2e-gcp-ovn |
|
/retest |
cd gateway-api | ||
go mod vendor | ||
|
||
# modify default timeout of "MaxTimeToConsistency" to make tests pass on AWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please elaborate what slows the test down on AWS specifically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the root cause is the DNS propagation of AWS ELB needs about extra 60s before the actual convergence process. The default MaxTimeToConsistency is 30s so we need to increase it to 90s here.
I ever proposed a change in PR kubernetes-sigs/gateway-api#3542 and it was closed, seems many implementations use kind cluster and metallb to run conformance and the LB can be available in short time, so they don't think the change is necessary.
But when we run the test on Cloud platforms (including Azure/GCP although they use IP instead of alias) it needs more time until the LB is reachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one more line comment to explain this.
hack/gatewayapi-conformance.sh
Outdated
sed -i "s/MaxTimeToConsistency: 30/MaxTimeToConsistency: 90/g" conformance/utils/config/timeout.go | ||
|
||
echo "Start Gateway API Conformance Testing" | ||
go test ./conformance -v -timeout 0 -run TestConformance -args --supported-features=Gateway,HTTPRoute,ReferenceGrant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should limit the test run time to a specific value even if this value is in hours. We should have an opinion about how long the test should take.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, generally the test run time is about 500s so we could limit it to 10m at present, but it might be changed in future.
# because the AWS ELB needs extra ~60s for DNS propagation | ||
sed -i "s/MaxTimeToConsistency: 30/MaxTimeToConsistency: 90/g" conformance/utils/config/timeout.go | ||
|
||
SUPPORTED_FEATURES="Gateway,HTTPRoute,ReferenceGrant,GatewayPort8080,HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRouteResponseHeaderModification,HTTPRoutePortRedirect,HTTPRouteSchemeRedirect,HTTPRoutePathRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,HTTPRouteRequestMirror,HTTPRouteRequestMultipleMirrors,HTTPRouteBackendProtocolH2C,HTTPRouteBackendProtocolWebSocket" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added more supported extended features in latest commit, because if we specify "Gateway,HTTPRoute,ReferenceGrant"
then just core tests will be covered (29 tests). After adding supported extended features we could cover 44 tests and they are:
--- PASS: TestConformance/GatewayInvalidRouteKind (3.48s)
--- PASS: TestConformance/GatewayInvalidTLSConfiguration (5.49s)
--- PASS: TestConformance/GatewayModifyListeners (31.00s)
--- PASS: TestConformance/GatewayObservedGenerationBump (28.96s)
--- PASS: TestConformance/GatewaySecretInvalidReferenceGrant (9.01s)
--- PASS: TestConformance/GatewaySecretMissingReferenceGrant (1.54s)
--- PASS: TestConformance/GatewaySecretReferenceGrantAllInNamespace (2.59s)
--- PASS: TestConformance/GatewaySecretReferenceGrantSpecific (2.33s)
--- PASS: TestConformance/GatewayWithAttachedRoutes (8.94s)
--- PASS: TestConformance/GatewayWithAttachedRoutesWithPort8080 (2.43s)
--- PASS: TestConformance/GatewayClassObservedGenerationBump (2.98s)
--- PASS: TestConformance/HTTPRouteBackendProtocolH2C (2.87s)
--- PASS: TestConformance/HTTPRouteBackendProtocolWebSocket (3.34s)
--- PASS: TestConformance/HTTPRouteCrossNamespace (3.48s)
--- PASS: TestConformance/HTTPExactPathMatching (2.70s)
--- PASS: TestConformance/HTTPRouteHeaderMatching (5.12s)
--- PASS: TestConformance/HTTPRouteHostnameIntersection (103.51s)
--- PASS: TestConformance/HTTPRouteInvalidNonExistentBackendRef (3.44s)
--- PASS: TestConformance/HTTPRouteInvalidBackendRefUnknownKind (3.22s)
--- PASS: TestConformance/HTTPRouteInvalidCrossNamespaceBackendRef (3.07s)
--- PASS: TestConformance/HTTPRouteInvalidCrossNamespaceParentRef (3.19s)
--- PASS: TestConformance/HTTPRouteInvalidParentRefNotMatchingSectionName (2.18s)
--- PASS: TestConformance/HTTPRouteInvalidReferenceGrant (11.32s)
--- PASS: TestConformance/HTTPRouteListenerHostnameMatching (21.70s)
--- PASS: TestConformance/HTTPRouteMatchingAcrossRoutes (4.48s)
--- PASS: TestConformance/HTTPRouteMatching (2.72s)
--- PASS: TestConformance/HTTPRouteMethodMatching (2.71s)
--- PASS: TestConformance/HTTPRouteObservedGenerationBump (3.97s)
--- PASS: TestConformance/HTTPRoutePartiallyInvalidViaInvalidReferenceGrant (4.51s)
--- PASS: TestConformance/HTTPRoutePathMatchOrder (2.56s)
--- PASS: TestConformance/HTTPRouteQueryParamMatching (5.02s)
--- PASS: TestConformance/HTTPRouteRedirectHostAndStatus (2.86s)
--- PASS: TestConformance/HTTPRouteRedirectPath (2.68s)
--- PASS: TestConformance/HTTPRouteRedirectPortAndScheme (16.16s)
--- PASS: TestConformance/HTTPRouteRedirectPort (2.71s)
--- PASS: TestConformance/HTTPRouteRedirectScheme (2.87s)
--- PASS: TestConformance/HTTPRouteReferenceGrant (16.48s)
--- PASS: TestConformance/HTTPRouteRequestHeaderModifier (2.92s)
--- PASS: TestConformance/HTTPRouteRequestMirror (2.18s)
--- PASS: TestConformance/HTTPRouteRequestMultipleMirrors (2.14s)
--- PASS: TestConformance/HTTPRouteResponseHeaderModifier (2.47s)
--- PASS: TestConformance/HTTPRouteRewriteHost (2.66s)
--- PASS: TestConformance/HTTPRouteRewritePath (2.76s)
--- PASS: TestConformance/HTTPRouteSimpleSameNamespace (3.09s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use profiles (e.g. HTTPConformanceProfile) with conformance-profiles
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an example for envoygateway that might help: https://github.com/envoyproxy/gateway/blob/main/tools/make/kube.mk#L265
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I also checked the code from other implementations. Because in v1.0.0
there are two sets flags, in this flags.go there is no conformance-profiles
flag, but it is defined in the file experimental_flags.go. I believe those experimental flags are used to generate the test report (see flag report-output
). And those experimental flags are merged into one file flags.go since v1.1.0
.
Currently with v1.0.0 I'd like to just use the standard flags, and I'm planning to add more flags accordingly when we supporting v1.1.x and we could generate the report automatically.
For the example report we could refer to: https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance/reports (use main
branch so we could see all versions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, if we prefer to use experimental flags/profiles with v.1.0.0
then I can update the go test ...
to include them.
And I'm not very sure the flags of implementation info, they might be
implementation:
contact:
- github.com/openshift/cluster-ingress-operator
organization: OpenShift
project: ingress-gateway-api
url: github.com/openshift/cluster-ingress-operator
version: v4.19.0
but please help correct them if I'm wrong. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, in v1.0.0
three experimental profiles HTTP, TLS, MESH
are defined and they are changed to 5 profiles in v1.1.0
as GATEWAY-HTTP, GATEWAY-TLS, GATEWAY-GRPC, MESH-HTTP, MESH-GRPC
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in v1.0.0 there are two sets flags, in this flags.go there is no conformance-profiles flag, but it is defined in the file experimental_flags.go.
I can see conformance-profiles
flag on release-1.0
branch:
$ git branch --show-current
release-1.0
$ git log -1
commit 093f6538409c071e906856bd1ce4072204fb3f08 (HEAD -> release-1.0, origin/release-1.0)
Merge: 829284a0 1ed97491
Author: Kubernetes Prow Robot <[email protected]>
Date: Mon Feb 5 10:03:20 2024 -0800
Merge pull request #2753 from k8s-infra-cherrypick-robot/cherry-pick-2736-to-release-1.0
[release-1.0] Update experimental channel kustomization with backendtlspolicy
$ go test ./conformance -v -timeout 10m -run TestConformance -args -h | grep -A1 conformance-profiles
-conformance-profiles string
Comma-separated list of the conformance profiles to run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, other experimental flags also can be seen in the help on release-1.0
branch, e.g
$ go test ./conformance -v -timeout 10m -run TestConformance -args -h | grep Implementation -B1
-organization string
Implementation's Organization to issue conformance to
-project string
Implementation's project to issue conformance to
--
-url string
Implementation's url to issue conformance to
-version string
Implementation's version to issue conformance to
If just adding --conformance-profiles
here I cannot see any change to the test result, it is likely to be ignored.
I still believe it is used with --report-output
flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With release-1.0
branch we could run below command and can generate report
$ go test ./conformance -v -timeout 10m -run TestExperimentalConformance -report-output=./report.yaml -conformance-profiles="HTTP" -organization=a -project=b -url=c -version=d
<...snip...>
experimental_conformance_test.go:149: Conformance report:
apiVersion: gateway.networking.k8s.io/v1alpha1
date: "2025-01-24T22:11:42+08:00"
gatewayAPIVersion: TODO
implementation:
contact:
- ""
organization: a
project: b
url: c
version: d
kind: ConformanceReport
profiles:
- core:
result: success
statistics:
Failed: 0
Passed: 29
Skipped: 0
summary: ""
name: HTTP
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code explain it.
// if some conformance profiles have been set, run the experimental conformance suite...
// ...otherwise run the standard conformance suite.
/lgtm @grzpiotrowski : unhold if you are fine with the changes. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alebedev87 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c64b7f5
to
f6f1dbe
Compare
Squashed commits into one to keep it clean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. Thank you.
/unhold
CLONE_DIR=$(mktemp -d) | ||
cd "${CLONE_DIR}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLONE_DIR=$(mktemp -d) | |
cd "${CLONE_DIR}" | |
CLONE_DIR=$(mktemp -d) | |
echo "clone directory: ${CLONE_DIR}" | |
cd "${CLONE_DIR}" |
Otherwise it will be more difficult to find where the repository was cloned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even like this, to let the runner specify a pre-cloned repository too:
CLONE_DIR=$(mktemp -d) | |
cd "${CLONE_DIR}" | |
if [ -z "${CLONE_DIR}" ]; then | |
CLONE_DIR=$(mktemp -d) | |
fi | |
echo "clone directory: ${CLONE_DIR}" | |
cd "${CLONE_DIR}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it looks good. And what do you think about specifying a template ? e.g
CLONE_DIR=$(mktemp -d -t gwapi-conformance-XXXXX)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what do you think about specifying a template ?
I think it's a good idea.
# because the AWS ELB needs extra ~60s for DNS propagation | ||
sed -i "s/MaxTimeToConsistency: 30/MaxTimeToConsistency: 90/g" conformance/utils/config/timeout.go | ||
|
||
SUPPORTED_FEATURES="Gateway,HTTPRoute,ReferenceGrant,GatewayPort8080,HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRouteResponseHeaderModification,HTTPRoutePortRedirect,HTTPRouteSchemeRedirect,HTTPRoutePathRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,HTTPRouteRequestMirror,HTTPRouteRequestMultipleMirrors,HTTPRouteBackendProtocolH2C,HTTPRouteBackendProtocolWebSocket" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use profiles (e.g. HTTPConformanceProfile) with conformance-profiles
flag?
/lgtm |
/label acknowledge-critical-fixes-only New Makefile command which doesn't impact the OCP payload in any way. |
/retest-required |
@lihongan: The following test failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
8ba9339
into
openshift:master
[ART PR BUILD NOTIFIER] Distgit: ose-cluster-ingress-operator |
This PR adds new Makefile target and enables the upstream gateway-api conformance test.
Once this get merged, the follow up openshift/release#60217 will add optional pre-submits job to run conformance test.