@@ -82,41 +82,32 @@ function Use-ExampleImplementation {
8282 }
8383}
8484
85- function Test-ExerciseImplementation ($Exercise , $BuildDir , $ConceptExercisesDir , $PracticeExercisesDir , $IsCI ) {
85+ function Test-ExerciseImplementation ($Exercise , $BuildDir , $ConceptExercisesDir , $PracticeExercisesDir ) {
8686 Write-Output " Running tests"
8787
8888 if (-Not $Exercise ) {
89- Invoke-Tests - Path $BuildDir - IsCI $IsCI
89+ Invoke-Tests - Path $BuildDir
9090 }
9191 elseif (Test-Path " ${ConceptExercisesDir} /${Exercise} " ) {
92- Invoke-Tests - Path " ${ConceptExercisesDir} /${Exercise} " - IsCI $IsCI
92+ Invoke-Tests - Path " ${ConceptExercisesDir} /${Exercise} "
9393 }
9494 elseif (Test-Path " ${PracticeExercisesDir} /${Exercise} " ) {
95- Invoke-Tests - Path " ${PracticeExercisesDir} /${Exercise} " - IsCI $IsCI
95+ Invoke-Tests - Path " ${PracticeExercisesDir} /${Exercise} "
9696 }
9797 else {
9898 throw " Could not find exercise '${Exercise} '"
9999 }
100100}
101101
102- function Invoke-Tests ($Path , $IsCI ) {
103- if ($IsCI ) {
104- Get-ChildItem - Path $Path - Include " *.csproj" - Recurse | ForEach-Object {
105- & dotnet add $_.FullName package JunitXml.TestLogger - v 4.1 .0
106- }
107- & dotnet test $Path -- logger " junit;LogFilePath=results/test.xml"
108- }
109- else {
110- & dotnet test $Path
111- }
102+ function Invoke-Tests ($Path ) {
103+ & dotnet test $Path
112104}
113105
114106
115107$buildDir = " ${PSScriptRoot} /build"
116108$practiceExercisesDir = " ${buildDir} /practice"
117109$conceptExercisesDir = " ${buildDir} /concept"
118110$sourceDir = Resolve-Path " exercises"
119- $isCi = [System.Convert ]::ToBoolean($env: CI )
120111
121112Clean $buildDir
122113Copy-Exercise $sourceDir $buildDir
@@ -128,4 +119,4 @@ if (!$Exercise) {
128119}
129120
130121Use-ExampleImplementation $conceptExercisesDir $practiceExercisesDir
131- Test-ExerciseImplementation - Exercise $Exercise - BuildDir $buildDir - ConceptExercisesDir $conceptExercisesDir - PracticeExercisesDir $practiceExercisesDir - IsCI $isCi
122+ Test-ExerciseImplementation - Exercise $Exercise - BuildDir $buildDir - ConceptExercisesDir $conceptExercisesDir - PracticeExercisesDir $practiceExercisesDir
0 commit comments