znsio / specmatic

Turn your contracts into executable specifications. Contract Driven Development - Collaboratively Design & Independently Deploy MicroServices & MicroFrontends.
https://specmatic.in
MIT License
250 stars 51 forks source link

Log error when invalid contract paths are selected by user #1140

Open yogeshnikam671 opened 3 weeks ago

yogeshnikam671 commented 3 weeks ago

What: If we run the test against a folder (i.e. not a valid contract file path), we get following log messages -

Endpoints API not found, cannot calculate actual coverage

Could not load report configuration, coverage will be calculated but no coverage threshold will be enforced
The Open API coverage report generated is blank.
This can happen if you have included all the endpoints in the 'excludedEndpoints' array in the report section in specmatic.json, or if your open api specification does not have any paths documented.

It does not mention that it is failing because a file with valid extension was not selected.

With this change, we will get additional error message as follows -

Endpoints API not found, cannot calculate actual coverage

Could not load report configuration, coverage will be calculated but no coverage threshold will be enforced
The Open API coverage report generated is blank.
This can happen if you have included all the endpoints in the 'excludedEndpoints' array in the report section in specmatic.json, or if your open api specification does not have any paths documented.

No valid specification file found at given paths : /Users/yogeshanandanikam/personal_projects/specmatic-intellij-plugin

Why: Better user experience.

How: Logs a message when the contract paths are not empty but none of them is valid.

Checklist: