Support for StyleCop Report
Hello,
I am trying to run StyleCop as part of my build process, and I would like to see the report in the build results.
I have tried to do this, but I am running into an issue. My results file doesn't seem to be there where I expect it to be. It is almost as though StyleCop isn't being executed. The only reason that this wouldn't happen is if the nuget package for StyleCop.Msbuild wasn't available. And I think that this is at the heart of the matter.
In each build that I have executed since I started trying to do this, I am getting the following output when I try to do a nuget package restore:
All packages listed in packages.config are already installed.
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/0....
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/0....
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/0....
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/0....
When I would expect to get:
Running NugetPackageRestore...
Installing 'StyleCop.MSBuild 4.7.49.0'.
Successfully installed 'StyleCop.MSBuild 4.7.49.0'.
All packages listed in packages.config are already installed.
Which is what I get if I run the build locally, but first delete the StyleCop.Msbuild folder from the packages folder. The reason that I started looking at this as the potential problem is that I am using build_cache, and I wondered if that might be an issue.
Also, what support is there for transforming the XML file from the report file into something that can be easily read in the results window?
Thanks
Gary
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by gep13 on 22 Sep, 2014 12:45 PM
To rule out the build cache, I have just pushed a change to the appveyor.yml file to remove it, and I can see the nuget packages getting restored:
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/1....
Here there are:
As you can see, StyleCop.MsBuild is not on the list of packages that were installed, even though it is part of the packages.config file that I am checking in.
I have just done:
On my local machine, and these are the contents of the packages.config file:
2 Posted by gep13 on 22 Sep, 2014 12:46 PM
Sorry, that submitted before I was finished...
Do you have any ideas as to why the StyleCop.MsBuild package isn't getting installed? I have just noticed the developmentDependency flag, but my understanding of that is that it only gets inspected during
nuget pack
notnuget restore
Any ideas?
Thanks
Gary
3 Posted by gep13 on 23 Sep, 2014 06:51 AM
Hello Feodor,
I am really starting to think that there is something not quite right with the Pull Request mechanism in AppVeyor, or the way that I am doing things.
I have just merged the above work into the develop branch, and straight away, where the StyleCop.MsBuild package was not getting installed, now it is:
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/1....
Do you have any ideas about what could be going on here.
This is the second time that code, while in a Pull Request branch, wasn't working correctly, but as soon as I pull it into the main branch, it works exactly as expected.
Thanks
Gary
4 Posted by gep13 on 23 Sep, 2014 09:06 PM
Ok, as discussed on GitHub, I don't think this issue is anything to do with AppVeyor, but rather GitVersion, so don't think there is anything else to worry about on that score.
However, I would still like to know how I can submit other result xml files to AppVeyor for display in the build report.
The two main tests are StyleCop and also Code Analysis (FxCop). How can I go about including these test results? I am assuming that this would be something that would have to be done on your end?
Thanks
Gary
Support Staff 5 Posted by Feodor Fitsner on 23 Sep, 2014 09:25 PM
Wow, amazing findings! I've been sure GitVersion works in kind of "read-only" mode. Interesting indeed.
For pushing test results into AppVeyor there are two ways right now:
Though I think other parsers could be easily added. Send me their sample XML output.
6 Posted by gep13 on 24 Sep, 2014 11:52 AM
Sure, no probs. Here are some sample reports, both for StyleCop and FxCop, for when there are errors, and when there are none.
In the mean time, I will take a look at the REST API.
However, I do think that this is something that would benefit multiple people, and a common usage, so direct support from a parser in AppVeyor would be a great addition :-)
Thanks!
7 Posted by gep13 on 07 Oct, 2014 12:19 PM
Feodor,
How do this look to you?
https://ci.appveyor.com/project/GaryEwanPark/chocolateygui/build/0....
I have added a very simple parsing routine to my psake script to inspect the violations within the generated StyleCop Report:
Gary
8 Posted by gep13 on 07 Oct, 2014 12:20 PM
Next up, Code Analysis Results file...
Support Staff 9 Posted by Feodor Fitsner on 07 Oct, 2014 06:38 PM
Looks cool! I'm moving this thread to KB.
10 Posted by gep13 on 08 Oct, 2014 09:25 PM
Sounds good to me.
Should I close this discussion, or leave it open?
Support Staff 11 Posted by Feodor Fitsner on 08 Oct, 2014 09:34 PM
Leave it open.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:49 AM.