msbuild runner unable to exclude FxCop from specific project

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

msbuild runner unable to exclude FxCop from specific project

jabbera
Hello,

I saw the SonarQube presentation at build and I've been trying to get an environment going. I've ran into some issues I was hoping I could get help with.

Using: SonarQube 5.1, TFS 2013, Resharper plugin version: 1.0

We use specflow to do functional testing. It generates code that makes FxCop run "forever". A build that usually takes 10 minutes I killed after 3 hours. All of the additional time was spent running fx cop on the specflow test library. Traditionally we disable fxcop on these libraries. Enabling any of the CA rules within sonarqube seems to force it to be enabled for this project.

The C# plugin has a setting to kill fx cop after 10 minutes. This does not work in the msbuild runner it seems. I need a way to exclude this library from fxcop or kill fxcop after some amount of time. If I exclude the project from the build I lose the code coverage. I don't work on the team that manages the solution either so I can't get a new build configuration anyway. Excluding the project also means no code coverage which is a bummer.

Does anyone know a work-around for this issue?

Thanks!
Mike


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: msbuild runner unable to exclude FxCop from specific project

Dinesh Bolkensteyn-2
Hello Micheal,

You can set up 2 different quality profiles in SonarQube - one without FxCop rules, and another one with FxCop rules (which can even inherit from the other one, to keep them in sync).

Then, on your projects that use specflow, you can chose to use the quality profile without FxCop rules.

The easiest way to do that is to:

 1) Set the quality profile without FxCop rules as the default one
 2) Launch the analysis - they should be succesful
 3) You then can override the quality profile per project from the SonarQube project dashboard page

Let me know if this helps.


On Wed, May 13, 2015 at 5:16 PM, Michael Barry <[hidden email]> wrote:
Hello,

I saw the SonarQube presentation at build and I've been trying to get an environment going. I've ran into some issues I was hoping I could get help with.

Using: SonarQube 5.1, TFS 2013, Resharper plugin version: 1.0

We use specflow to do functional testing. It generates code that makes FxCop run "forever". A build that usually takes 10 minutes I killed after 3 hours. All of the additional time was spent running fx cop on the specflow test library. Traditionally we disable fxcop on these libraries. Enabling any of the CA rules within sonarqube seems to force it to be enabled for this project.

The C# plugin has a setting to kill fx cop after 10 minutes. This does not work in the msbuild runner it seems. I need a way to exclude this library from fxcop or kill fxcop after some amount of time. If I exclude the project from the build I lose the code coverage. I don't work on the team that manages the solution either so I can't get a new build configuration anyway. Excluding the project also means no code coverage which is a bummer.

Does anyone know a work-around for this issue?

Thanks!
Mike


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: msbuild runner unable to exclude FxCop from specific project

jabbera
The overload of the word project may be causing an issue as the visual studio project level I'm speaking of is probably the equivalent of a jar in Java. (I think)

Can I do this on a visual studio project by project basis? I can only seem to do this for a sonarqube project level which equates to an entire solution in tfs build. 

For this visual studio solution I want the fx cop rules to run on all visual studio projects but the specflow projects.

Thanks,
Mike

Sent from my iPhone.

On May 18, 2015, at 2:56 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

Hello Micheal,

You can set up 2 different quality profiles in SonarQube - one without FxCop rules, and another one with FxCop rules (which can even inherit from the other one, to keep them in sync).

Then, on your projects that use specflow, you can chose to use the quality profile without FxCop rules.

The easiest way to do that is to:

 1) Set the quality profile without FxCop rules as the default one
 2) Launch the analysis - they should be succesful
 3) You then can override the quality profile per project from the SonarQube project dashboard page

Let me know if this helps.


On Wed, May 13, 2015 at 5:16 PM, Michael Barry <[hidden email]> wrote:
Hello,

I saw the SonarQube presentation at build and I've been trying to get an environment going. I've ran into some issues I was hoping I could get help with.

Using: SonarQube 5.1, TFS 2013, Resharper plugin version: 1.0

We use specflow to do functional testing. It generates code that makes FxCop run "forever". A build that usually takes 10 minutes I killed after 3 hours. All of the additional time was spent running fx cop on the specflow test library. Traditionally we disable fxcop on these libraries. Enabling any of the CA rules within sonarqube seems to force it to be enabled for this project.

The C# plugin has a setting to kill fx cop after 10 minutes. This does not work in the msbuild runner it seems. I need a way to exclude this library from fxcop or kill fxcop after some amount of time. If I exclude the project from the build I lose the code coverage. I don't work on the team that manages the solution either so I can't get a new build configuration anyway. Excluding the project also means no code coverage which is a bummer.

Does anyone know a work-around for this issue?

Thanks!
Mike


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: msbuild runner unable to exclude FxCop from specific project

Dinesh Bolkensteyn-2
I was afraid that you'd say that.

Indeed you can only set/overload the quality profile on a per SonarQube project basis (which corresponds to a Visual Studio solution), and not at the module level (which corresponds to a Visual Studio project).
However, you can set up 2 different SonarQube analysis, one specific to the specflow project and another one for the rest. That would give you the ability to have different quality profiles.

The root cause seems to be a bug in FxCop - it should not be timing out on some particular constructs.
As a workaround, you might want to check if it is not just some set of FxCop rules that cause the issue.
AFAIK, there are 2 engines within FxCop, and I've heard that only a handful of rules are based on the 2nd engine.

It would be a hack if SonarQube allows the analysis to continue even if FxCop failed - you'll have the illusion that its rules are enabled in your quality profile, whereas none of its rules could actually be successfully evaluated.


On Mon, May 18, 2015 at 1:17 PM, Michael Barry <[hidden email]> wrote:
The overload of the word project may be causing an issue as the visual studio project level I'm speaking of is probably the equivalent of a jar in Java. (I think)

Can I do this on a visual studio project by project basis? I can only seem to do this for a sonarqube project level which equates to an entire solution in tfs build. 

For this visual studio solution I want the fx cop rules to run on all visual studio projects but the specflow projects.

Thanks,
Mike

Sent from my iPhone.

On May 18, 2015, at 2:56 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

Hello Micheal,

You can set up 2 different quality profiles in SonarQube - one without FxCop rules, and another one with FxCop rules (which can even inherit from the other one, to keep them in sync).

Then, on your projects that use specflow, you can chose to use the quality profile without FxCop rules.

The easiest way to do that is to:

 1) Set the quality profile without FxCop rules as the default one
 2) Launch the analysis - they should be succesful
 3) You then can override the quality profile per project from the SonarQube project dashboard page

Let me know if this helps.


On Wed, May 13, 2015 at 5:16 PM, Michael Barry <[hidden email]> wrote:
Hello,

I saw the SonarQube presentation at build and I've been trying to get an environment going. I've ran into some issues I was hoping I could get help with.

Using: SonarQube 5.1, TFS 2013, Resharper plugin version: 1.0

We use specflow to do functional testing. It generates code that makes FxCop run "forever". A build that usually takes 10 minutes I killed after 3 hours. All of the additional time was spent running fx cop on the specflow test library. Traditionally we disable fxcop on these libraries. Enabling any of the CA rules within sonarqube seems to force it to be enabled for this project.

The C# plugin has a setting to kill fx cop after 10 minutes. This does not work in the msbuild runner it seems. I need a way to exclude this library from fxcop or kill fxcop after some amount of time. If I exclude the project from the build I lose the code coverage. I don't work on the team that manages the solution either so I can't get a new build configuration anyway. Excluding the project also means no code coverage which is a bummer.

Does anyone know a work-around for this issue?

Thanks!
Mike


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: msbuild runner unable to exclude FxCop from specific project

jabbera
Ill try to come up with something. The irony of this whole situation is the results from fx cop aren't even imported into sonarqube since this is a test project. 

Sent from my iPhone.

On May 18, 2015, at 7:31 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

I was afraid that you'd say that.

Indeed you can only set/overload the quality profile on a per SonarQube project basis (which corresponds to a Visual Studio solution), and not at the module level (which corresponds to a Visual Studio project).
However, you can set up 2 different SonarQube analysis, one specific to the specflow project and another one for the rest. That would give you the ability to have different quality profiles.

The root cause seems to be a bug in FxCop - it should not be timing out on some particular constructs.
As a workaround, you might want to check if it is not just some set of FxCop rules that cause the issue.
AFAIK, there are 2 engines within FxCop, and I've heard that only a handful of rules are based on the 2nd engine.

It would be a hack if SonarQube allows the analysis to continue even if FxCop failed - you'll have the illusion that its rules are enabled in your quality profile, whereas none of its rules could actually be successfully evaluated.


On Mon, May 18, 2015 at 1:17 PM, Michael Barry <[hidden email]> wrote:
The overload of the word project may be causing an issue as the visual studio project level I'm speaking of is probably the equivalent of a jar in Java. (I think)

Can I do this on a visual studio project by project basis? I can only seem to do this for a sonarqube project level which equates to an entire solution in tfs build. 

For this visual studio solution I want the fx cop rules to run on all visual studio projects but the specflow projects.

Thanks,
Mike

Sent from my iPhone.

On May 18, 2015, at 2:56 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

Hello Micheal,

You can set up 2 different quality profiles in SonarQube - one without FxCop rules, and another one with FxCop rules (which can even inherit from the other one, to keep them in sync).

Then, on your projects that use specflow, you can chose to use the quality profile without FxCop rules.

The easiest way to do that is to:

 1) Set the quality profile without FxCop rules as the default one
 2) Launch the analysis - they should be succesful
 3) You then can override the quality profile per project from the SonarQube project dashboard page

Let me know if this helps.


On Wed, May 13, 2015 at 5:16 PM, Michael Barry <[hidden email]> wrote:
Hello,

I saw the SonarQube presentation at build and I've been trying to get an environment going. I've ran into some issues I was hoping I could get help with.

Using: SonarQube 5.1, TFS 2013, Resharper plugin version: 1.0

We use specflow to do functional testing. It generates code that makes FxCop run "forever". A build that usually takes 10 minutes I killed after 3 hours. All of the additional time was spent running fx cop on the specflow test library. Traditionally we disable fxcop on these libraries. Enabling any of the CA rules within sonarqube seems to force it to be enabled for this project.

The C# plugin has a setting to kill fx cop after 10 minutes. This does not work in the msbuild runner it seems. I need a way to exclude this library from fxcop or kill fxcop after some amount of time. If I exclude the project from the build I lose the code coverage. I don't work on the team that manages the solution either so I can't get a new build configuration anyway. Excluding the project also means no code coverage which is a bummer.

Does anyone know a work-around for this issue?

Thanks!
Mike


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: msbuild runner unable to exclude FxCop from specific project

Dinesh Bolkensteyn-2
Ah that's very good feedback indeed: We shouldn't bother to run FxCop on test projects.



On Mon, May 18, 2015 at 1:37 PM, Michael Barry <[hidden email]> wrote:
Ill try to come up with something. The irony of this whole situation is the results from fx cop aren't even imported into sonarqube since this is a test project. 

Sent from my iPhone.

On May 18, 2015, at 7:31 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

I was afraid that you'd say that.

Indeed you can only set/overload the quality profile on a per SonarQube project basis (which corresponds to a Visual Studio solution), and not at the module level (which corresponds to a Visual Studio project).
However, you can set up 2 different SonarQube analysis, one specific to the specflow project and another one for the rest. That would give you the ability to have different quality profiles.

The root cause seems to be a bug in FxCop - it should not be timing out on some particular constructs.
As a workaround, you might want to check if it is not just some set of FxCop rules that cause the issue.
AFAIK, there are 2 engines within FxCop, and I've heard that only a handful of rules are based on the 2nd engine.

It would be a hack if SonarQube allows the analysis to continue even if FxCop failed - you'll have the illusion that its rules are enabled in your quality profile, whereas none of its rules could actually be successfully evaluated.


On Mon, May 18, 2015 at 1:17 PM, Michael Barry <[hidden email]> wrote:
The overload of the word project may be causing an issue as the visual studio project level I'm speaking of is probably the equivalent of a jar in Java. (I think)

Can I do this on a visual studio project by project basis? I can only seem to do this for a sonarqube project level which equates to an entire solution in tfs build. 

For this visual studio solution I want the fx cop rules to run on all visual studio projects but the specflow projects.

Thanks,
Mike

Sent from my iPhone.

On May 18, 2015, at 2:56 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

Hello Micheal,

You can set up 2 different quality profiles in SonarQube - one without FxCop rules, and another one with FxCop rules (which can even inherit from the other one, to keep them in sync).

Then, on your projects that use specflow, you can chose to use the quality profile without FxCop rules.

The easiest way to do that is to:

 1) Set the quality profile without FxCop rules as the default one
 2) Launch the analysis - they should be succesful
 3) You then can override the quality profile per project from the SonarQube project dashboard page

Let me know if this helps.


On Wed, May 13, 2015 at 5:16 PM, Michael Barry <[hidden email]> wrote:
Hello,

I saw the SonarQube presentation at build and I've been trying to get an environment going. I've ran into some issues I was hoping I could get help with.

Using: SonarQube 5.1, TFS 2013, Resharper plugin version: 1.0

We use specflow to do functional testing. It generates code that makes FxCop run "forever". A build that usually takes 10 minutes I killed after 3 hours. All of the additional time was spent running fx cop on the specflow test library. Traditionally we disable fxcop on these libraries. Enabling any of the CA rules within sonarqube seems to force it to be enabled for this project.

The C# plugin has a setting to kill fx cop after 10 minutes. This does not work in the msbuild runner it seems. I need a way to exclude this library from fxcop or kill fxcop after some amount of time. If I exclude the project from the build I lose the code coverage. I don't work on the team that manages the solution either so I can't get a new build configuration anyway. Excluding the project also means no code coverage which is a bummer.

Does anyone know a work-around for this issue?

Thanks!
Mike


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





Reply | Threaded
Open this post in threaded view
|

RE: msbuild runner unable to exclude FxCop from specific project

jabbera

Fantastic. I’ve also submitted the following pull request that won’t change the fxcop setting if the SonarQubeExclude is set to true. This is a workaround for my issue, but should be included in general I belive.

 

https://github.com/SonarSource/sonar-msbuild-runner/pull/4

 

From: Dinesh Bolkensteyn [mailto:[hidden email]]
Sent: Monday, May 18, 2015 7:46 AM
To: [hidden email]
Subject: Re: [sonar-user] msbuild runner unable to exclude FxCop from specific project

 

Ah that's very good feedback indeed: We shouldn't bother to run FxCop on test projects.

 


 

On Mon, May 18, 2015 at 1:37 PM, Michael Barry <[hidden email]> wrote:

Ill try to come up with something. The irony of this whole situation is the results from fx cop aren't even imported into sonarqube since this is a test project. 

Sent from my iPhone.


On May 18, 2015, at 7:31 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

I was afraid that you'd say that.

 

Indeed you can only set/overload the quality profile on a per SonarQube project basis (which corresponds to a Visual Studio solution), and not at the module level (which corresponds to a Visual Studio project).

However, you can set up 2 different SonarQube analysis, one specific to the specflow project and another one for the rest. That would give you the ability to have different quality profiles.

 

The root cause seems to be a bug in FxCop - it should not be timing out on some particular constructs.

As a workaround, you might want to check if it is not just some set of FxCop rules that cause the issue.

AFAIK, there are 2 engines within FxCop, and I've heard that only a handful of rules are based on the 2nd engine.

 

It would be a hack if SonarQube allows the analysis to continue even if FxCop failed - you'll have the illusion that its rules are enabled in your quality profile, whereas none of its rules could actually be successfully evaluated.


 

On Mon, May 18, 2015 at 1:17 PM, Michael Barry <[hidden email]> wrote:

The overload of the word project may be causing an issue as the visual studio project level I'm speaking of is probably the equivalent of a jar in Java. (I think)

 

Can I do this on a visual studio project by project basis? I can only seem to do this for a sonarqube project level which equates to an entire solution in tfs build. 

 

For this visual studio solution I want the fx cop rules to run on all visual studio projects but the specflow projects.

 

Thanks,

Mike


Sent from my iPhone.


On May 18, 2015, at 2:56 AM, Dinesh Bolkensteyn <[hidden email]> wrote:

Hello Micheal,

 

You can set up 2 different quality profiles in SonarQube - one without FxCop rules, and another one with FxCop rules (which can even inherit from the other one, to keep them in sync).

 

Then, on your projects that use specflow, you can chose to use the quality profile without FxCop rules.

 

The easiest way to do that is to:

 

 1) Set the quality profile without FxCop rules as the default one

 2) Launch the analysis - they should be succesful

 3) You then can override the quality profile per project from the SonarQube project dashboard page

 

Let me know if this helps.


 

On Wed, May 13, 2015 at 5:16 PM, Michael Barry <[hidden email]> wrote:

Hello,

I saw the SonarQube presentation at build and I've been trying to get an environment going. I've ran into some issues I was hoping I could get help with.

Using: SonarQube 5.1, TFS 2013, Resharper plugin version: 1.0

We use specflow to do functional testing. It generates code that makes FxCop run "forever". A build that usually takes 10 minutes I killed after 3 hours. All of the additional time was spent running fx cop on the specflow test library. Traditionally we disable fxcop on these libraries. Enabling any of the CA rules within sonarqube seems to force it to be enabled for this project.

The C# plugin has a setting to kill fx cop after 10 minutes. This does not work in the msbuild runner it seems. I need a way to exclude this library from fxcop or kill fxcop after some amount of time. If I exclude the project from the build I lose the code coverage. I don't work on the team that manages the solution either so I can't get a new build configuration anyway. Excluding the project also means no code coverage which is a bummer.

Does anyone know a work-around for this issue?

Thanks!
Mike


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email