NCrunch can't find relative file path - ncrunch

My app.config has a reference to a master.config.
When NCrunch runs the tests it can't locate the master.config file as they run from a different directory; as such the test window always shows red and somewhat defeats the purpose of NCrunch.
How can I fix this?

Edit the NCrunch configuration for the project and include the master.config within the "Additional files to include" option.

Related

Where is Test folder in IntelliJ

I'm sorry for such a question but I'm new to IntelliJ (and Gradle, that is used in the project I'm working on), but where exactly is the Test folder located ?
When I display the 'Project structure' window, here's what I can see :
But what I can really see in the project tree is the following :
In fact, I don't understand what I see. Do the Test folders exist ?
Can someone tell me how to add a Test folder from the 'Project structure' window and how to say Gradle where test classes are located ?
Thx
Do the Test folders exist ?
No it does not exist on your disk. See the "red" highlighting of the core/src/test directory in the project structure on your 1st screenshot.
You can create it from Project tool window. In fact IDE will automatically propose you the directories that you can create according to the Gradle source sets configuration of your project:
See also https://intellij-support.jetbrains.com/hc/en-us/community/posts/206806425/comments/360001477800

How to specify folder to run .net core tests in AzureDevOps?

Q: How to run test for only csproj under certain top-level folder in AzureDevOps?
I have tried every version of this setup I can think of but I just canĀ“t get the test task in AzureDevOps to just find and run/test the projects found in a particular folder.
When this runs it tries to run test on every .csproj in the solution and not just under the Working Directory.
what am I doing wrong?
just use *. csproj? that should only look in the current folder.

MSBuild not placing files where requested

So coming across a very strange issue with MSbuild using TFS 2015 build definition.
The web application I am trying to build has multiple csprojs that are used as class libraries throughout the application and of course my actual web application.
Bellow are the MSBuild arguments I am passing through currently to get a fully completed build.
/p:UseWPP_CopyWebApplication=True
/p:PipelineDependsOnBuild=False /p:OutDir=C:\Agent\_work\1\s\Application\Package\bin\
/p:WebProjectOutputDir=C:\Agent\_work\1\s\Application\Package\WebSite\
/p:NoWarn=0067
/v:Minimal
What I would actually like to do is the following.
/p:UseWPP_CopyWebApplication=True
/p:PipelineDependsOnBuild=False /p:OutDir=C:\Agent\_work\1\s\Application\Package\Website\bin\
/p:WebProjectOutputDir=C:\Agent\_work\1\s\Application\Package\WebSite\
/p:NoWarn=0067
/v:Minimal
The issue I run in to is after the first assemblies are run and placed in the bin folder it then works on the main webproject csproj and throws a unable to locate file for copy message.
I don't understand why this would be the case? Is it because MSBuild is expecting the bin folder to be empty/not there?
Am I missing something in the build order or different Argument needs to be passed. I have also to tried 'outpath' as well.
In the second arguments, the "OutDir" path is the same with "WebProjectOutputDir". This cause the issue since MSBuild will clean the "WebProjectOutputDir" folder before run "_WPPCopyWebApplication" task which copies files to "WebProjectOutputDir" folder. That means the files generated in "OutDir" during the build will be cleaned because it use the same path with "WebProjectOutputDir", so the task will cannot locate the files to copy.
To avoid this issue, you'd either change the "OutDir" different with "WebProjectOutputDir" or add one more arguments:
/p:CleanWebProjectOutputDir=False

NCrunch test fails with FileNotFoundException

My test requires an NHibernate configuration file. The file is added through NCrunch configuration:
But the test still fails with:
System.IO.FileNotFoundException: NHibernate configuration file not found.
File name: 'C:\Users\XXXX\AppData\Local\NCrunch\9176\20\_ncrunchreferences.
Is there any way to force files being added to _ncrunchreferences folder?
Fixed the issue with a help of Copy Referenced Assemblies To Workspace option. Might need to clean NCrunch cache for this to take effect.
Other options to the problem would possibly be using a pre-build event to copy needed resources over (Run pre-build events option has to be enabled in NCrunch project configuration).

"Duplicate class found" - IntelliJ and .class files

I recently imported one of our company's project into IntelliJ Idea (10.5.1). We build and run the project using an ant build script and IntelliJ supports that just fine.
However, IntelliJ seems to have a distinct problem when the compile output directory equals the source code directory, ie .class files are placed in the same directories as their corresponding .java sources.
(Note that I am aware that is not a proper way to go, but tell my boss that. This project is over 15 years old and correspondingly large, too many things depend on it to be this way, there is nothing I can do about that.)
So once things are compiled, IntelliJ detects the .class files and adds them to the project tree. The problem here is that it considers them class declarations, thus I get a "duplicate class found" message for each and every class. This doesn't make me unable to work, but it is extremely annoying as you may guess.
I tried making the IDE ignore .class files, but apparently that makes it not load any classes at all, including the JRE runtime and anything else located inside of .jar files.
Is there any way to make IntelliJ Idea ignore .class files which are in the same location as their .java sources?
Make sure that you've configured the output directory to the source directory, disable the Exclude of the output directory to see your files.
I coped with this same problem when cloning a project from Bitbucket. To solve it in IntelliJ:
Project Structure > Modules > Source > Source folder > <<"Eliminate the unwanted source folder">>
In my case, I had non-implemented classes in one source folder and a second source folder with the implemented classes (same class names).
I deleted one, built again, and the problem got solved.
Give it a try!