Skip to content

Commit

Permalink
Add check for sonar token and make output path in tests platform agno… (
Browse files Browse the repository at this point in the history
#5758)

* Add check for sonar token and make output path in tests platform agnostic

* make the if sonar token is set requirement more task-specific
  • Loading branch information
fey101 authored Nov 12, 2024
1 parent cc75bd1 commit bdda7cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/build-vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ 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]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -40,6 +51,7 @@ jobs:
run: npm run test-with-coverage
working-directory: vscode/microsoft-kiota
- name: Run sonar cloud analysis
if: needs.checksecret.outputs.is_SONAR_TOKEN_set == 'true'
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit bdda7cf

Please sign in to comment.