Skip to content

Feature - Make output directory configurable #136

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

Closed
BOnstwedder opened this issue May 12, 2021 · 9 comments
Closed

Feature - Make output directory configurable #136

BOnstwedder opened this issue May 12, 2021 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@BOnstwedder
Copy link

Current behavior

Fine Code Coverage outputs its coverage files in a directory near TestDllFile's location.
This is not configurable at this moment

Expected behavior

Fine Code Coverage outputs to a configurable directory

@tonyhallett
Copy link
Collaborator

Implementation available here for testing. Not yet released.

Add the AllProjectsCoverageOutputFolder property to any of the test project proj files.

  <PropertyGroup>
    <AllProjectsCoverageOutputFolder>../CoverageOutput</AllProjectsCoverageOutputFolder>
  </PropertyGroup>

Path can be absolute or relative but do not use msbuild properties to construct the path.

@BOnstwedder
Copy link
Author

BOnstwedder commented May 17, 2021

This configuration option seems to work.

However I do have a question regarding the fine-code-coverage/build-output directories.
Is it absolutely necessary for fine code coverage to not use the projects build output directory?
Some of out unit tests are integration tests and fail to run properly when they run from a different directory.

Last I was wondering if it were possible to set the target for opencover, as it would be nice to set this to our locally installed nunit3console exe

@tonyhallett
Copy link
Collaborator

tonyhallett commented May 17, 2021

@BOnstwedder

This configuration option seems to work.

We decided to change the method for configuring this output directory. It did not feel correct for a project to identify the directory that applies for all test projects. So this has been replaced with.

Both of the methods below look for a directory containing a .sln file in an ascendant directory of the directory containing the
first test project file. If such a solution directory is found then the logic applies.
If the solution directory has a sub directory fcc-output then it will automatically be used.
Alternatively, if you supply FCCSolutionOutputDirectoryName in options the directory will be created if necessary and used.

I was wondering if it were possible to set the target for opencover, as it would be nice to set this to our locally installed nunit3console exe

This is doable for sure. An additional vs option to the exe file that you could also set on a project basis if desired.

Is it absolutely necessary for fine code coverage to not use the projects build output directory?
Some of out unit tests are integration tests and fail to run properly when they run from a different directory.

I am sure there was a good reason for doing so but off the top of my head I cannot remember what it was. Perhaps @FortuneN can help on that.

@tonyhallett
Copy link
Collaborator

Latest vsix that will be released to marketplace shortly.

@tonyhallett
Copy link
Collaborator

it would be nice to set this to our locally installed nunit3console exe

Would you be looking to add additional nunit console options ?

Some of out unit tests are integration tests and fail to run properly when they run from a different directory.

If you could tell us why they don't work then perhaps we could help ?

@BOnstwedder
Copy link
Author

BOnstwedder commented May 18, 2021

Would you be looking to add additional nunit console options ?

For now just setting the target testing framwork for opencover would be enough. This is the target parameter for the opencover command.

If you could tell us why they don't work then perhaps we could help ?

These tests make use of external files not part of the solution. For instance a directory filled with a testing database, configuration files etc.
Some of the older unit tests look for these files and since the output of FineCodeCoverage is at least 2 directories deep in a different location it fails to locate these files. Copying the files necessary to run these unit tests would not be optimal for us.

@tonyhallett
Copy link
Collaborator

Could we provide an NUnit Console test parameter that you could use to adjust your paths ?

@tonyhallett
Copy link
Collaborator

I think the reason we copied the build output was due to file locking issues

@tonyhallett
Copy link
Collaborator

The latest version has an option AdjacentBuildOutput that should keep relative paths in tests working.

I will open a new issue with regards to changing the target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants