Where is the log for the current build located?
I want to do this findstr "Failed to discover tests from assembly" C:\path-to-log-file\console.log
Write-Output $LASTEXITCODE
stop the build.
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
Support Staff 1 Posted by Feodor Fitsner on 20 Feb, 2020 07:13 PM
There should be a simpler solution to determine if your tests failed. Could you share your appveyor.yml?
2 Posted by rafae11 on 20 Feb, 2020 07:24 PM
at the moment i'm capturing the console log and finding if the string exists in the file.
version: 1.0.{build}
before_build:
- ps: "nuget config -set repositoryPath=C:\\projects\\example-csharp-master\\packages -configfile C:\\projects\\example-csharp-master\\nuget.config\nnuget restore \nchoco install opencover.portable\nchoco install codecov"
build:
project: CodecovProject.sln
verbosity: minimal
test_script:
- ps: >-
$env:PATH += ";C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\TestPlatform\"
$Path = "vstest.console.exe"
$Param1 = "/logger:Appveyor"
$Param2 = "C:\projects\example-csharp-master\MyUnitTests\bin\Debug\MyUnitTests.dll"
$List = -join($Path," ",$Param1," ",$Param2)
Write-Host "Test Started"
$out = Invoke-Command -ScriptBlock {cmd /c $List}
$out | out-file -filepath C:\projects\example-csharp-master\out.txt
Write-Host "Test Completed"
findstr "Failed to discover tests from assembly" "C:\projects\example-csharp-master\out.txt"
if( $LASTEXITCODE -eq 0)
{
Write-Output "Failed to discover tests from assembly"
$LASTEXITCODE = 1
Write-Output $LASTEXITCODE
$host.SetShouldExit($LastExitCode)
}
ElseIf( $LASTEXITCODE -eq 1)
{
Write-Output "Tests Completed"
$LASTEXITCODE = 0
Write-Output $LASTEXITCODE
}
On Thursday, February 20, 2020, 11:13:09 AM PST, Feodor Fitsner <[email blocked]> wrote:
#yiv5515179617 pre {width:92%;margin:10px 2%;padding:5px 2%;background:#efefef;border:1px solid #d6d6d6;}#yiv5515179617 blockquote {margin-left:0;padding-left:1em;border-left:5px solid #ccc;}
|
Support Staff 3 Posted by Feodor Fitsner on 20 Feb, 2020 07:31 PM
Why not just having something like:
4 Posted by rafae11 on 20 Feb, 2020 07:36 PM
Thanks will try that, i'm a newbie.
On Thursday, 20 February 2020, 11:31:13 GMT-8, Feodor Fitsner <[email blocked]> wrote:
#yiv0728775002 pre {width:92%;margin:10px 2%;padding:5px 2%;background:#efefef;border:1px solid #d6d6d6;}#yiv0728775002 blockquote {margin-left:0;padding-left:1em;border-left:5px solid #ccc;}
|
5 Posted by rafae11 on 20 Feb, 2020 07:57 PM
We have had instances where the test are not run, which shows in the log file but does not return any error message. How do you deal with that scenario?
On Thursday, February 20, 2020, 11:36:03 AM PST, rafael gonzalez <[email blocked]> wrote:
Thanks will try that, i'm a newbie.
On Thursday, 20 February 2020, 11:31:13 GMT-8, Feodor Fitsner <[email blocked]> wrote:
#yiv3705751097 pre {width:92%;margin:10px 2%;padding:5px 2%;background:#efefef;border:1px solid #d6d6d6;}#yiv3705751097 blockquote {margin-left:0;padding-left:1em;border-left:5px solid #ccc;}
|
Support Staff 6 Posted by Feodor Fitsner on 20 Feb, 2020 07:59 PM
Could you elaborate please? ...or maybe link to a build would help if it's not a private project.
Feodor Fitsner closed this discussion on 21 Apr, 2020 09:03 PM.