-
Notifications
You must be signed in to change notification settings - Fork 21
fix(cts): friendly error message when test is missing #976
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
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
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 ty!
@@ -54,7 +54,16 @@ public void run(Map<String, CodegenModel> models, Map<String, CodegenOperation> | |||
for (Map.Entry<String, CodegenOperation> entry : operations.entrySet()) { | |||
String operationId = entry.getKey(); | |||
if (!cts.containsKey(operationId)) { | |||
throw new CTSException("operationId " + operationId + " does not exist in the spec"); | |||
throw new CTSException( |
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.
can we add a newline with a link to the doc? https://api-clients-automation.netlify.app/docs/contributing/testing/common-test-suite
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.
good idea, should be good
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
50d902c
to
a24d744
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.
Great!
🧭 What and Why
When a new method is added to the spec, we check that there is a corresponding request test, but the error message was backward.
Now it's:
operationId 'getMachin' does not exist in the tests suite, please create the file 'tests/CTS/methods/requests/client/getMachin.json'
🧪 Test
Remove a test from the CTS