From 1b7dd3f23928145b1f86834434f833600898c9c4 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Fri, 21 Oct 2022 11:15:37 -0700 Subject: [PATCH 1/2] Add assertion to build that bits are built in release configuration I expect this to fail because unfortunately the bug is that our tests are invoked after the build, and not in release configuration, which means they build in debug configuration and overwrite the prior built bits, screwing everything up! --- .vsts-ci/templates/ci-general.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index aec2aee4e..830c671e0 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -45,6 +45,18 @@ steps: testResultsFiles: '**/*.trx' condition: succeededOrFailed() +- task: PowerShell@2 + displayName: Assert PowerShellEditorServices release configuration + inputs: + targetType: inline + script: | + $assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/module/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll") + if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) { + Write-Host "##vso[task.LogIssue type=error;] PowerShell Editor Services bits were not built in release configuration!" + exit 1 + } + pwsh: ${{ parameters.pwsh }} + # NOTE: We zip the artifacts because they're ~20 MB compressed, but ~300 MB raw, # and we have limited pipeline artifact storage space. - task: ArchiveFiles@2 From 5d6423898a85935a81ce4eba481c0e94b10d3e1e Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Fri, 21 Oct 2022 13:09:05 -0700 Subject: [PATCH 2/2] Invoke tests in release configuration --- .vsts-ci/templates/ci-general.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index 830c671e0..33d09a746 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -35,7 +35,7 @@ steps: displayName: Test inputs: targetType: inline - script: Invoke-Build Test + script: Invoke-Build Test -Configuration Release pwsh: ${{ parameters.pwsh }} - task: PublishTestResults@2