Skip to content

Commit 3c4453d

Browse files
committed
Revert "Define TEST constant when running tests"
This reverts commit 75a7175. We are reverting this in favor of using a runtime condition set by the test itself because this was fragile (for one, it did not work with OmniSharp running tests).
1 parent 361b29e commit 3c4453d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

PowerShellEditorServices.Common.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/PowerShell/PowerShellEditorServices</RepositoryUrl>
1313
<DebugType>portable</DebugType>
14-
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
1514
</PropertyGroup>
1615
</Project>

PowerShellEditorServices.build.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,20 +259,20 @@ task TestServer TestServerWinPS,TestServerPS7,TestServerPS72
259259

260260
task TestServerWinPS -If (-not $script:IsNix) {
261261
Set-Location .\test\PowerShellEditorServices.Test\
262-
exec { & $script:dotnetExe test -p:ExtraDefineConstants=TEST --logger trx -f $script:NetRuntime.Desktop (DotNetTestFilter) }
262+
exec { & $script:dotnetExe test --logger trx -f $script:NetRuntime.Desktop (DotNetTestFilter) }
263263
}
264264

265265
task TestServerPS7 -If (-not $script:IsRosetta) {
266266
Set-Location .\test\PowerShellEditorServices.Test\
267267
Invoke-WithCreateDefaultHook -NewModulePath $script:PSCoreModulePath {
268-
exec { & $script:dotnetExe test -p:ExtraDefineConstants=TEST --logger trx -f $script:NetRuntime.PS7 (DotNetTestFilter) }
268+
exec { & $script:dotnetExe test --logger trx -f $script:NetRuntime.PS7 (DotNetTestFilter) }
269269
}
270270
}
271271

272272
task TestServerPS72 {
273273
Set-Location .\test\PowerShellEditorServices.Test\
274274
Invoke-WithCreateDefaultHook -NewModulePath $script:PSCoreModulePath {
275-
exec { & $script:dotnetExe test -p:ExtraDefineConstants=TEST --logger trx -f $script:NetRuntime.PS72 (DotNetTestFilter) }
275+
exec { & $script:dotnetExe test --logger trx -f $script:NetRuntime.PS72 (DotNetTestFilter) }
276276
}
277277
}
278278

@@ -281,13 +281,13 @@ task TestE2E {
281281

282282
$env:PWSH_EXE_NAME = if ($IsCoreCLR) { "pwsh" } else { "powershell" }
283283
$NetRuntime = if ($IsRosetta) { $script:NetRuntime.PS72 } else { $script:NetRuntime.PS7 }
284-
exec { & $script:dotnetExe test -p:ExtraDefineConstants=TEST --logger trx -f $NetRuntime (DotNetTestFilter) }
284+
exec { & $script:dotnetExe test --logger trx -f $NetRuntime (DotNetTestFilter) }
285285

286286
# Run E2E tests in ConstrainedLanguage mode.
287287
if (!$script:IsNix) {
288288
try {
289289
[System.Environment]::SetEnvironmentVariable("__PSLockdownPolicy", "0x80000007", [System.EnvironmentVariableTarget]::Machine);
290-
exec { & $script:dotnetExe test -p:ExtraDefineConstants=TEST --logger trx -f $script:NetRuntime.PS7 (DotNetTestFilter) }
290+
exec { & $script:dotnetExe test --logger trx -f $script:NetRuntime.PS7 (DotNetTestFilter) }
291291
} finally {
292292
[System.Environment]::SetEnvironmentVariable("__PSLockdownPolicy", $null, [System.EnvironmentVariableTarget]::Machine);
293293
}

0 commit comments

Comments
 (0)