Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

added or modified smoke test of four sources and gcp broker #1161

Merged
merged 11 commits into from
Jun 2, 2020

Conversation

capri-xiyue
Copy link
Contributor

@capri-xiyue capri-xiyue commented May 28, 2020

Fixes #909 #1165

Proposed Changes

  • modified or added smoke test of pubsub, storage, scheduler, auditlogs sources
  • added smoke test of gcp broker
  • use "github.com/google/knative-gcp/pkg/apis/broker/v1beta1" when creating gcp broker instead of "knative.dev/eventing/pkg/apis/eventing/v1beta1"

Release Note


Docs

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: capri-xiyue

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

@googlebot googlebot added the cla: yes (override cla status due to multiple authors bug) label May 28, 2020
@capri-xiyue capri-xiyue requested review from chizhg and nachocano and removed request for grac3gao-zz May 28, 2020 22:58
@capri-xiyue
Copy link
Contributor Author

/retest

@capri-xiyue capri-xiyue changed the title [WIP]modified smoke test of CloudPubSubSource [WIP]modified smoke test of four sources May 29, 2020
@capri-xiyue capri-xiyue changed the title [WIP]modified smoke test of four sources modified smoke test of four sources May 29, 2020
@capri-xiyue capri-xiyue changed the title modified smoke test of four sources added or modified smoke test of four sources May 29, 2020
test/e2e/lib/auditlogs.go Outdated Show resolved Hide resolved
@capri-xiyue
Copy link
Contributor Author

capri-xiyue commented May 29, 2020

At first, I tried to avoid using methods like

func (c *Client) CreateStorageOrFail(storage *eventsv1alpha1.CloudStorageSource) {
since it has tracker that we don't need to use in smoke test happy path since we will delete the source by ourselves in the smoke tests(
c.Tracker.AddObj(storage)
).
However, if I don't use that method, it will make the code kind of complex since I need to handle unhappy paths that the test fail and but we still need to delete the sources no matter what.

Therefore, in the end, I still choose to use

func (c *Client) CreateStorageOrFail(storage *eventsv1alpha1.CloudStorageSource) {
with c.Tracker.AddObj(xxxx). The side effect is that when the test passes, if you run go test -v, it will show similar logs that `tracker can't delete source, not found'

@capri-xiyue
Copy link
Contributor Author

In addition, I found one bug of sources(source can still be ready even though the sink(k8s service) doesn't exist). Already filed another issue for that bug #1171

@capri-xiyue
Copy link
Contributor Author

/test pull-google-knative-gcp-integration-tests

@capri-xiyue capri-xiyue changed the title added or modified smoke test of four sources added or modified smoke test of four sources and gcp broker May 29, 2020
@chizhg
Copy link
Member

chizhg commented Jun 1, 2020

lgtm from my side.
Defer to @nachocano and @ericlem for applying the /lgtm label.

@capri-xiyue
Copy link
Contributor Author

/retest

test/e2e/lib/deletion.go Outdated Show resolved Hide resolved
test/e2e/lib/get.go Outdated Show resolved Hide resolved
test/e2e/test_pubsub.go Outdated Show resolved Hide resolved
test/e2e/test_storage.go Outdated Show resolved Hide resolved
@nachocano
Copy link
Member

nachocano commented Jun 1, 2020

/lgtm
/hold
in case you want to do those changes now. Otherwise in a follow up is fine. Please do unhold if so

@capri-xiyue
Copy link
Contributor Author

/retest

@capri-xiyue
Copy link
Contributor Author

/unhold


// WaitDeletionTime for deleting resources
const (
WaitDeletionTime = 20 * time.Second
Copy link
Member

Choose a reason for hiding this comment

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

sounds good, will put this one to 10, and then in the few places you need 20, just multiply?

Copy link
Member

Choose a reason for hiding this comment

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

I see you went with 20 everywhere. My only worry is that tests will last even longer... But I'm ok if you leave it as is

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-google-knative-gcp-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/intevents/reconciler.go 78.2% 78.4% 0.2

@chizhg
Copy link
Member

chizhg commented Jun 1, 2020

/lgtm

@capri-xiyue
Copy link
Contributor Author

/test pull-google-knative-gcp-integration-tests

1 similar comment
@capri-xiyue
Copy link
Contributor Author

/test pull-google-knative-gcp-integration-tests

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-google-knative-gcp-integration-tests 0/3
pull-google-knative-gcp-wi-tests pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
2/3

Automatically retrying due to test flakiness...
/test pull-google-knative-gcp-wi-tests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved cla: yes (override cla status due to multiple authors bug) lgtm size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test deletion of sources also deletes GCP resources
7 participants