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

🎁 Add test flags for the conformance suite #960

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

nader-ziada
Copy link
Member

Changes

  • service domain to allow for customizing the domain used by the test instead of hard-coding to example.com, defaults to example.com
  • request delay to allow for a delay before trying the request to allow the service to get ready, defaults to zero

/kind enhancement

Release Note

Add test flags to the conformance suite
- service-domain: Set this flag to the domain to be used in tests. defaults to example.com
- request-delay: Set this flag to the number of seconds to wait before calling the service. defaults to 0

@knative-prow knative-prow bot added kind/enhancement size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 8, 2024
@knative-prow knative-prow bot requested review from izabelacg and skonto April 8, 2024 17:20
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.41%. Comparing base (75762ca) to head (ed1dedd).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #960      +/-   ##
==========================================
- Coverage   93.43%   93.41%   -0.02%     
==========================================
  Files          36       36              
  Lines        1249     1003     -246     
==========================================
- Hits         1167      937     -230     
+ Misses         69       53      -16     
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- service domain to allow for customizing the domain used by the test
- request delay to allow for a delay before trying the request to allow the service to get ready
@andrew-su
Copy link
Member

/lgtm

@knative-prow knative-prow bot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Apr 8, 2024
Comment on lines 1049 to 1058
dial := network.NewBackoffDialer(dialBackoff)
ingressIP := ing.Status.PublicLoadBalancer.Ingress[0].IP
if ingressIP != "" {
return func(ctx context.Context, _ string, address string) (net.Conn, error) {
if ingressIP != "" {
return dial(ctx, "tcp", ingressIP+":80")
}
return nil, errors.New("service ingress does not contain dialing information")
}
}
Copy link
Member

Choose a reason for hiding this comment

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

this change seems out of scope for the PR description

Copy link
Member Author

Choose a reason for hiding this comment

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

this was added by mistake as part of my local testing, took it out

@@ -1065,7 +1074,7 @@ func CreateDialContext(ctx context.Context, t *testing.T, ing *v1alpha1.Ingress,
t.Fatalf("Unable to retrieve Kubernetes service %s/%s: %v", namespace, name, err)
}

dial := network.NewBackoffDialer(dialBackoff)
//dial := network.NewBackoffDialer(dialBackoff)
Copy link
Member

Choose a reason for hiding this comment

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

commited my accident?

Copy link
Member Author

Choose a reason for hiding this comment

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

this was also added by mistake as part of my local testing, took it out

@@ -1123,6 +1132,13 @@ func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *h
opts ...RequestOption) *types.RuntimeInfo {
t.Helper()

t.Logf("delay of %d before doing the request \n", test.NetworkingFlags.RequestDelay)
Copy link
Member

Choose a reason for hiding this comment

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

t.Logf already prints new lines I believe

Copy link
Member Author

Choose a reason for hiding this comment

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

removed the new line

@@ -86,9 +86,14 @@ func TestTimeout(t *testing.T) {

func checkTimeout(ctx context.Context, t *testing.T, client *http.Client, name string, code int, initial time.Duration, timeout time.Duration) {
t.Helper()
t.Logf("delay of %d before doing the request \n", test.NetworkingFlags.RequestDelay)
Copy link
Member

Choose a reason for hiding this comment

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

t.Logf already prints new lines I believe

Copy link
Member

Choose a reason for hiding this comment

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

Can we only print this if there is a delay

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, changed to only print if delay > 0

@nader-ziada
Copy link
Member Author

@dprotaso addressed the comments, thanks for the review

@dprotaso
Copy link
Member

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2024
Copy link

knative-prow bot commented Apr 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, nader-ziada

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2024
@knative-prow knative-prow bot merged commit 2002961 into knative:main Apr 10, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants