Skip to content

Commit cbff9b1

Browse files
committed
ci(appveyor): update test_script
1 parent a27e2d4 commit cbff9b1

File tree

1 file changed

+54
-46
lines changed

1 file changed

+54
-46
lines changed

appveyor.yml

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -164,82 +164,90 @@ test_script:
164164
165165
New-Item -path . -name coverage -itemtype directory
166166
167-
ForEach ($folder in (Get-ChildItem -Path C:\\projects\\dotnet-standard-sdk\\test -Directory))
167+
$testDirectories = "IBM.Watson.Assistant.v1", "IBM.Watson.Assistant.v2", "IBM.Watson.CompareComply.v1", "IBM.Watson.Discovery.v1",
168+
"IBM.Watson.Discovery.v2", "IBM.Watson.LanguageTranslator.v3", "IBM.Watson.NaturalLanguageClassifier.v1",
169+
"IBM.Watson.NaturalLanguageUnderstanding.v1", "IBM.Watson.PersonalityInsights.v3", "IBM.Watson.SpeechToText.v1",
170+
"IBM.Watson.TextToSpeech.v1", "IBM.Watson.ToneAnalyzer.v3", "IBM.Watson.ToneAnalyzer.v3", "IBM.Watson.VisualRecognition.v4"
168171
169-
{
172+
ForEach ($serviceDirectory in $testDirectories)
173+
{
174+
ForEach ($folder in (Get-ChildItem -Path C:\\projects\\dotnet-standard-sdk\\src\\$serviceDirectory\\Test -Directory))
170175
171-
if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
176+
{
172177
173-
{
178+
if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
174179
175-
Write-Output \"No pull request number. Executing tests\"
180+
{
176181
177-
# dotnet test $folder.FullName
182+
Write-Output \"No pull request number. Executing tests\"
178183
179-
# if($LastExitCode -ne 0)
184+
# dotnet test $serviceDirectory $folder.FullName
180185
181-
# {
186+
# if($LastExitCode -ne 0)
182187
183-
# $host.SetShouldExit($LastExitCode )
188+
# {
184189
185-
# }
190+
# $host.SetShouldExit($LastExitCode )
186191
187-
echo \"Test passed: $?\"
192+
# }
188193
189-
echo \"LastExitCode: $LastExitCode\"
194+
echo \"Test passed: $?\"
190195
191-
$openCover = 'C:\\projects\\dotnet-standard-sdk\\packages\\OpenCover.4.7.922\\tools\\OpenCover.Console.exe'
192-
193-
$targetArgs = '-targetargs: test ' + $folder.FullName + ' -c Release -f netcoreapp2.0'
194-
195-
$filter = '-filter:+[IBM.Watson*]*-[*Tests*]*-[*Example*]*'
196-
197-
& $openCover '-target:C:\\Program Files\\dotnet\\dotnet.exe' $targetArgs '-register:user' $filter '-oldStyle' '-mergeoutput' '-hideskipped:File' '-searchdirs:$testdir\\bin\\release\\netcoreapp2.0' '-output:coverage\\coverage.xml'
196+
echo \"LastExitCode: $LastExitCode\"
198197
199-
if($env:COVERALLS_REPO_TOKEN)
200-
201-
{
202-
203-
C:\projects\dotnet-standard-sdk\packages\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe --opencover -i coverage\coverage.xml --useRelativePaths
204-
205-
}
206-
207-
else
198+
$openCover = 'C:\\projects\\dotnet-standard-sdk\\packages\\OpenCover.4.7.922\\tools\\OpenCover.Console.exe'
199+
200+
$targetArgs = '-targetargs: test ' + $folder.FullName + ' -c Release -f netcoreapp2.0'
201+
202+
$filter = '-filter:+[IBM.Watson*]*-[*Tests*]*-[*Example*]*'
203+
204+
& $openCover '-target:C:\\Program Files\\dotnet\\dotnet.exe' $targetArgs '-register:user' $filter '-oldStyle' '-mergeoutput' '-hideskipped:File' '-searchdirs:$testdir\\bin\\release\\netcoreapp2.0' '-output:coverage\\coverage.xml'
208205
209-
{
206+
if($env:COVERALLS_REPO_TOKEN)
207+
208+
{
209+
210+
C:\projects\dotnet-standard-sdk\packages\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe --opencover -i coverage\coverage.xml --useRelativePaths
211+
212+
}
213+
214+
else
210215
211-
Write-Output \"There is no Coveralls Repo Token - not pushing coverage.\"
216+
{
212217
213-
}
214-
}
218+
Write-Output \"There is no Coveralls Repo Token - not pushing coverage.\"
215219
216-
else
220+
}
221+
}
217222
218-
{
219-
Write-Output \"Pull request number is $env:APPVEYOR_PULL_REQUEST_NUMBER. Skipping integration tests.\"
223+
else
220224
221-
if($folder.FullName.EndsWith("UnitTests"))
225+
{
226+
Write-Output \"Pull request number is $env:APPVEYOR_PULL_REQUEST_NUMBER. Skipping integration tests.\"
222227
223-
{
228+
if($folder.FullName.EndsWith("Unit"))
224229
225-
dotnet test $folder.FullName
230+
{
226231
227-
if($LastExitCode -ne 0)
232+
dotnet test $folder.FullName
228233
229-
{
234+
if($LastExitCode -ne 0)
230235
231-
$host.SetShouldExit($LastExitCode )
236+
{
232237
233-
}
238+
$host.SetShouldExit($LastExitCode )
234239
235-
echo \"Test passed: $?\"
240+
}
236241
237-
echo \"LastExitCode: $LastExitCode\"
242+
echo \"Test passed: $?\"
238243
239-
}
244+
echo \"LastExitCode: $LastExitCode\"
240245
241-
}
246+
}
242247
248+
}
249+
250+
}
243251
}
244252
245253
If($branchName -eq "master" -and $env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)

0 commit comments

Comments
 (0)