From 90a959004d090cbf641564e31ed31a9449bb6253 Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Mon, 20 Nov 2023 09:46:50 +0000 Subject: [PATCH] experiment: ensure gha workflow changes work The gha workflow has been modified to use the published self-contained, ready-2-run, trimmed, language server binary. However, we haven't yet added in the Trimmer Root Assemblies to ensure it works. So the vscode tests should fail, proving they are correctly using the published binary, and not using 'dotnet test' as they used to (forceDebug mode). --- .devcontainer/Dockerfile | 2 ++ .../workflows/contextive-vscode-publish.yml | 1 - .../workflows/contextive-vscode-release.yml | 1 - .github/workflows/contextive-vscode.yml | 11 ++++++++-- .../Contextive.Core/Contextive.Core.fsproj | 4 ++++ .../Contextive.LanguageServer.fsproj | 20 ++++++++++++++++--- src/vscode/contextive/test/runTest.js | 1 - 7 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5cae0a0e..0e271402 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -30,3 +30,5 @@ RUN su - vscode -c "dotnet-suggest script bash >> ~/.bashrc" COPY post_start_command.sh /home/vscode/post_start_command.sh RUN chmod +x /home/vscode/post_start_command.sh + +ENV CONTEXTIVE_DEBUG=true diff --git a/.github/workflows/contextive-vscode-publish.yml b/.github/workflows/contextive-vscode-publish.yml index 2a5e66d5..a309cfc6 100644 --- a/.github/workflows/contextive-vscode-publish.yml +++ b/.github/workflows/contextive-vscode-publish.yml @@ -5,7 +5,6 @@ on: env: dotnet-version: '7.0.x' - CONTEXTIVE_DEBUG: true jobs: publish: name: Publish diff --git a/.github/workflows/contextive-vscode-release.yml b/.github/workflows/contextive-vscode-release.yml index 9f3c68ae..6a4f6a46 100644 --- a/.github/workflows/contextive-vscode-release.yml +++ b/.github/workflows/contextive-vscode-release.yml @@ -3,7 +3,6 @@ on: workflow_dispatch env: dotnet-version: '7.0.x' - CONTEXTIVE_DEBUG: true jobs: build-and-test: name: 'Build and Test' diff --git a/.github/workflows/contextive-vscode.yml b/.github/workflows/contextive-vscode.yml index e76de120..4542218e 100644 --- a/.github/workflows/contextive-vscode.yml +++ b/.github/workflows/contextive-vscode.yml @@ -8,7 +8,11 @@ on: - '.github/**vscode**' env: dotnet-version: '7.0.x' - CONTEXTIVE_DEBUG: true + + # Uncomment this to ensure the vscode extension tests run in debug mode using `dotnet run` for enhanced logging + # by default we test with the release mode built binary to ensure .NET trimming hasn't broken anything + # See https://github.com/dev-cycles/contextive/issues/61 for details + # CONTEXTIVE_DEBUG: true jobs: build-and-test: name: 'Build and Test' @@ -64,7 +68,7 @@ jobs: name: Language Server Tests ${{ runner.os }} path: "src/**/Contextive.*.Tests/TestResults/TestResults.*-${{ env.dotnet-version }}-${{ runner.os }}.xml" reporter: dotnet-trx - - name: Publish Language Server + - name: Build Release Mode/Publish Language Server working-directory: ./src/language-server/Contextive.LanguageServer run: | dotnet publish -c Release -r ${{ matrix.dotnet_runtime }} -o publish @@ -85,6 +89,9 @@ jobs: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & echo ">>> Started xvfb" if: runner.os == 'Linux' + - name: Copy Published Language Server to VsCode Extension + run: | + cp src/language-server/Contextive.LanguageServer/publish/Contextive.LanguageServer src/vscode/contextive/dist - name: Build and Test VsCode Extension run: npm test working-directory: ./src/vscode/contextive diff --git a/src/core/Contextive.Core/Contextive.Core.fsproj b/src/core/Contextive.Core/Contextive.Core.fsproj index 4bc6c558..1bf6ca59 100644 --- a/src/core/Contextive.Core/Contextive.Core.fsproj +++ b/src/core/Contextive.Core/Contextive.Core.fsproj @@ -4,6 +4,10 @@ net7.0 true + + false + false + diff --git a/src/language-server/Contextive.LanguageServer/Contextive.LanguageServer.fsproj b/src/language-server/Contextive.LanguageServer/Contextive.LanguageServer.fsproj index 41db7db0..56742f29 100644 --- a/src/language-server/Contextive.LanguageServer/Contextive.LanguageServer.fsproj +++ b/src/language-server/Contextive.LanguageServer/Contextive.LanguageServer.fsproj @@ -11,12 +11,26 @@ Dev Cycles + false true true - - - + true + true + false + true + false + true + false + diff --git a/src/vscode/contextive/test/runTest.js b/src/vscode/contextive/test/runTest.js index 60f3eebe..db3dd05c 100644 --- a/src/vscode/contextive/test/runTest.js +++ b/src/vscode/contextive/test/runTest.js @@ -80,7 +80,6 @@ async function main() { extensionTestsPath, launchArgs, extensionTestsEnv: { - CONTEXTIVE_DEBUG: true, ...ipcOpts, } });