einride / protoc-gen-go-aip-test

MIT License
8 stars 0 forks source link

feat: alternative way to bootstrap the tests #263

Closed thall closed 3 weeks ago

thall commented 3 weeks ago

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 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/.

fredrikaverpil commented 2 weeks ago

@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?

thall commented 2 weeks ago

@fredrikaverpil yes, I will update the README as well, thanks for the reminder!