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

Rewrite e2e test to no longer use eventing sources. #726

Merged
merged 4 commits into from
Jan 16, 2019

Conversation

n3wscott
Copy link
Contributor

Fixes #686

Proposed Changes

  • Use a copied and modified version of heartbeat source to send and receive events.
  • Remove the dep on eventing-sources

Release Note

NONE

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jan 15, 2019
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 15, 2019
@n3wscott
Copy link
Contributor Author

/assign @grantr
/cc @Harwayne

Copy link
Contributor

@grantr grantr left a comment

Choose a reason for hiding this comment

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

/approve

I'll let someone else lgtm, but I look forward to this going in! Thanks @n3wscott.

test/e2e-tests.sh Outdated Show resolved Hide resolved
Data string `json:"data"`
}

func handler(ctx context.Context, hb *Heartbeat) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about this change - seems like it should be type-agnostic to accommodate future tests. Don't feel strongly though as long as it works (and it works, yay!)

I definitely like that this is its own thing so it can evolve as the e2e tests require without considering breakage (unlike the message-dumper tool).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now that I can get it to work quickly I can iterate on adding the loose coupling back, I think the lib supports this but we have been attempting to do it in a non compatible way. The consumer side needs to pass a io reader, not a map[string]interface. because it can't reflectively create that object...

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2019
Copy link
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

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

Since we're not doing anything about a test, why not just do an http post from the test script directly? Seems like there would be more visibility in case of any errors since they would show up in teh test logs, now if anything goes wrong in the pod (http post failure, etc.) we have to do extra work to scrape those logs, etc.

test/e2e/e2e.go Outdated Show resolved Hide resolved
test/e2e/single_event_test.go Show resolved Hide resolved
@@ -0,0 +1,143 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question if there's any value in having a flag controller binary instead of just doing a POST from the test script?

Copy link
Contributor

Choose a reason for hiding this comment

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

Point being that if something goes wrong in the POST for example, where will those errors surface.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of being able to post from the script for better error handling, if we can solve istio.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this is a good idea. I will add a flag to control this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@grantr when you say from a script, do you mean you prefer a separate pod being created, or ? Just clarifying so I understand your preference :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@vaikas-google I think it would be more convenient to make requests to eventing endpoints directly from the pod running the go test. I do not prefer a separate pod creation, though I don't have a strong preference either way. This seems like something that can be changed in a future PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could make a bounce pod, like just a simple proxy pod that gets configured with the sink and then exposes it's self for a moment while the test runs.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's my preference as well, I think creating new pods just to send an event seems unnecessary and makes it harder to debug test failures.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so just to close the loop on this. I didn't realize that the reason for this is because tests run outside of the cluster and hence they don't have access to sending events directly to the exposed channels. My bad.

return ns, shutdown
}

func TestSingleBinaryEvent(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

LOOK!!!

I verified this works running the test locally on an existing cluster but not with the script. It is still running...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

update: It worked!

PASS
ok  	github.com/knative/eventing/test/e2e	174.283s
**************************************
***        E2E TESTS PASSED        ***
**************************************

@@ -188,6 +218,17 @@ func CreateServiceAccountAndBinding(clients *test.Clients, name string, logger *
return nil
}

// CreateService will create a Service
Copy link
Contributor

Choose a reason for hiding this comment

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

I think rather than create a service, using the route stuff will handle the istio related stuff. But, takes a depedency on serving, which I think we already might have?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do at the moment but as more things move out we might not in the future?

@vaikas
Copy link
Contributor

vaikas commented Jan 16, 2019

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grantr, n3wscott, vaikas-google

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:
  • OWNERS [grantr,vaikas-google]

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

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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants