Skip to content

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

Merged
merged 1 commit into from
Aug 30, 2022
Merged

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Aug 30, 2022

🧭 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

@millotp millotp requested a review from a team August 30, 2022 12:51
@millotp millotp self-assigned this Aug 30, 2022
@millotp millotp requested review from damcou and shortcuts and removed request for a team August 30, 2022 12:51
@netlify
Copy link

netlify bot commented Aug 30, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit a24d744
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/630e089fc7be2c000901f1dd

Copy link
Member

@shortcuts shortcuts left a 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(
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

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

@algolia-bot
Copy link
Collaborator

algolia-bot commented Aug 30, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

Great!

@millotp millotp enabled auto-merge (squash) August 30, 2022 12:57
@millotp millotp merged commit ddd5fd3 into main Aug 30, 2022
@millotp millotp deleted the fix/cts-message branch August 30, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants