Test didn't builds by MSBuild

I have Behavior Tests solution. It contains Web.Driver.EDI.Tests Project. I need to run "Sending EDI Documents" feature. But when I try to run this test, I see the error: 

Cannot find path 'C:\BuildAgent\work\5753d45d4f74887e\BehaviourTests\Production\WebDriverTests.EDI.Tests\
[16:49:13][Step 1/2] bin\Debug\appSettings.config' because it does not exist.
 
I checked this folder and there were no files. It seems like solution wasn't built by MSBuild on this Agent. Can you help me to solve this problem?
Settings for feature:
VCS checkout mode: Prefer to checkout files on agent (recommended)
Checkout directory: default
Delete all files in the checkout directory before the build: OFF
Attached VCS roots:
VCS Root Checkout Rules
(svn) svn belongs to <Root project> 
Commit hook is inactive  
Latest check for changes: 17:00 (starting build or build chain) 
Changes checking interval: 30m
+:BehaviourTests
-:BehaviourTests/Certs
-:BehaviourTests/Production
+:BehaviourTests/Production/WebDriverTests.EDI.Tests
-:BehaviourTests/Taxcom.Behaviour.Tests
-:BehaviourTests/UnitTests
SharedBinaries/Selenium.IEDriverServer
Show changes from snapshot dependencies: ON
Exclude default branch changes: OFF
Build default branch: ON

Build Steps (2) edit »

Step 1: Update appSettings.config
Runner type: PowerShell (PowerShell runner)
Execute:  If all previous steps finished successfully
PowerShell run mode: Any version bitness: x86 edition: Desktop
Treat error output as: warning
Working directory: same as checkout directory
Custom script: view script content
Add -NoProfile argument: Yes
Additional command line arguments:
Step 2: Running tests
Runner type: Visual Studio Tests (Visual Studio Tests runner)
Execute:  If all previous steps finished successfully
Included assemblies: View Assemblies
Excluded assemblies: <empty>
Run settings file: BehaviourTests/WebDriverTests.testsettings
Additional commandline parameters: /category:"EDI_SendingEDIDocuments"
MSTest version: MSTest 2012
MSTest metadata: none specified
Testlist from metadata to run: <empty>
Test: <empty>
Unique: OFF
Results file: none specified
.NET Code Coverage: disabled
 
 
Settings for project:
VCS checkout mode: Prefer to checkout files on agent (recommended)
Checkout directory: default
Delete all files in the checkout directory before the build: OFF
Attached VCS roots:
VCS Root Checkout Rules
(svn) svn belongs to <Root project> 
Commit hook is inactive  
Latest check for changes: 17:00 (starting build or build chain) 
Changes checking interval: 30m
SharedBinaries
SharedSource
Builds
BehaviourTests
Show changes from snapshot dependencies: ON
Exclude default branch changes: OFF
Build default branch: ON

Build Steps (2) edit »

Step 1: NuGet Installer
Runner type: NuGet Installer (Installs and updates missing NuGet packages)
Execute:  Only if build status is successful
Path to NuGet.exe:
Package Sources: Use nuget default package source
Path to .sln: BehaviourTests\BehaviourTests.sln
Exclude Version: OFF
Restore Mode: Restore packages (requires NuGet 2.7+)
Use local machine packages cache: YES
Restore / install command custom command line:
Update packages: OFF
Update mode: Update via solution file
Use safe packages update: OFF
Include PreRelease packages: OFF
Update command custom command line:
Step 2: Build
Runner type: Visual Studio (sln) (Microsoft Visual Studio solution (.sln) runner)
Execute:  If all previous steps finished successfully
Solution file path: Builds/TeamCity/build.proj
Working directory: same as checkout directory
Visual Studio: Microsoft Visual Studio 2012
Targets: Build
Configuration: Debug
Platform: default
Command line parameters: /p:SolutionFile=..\..\BehaviourTests\BehaviourTests.sln
Run OctoPack: not specified
OctoPack package version: not specified



0
1 comment

Hi,

thanks for the descriptions, although the mess of text I'm afraid doesn't really show what's going on.

If I'm not mistaken, the second build you have posted should be building the solution, while the first one should be running some tests *after* the other has built the solution, is this correct? Are they related through a snapshot dependency, with the "Run on same agent" option selected?

While this is a requirement for the solution to work, without knowing your exact set up it would be hard to point out:
-Critically, you have set up the folder where you are looking for content as a + rule on a checkout rule of the VCS configuration. That means, that teamcity will very likely overwrite whatever is in that file with the contents of the VCS Root for that folder. Even if the build ran on that agent, it's very likely that the VCS data overwrote whatever was there. The only option for that to not be the case, is that you commit the changes of your "build", including binaries into VCS (which is usually a pretty bad thing to do).
-You are running the tests (I assume they're the tests) as a powershell script. We don't know the contents of the script and thus you might be yourself doing something with the files.

Taking into account that you are using a manual script to run the tests (or running a script before running the tests) that has a hardcoded relative path to a binary, it would make sense to combine both configurations into a single one, simply add the steps from your testing configuration at the end of the other one. Else, instead of downloading more stuff from the VCS, you should publish the files as artifacts in the "build" build, then pick them up through artifact dependencies for your "test" build.

0

Please sign in to leave a comment.