Integrate Spectral into Azure Devops Pipeline #2296
-
Hello. I am trying to run Spectral through an Azure Devops pipeline. When I run the pipeline in devops I get a message on the "Publish Test Results" step that says "No Result Found to Publish 'D:\a\1\s\LoadShare\test-results\spectral-results.xml'. Is this something someone could help me with? This is a snippet of the pipeline.yaml file: `- stage: team_deployment
` When I run spectral through command prompt on my local machine it works fine and writes the results to an output file. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
O.k. I made some progress on this. With my original .custom2.yaml file (ruleset) Spectral was only returning warnings. The warnings were not written to the .xml file in the junit format. So I would get the "No result found to publish" error message in the pipeline. However, after I added some more rules to the .custom2.yaml file the new rules returned error messages. These errors were written to the spectral-results.xml file. Then the pipeline published and displayed results. So the problem I have now is how do I get Spectral warnings to display in the test results as well? For example, there is a Spectral rule in my custom file that say "paths should be plural". The rule returns severity "warn". So it is not being written in junit format to the spectral-results.xml file. So the pipeline is not displaying it. |
Beta Was this translation helpful? Give feedback.
O.k. I made some progress on this. With my original .custom2.yaml file (ruleset) Spectral was only returning warnings. The warnings were not written to the .xml file in the junit format. So I would get the "No result found to publish" error message in the pipeline.
However, after I added some more rules to the .custom2.yaml file the new rules returned error messages. These errors were written to the spectral-results.xml file. Then the pipeline published and displayed results.
So the problem I have now is how do I get Spectral warnings to display in the test results as well? For example, there is a Spectral rule in my custom file that say "paths should be plural". The rule returns severit…