From 7fe658e3944051f17732f8fb9aa24ffea8dbe421 Mon Sep 17 00:00:00 2001 From: Faith Kangai Date: Tue, 12 Nov 2024 12:50:22 +0300 Subject: [PATCH] Add check for sonar token and make output path in tests platform agnostic --- .github/workflows/build-vscode-extension.yml | 12 ++++++++++++ .../suite/commands/generateClientCommand.test.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index ee28133534..bc071c49ca 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -10,7 +10,19 @@ permissions: contents: read jobs: + checksecret: + name: check if SONAR_TOKEN is set in github secrets + runs-on: ubuntu-latest + outputs: + is_SONAR_TOKEN_set: ${{ steps.checksecret_job.outputs.is_SONAR_TOKEN_set }} + steps: + - name: Check whether unity activation requests should be done + id: checksecret_job + run: | + echo "is_SONAR_TOKEN_set=${{ env.SONAR_TOKEN != '' }}" >> $GITHUB_OUTPUT build_extension: + needs: [checksecret] + if: needs.checksecret.outputs.is_SONAR_TOKEN_set == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts b/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts index 7f15478fb7..edc0337b60 100644 --- a/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts +++ b/vscode/microsoft-kiota/src/test/suite/commands/generateClientCommand.test.ts @@ -217,7 +217,7 @@ suite('GenerateClientCommand Test Suite', () => { //stub and call generateCommand const generateClientCommand = new generateModule.GenerateClientCommand(treeProvider, context, viewProvider, setWorkspaceGenerationContext); - var outputPath = "path/to/temp/folder/appPackage"; + var outputPath = path.join("path", "to", "temp", "folder", "appPackage"); //make it os agnostic const generateManifestAndRefreshUIExpectation = sinon.mock(generateClientCommand).expects( "generateManifestAndRefreshUI").twice().withArgs( config, extensionSettings, outputPath, ["repairs"]