-
Notifications
You must be signed in to change notification settings - Fork 21
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 consumer test for e2e #108
Conversation
/assign @clyang82 @skeeey @qiujian16 @morvencao |
test/e2e/pkg/suite_test.go
Outdated
apiServerAddress string | ||
kubeconfig string | ||
consumer_name string | ||
kubeClient *kubernetes.Clientset | ||
apiClient *openapi.APIClient | ||
helper *test.Helper |
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.
@clyang82
I'm curious why we need helper
in e2e testing? It's mainly used by integration test to set up maestro servers in process, but for e2e testing, the maestro server is deployed in kubernetes cluster, the only use of helper
is to create openapi resource?
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. only use it to create openapi resource.
test/e2e/pkg/suite_test.go
Outdated
apiServerAddress string | ||
kubeconfig string | ||
consumer_name string | ||
kubeClient *kubernetes.Clientset | ||
apiClient *openapi.APIClient | ||
helper *test.Helper |
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. only use it to create openapi resource.
test/e2e/pkg/consumer_test.go
Outdated
got = true | ||
} | ||
} | ||
Expect(got).To(BeTrue()) |
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.
how to guarantee the consumer is there? the test order is random. if run this test at the beginning, the consumer should not exist. right?
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.
Since all the specs are located in an Ordered
Consumer
, all the specs are guaranteed to run sequentially, in the order they are written.
refer: https://onsi.github.io/ginkgo/#ordered-containers
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.
For this case, we already have generated a consumer before running the e2e test. So the consumer must be there~
maestro/test/e2e/setup/e2e_setup.sh
Line 81 in 6c5f14c
export consumer_name=$(curl -k -X POST -H "Content-Type: application/json" https://${external_host_ip}:30080/api/maestro/v1/consumers -d '{}' | jq '.id') |
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.
How about the case you want to run it in an existing environment? Do you require create the consumer as a pre-requirement? maybe just adjust your order to create/get/patch
44013a8
to
db488d7
Compare
test/e2e/pkg/consumer_test.go
Outdated
got = true | ||
} | ||
} | ||
Expect(got).To(BeTrue()) |
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.
How about the case you want to run it in an existing environment? Do you require create the consumer as a pre-requirement? maybe just adjust your order to create/get/patch
d2bd913
to
71b7b45
Compare
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.
LGTM
/ok-to-test |
Signed-off-by: myan <[email protected]> update the source client Signed-off-by: myan <[email protected]> rebase Signed-off-by: myan <[email protected]> fix Signed-off-by: myan <[email protected]> reply review Signed-off-by: myan <[email protected]>
/ok-to-test |
Signed-off-by: myan <[email protected]>
Signed-off-by: myan <[email protected]>
/ok-to-test |
/cc @clyang82 |
Thanks @yanmxa for your contribution. |
Signed-off-by: myan [email protected]
Add the e2e test case for CURD on consumers