Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for sonar token and make output path in tests platform agno… #5758

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 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 All @@ -32,14 +43,15 @@ jobs:
- run: npm run lint
working-directory: vscode/microsoft-kiota
- name: run tests(linux)
if: runner.os == 'Linux'
if: needs.checksecret.outputs.is_SONAR_TOKEN_set == 'true' and runner.os == 'Linux'
run: xvfb-run -a npm run test-with-coverage
working-directory: vscode/microsoft-kiota
- name: run tests
if: runner.os != 'Linux'
if: needs.checksecret.outputs.is_SONAR_TOKEN_set == 'true' and runner.os != 'Linux'
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'
fey101 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading