-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: alternative way to bootstrap the tests #263
Conversation
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'm not sure where this is headed, but it LGTM technically.
Ping us if you want to show where you are going with this 😄
EDIT: never mind! I'm tired... somehow I missed the last commit, which contains all the goodies.
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 thought it was enough to hit re-review to retract the approval ... but no.
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.
Nice to have an alternative interface! This is non-breaking (except users will get changes in their generated code, expected), so I think we should try it out!
proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/dataset_service_aiptest.pb.go
Outdated
Show resolved
Hide resolved
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 like this!
Address the comment and example comments, and I think this is safe enough to try. I really like that it is not a breaking change for users (except that more code is generated) ⭐
This commit replaces the `ctx` field on the config struct, with a function for getting a context. Same context is used as before, this is preparation for upcomming commits.
This commit replaces the `service` field on the config struct, with a function for getting the service to be tested. This is a preparation for upcomming commit.
We have noticed historically, that when people adds new resources, it's easy to forget to implement the newly generated AIP tests, either directly or later. This commit tries to solve that issue by introducing a main entrypoint to execute the tests, which takes a interface that the user needs to implement. When a new resource is added, the interface will be extended with another method that the user needs to implement, if not, a compilation error would be raised. The user can choose to return `nil` to indicate that it can't be implemented right directly. All tests will still be executed, but if not implemented it will be skipped, this to show it's available but not implemented. This commit is backwards compatible with the current test setup. For example usage, see `examples/`.
@thall late to the party, but I was just wondering if you wanted to also add a note to the main README about this new type of setup? |
@fredrikaverpil yes, I will update the README as well, thanks for the reminder! |
TL;DR
With this setup you need to explicit opt-out tests instead of explicit opt-int.
Why
We have noticed historically, that when people adds new
resources, it's easy to forget to implement the newly
generated AIP tests, either directly or later.
How
This commit tries to solve that issue by introducing a
main entrypoint to execute the tests, which takes a interface
that the user needs to implement.
When a new resource is added, the interface will be extended with
another method that the user needs to implement, if not, a compilation
error would be raised.
The user can choose to return
nil
to indicate that it can't beimplemented right directly.
All tests will still be executed, but if not implemented it will be
skipped, this to show it's available but not implemented.
This commit is backwards compatible with the current test setup.
For example usage, see
examples/
.