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

Task 5442/add automated tests to vscode extension #5540

Merged
merged 6 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions .github/workflows/build-vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ jobs:
working-directory: vscode/microsoft-kiota
- run: npm run lint
working-directory: vscode/microsoft-kiota
- name: run tests(linux)
if: runner.os == 'Linux'
run: xvfb-run -a npm run test-with-coverage
working-directory: vscode/microsoft-kiota
- name: run tests
if: runner.os != 'Linux'
run: npm run test-with-coverage
working-directory: vscode/microsoft-kiota
- name: Run sonar cloud analysis
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: vscode/microsoft-kiota
- run: npm run package
working-directory: vscode/microsoft-kiota
- run: npm i -g @vscode/vsce
fey101 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ on:
"**.md",
".vscode/**",
"**.svg",
"vscode/**",
]
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
paths:
[
"abstractions/**",
"authentication/**",
"serialization/**",
"http/**",
"**.md",
".vscode/**",
"**.svg",
"!abstractions/**",
"!authentication/**",
"!serialization/**",
"!http/**",
"!**.md",
"!.vscode/**",
"!**.svg",
"!vscode/**",
]

permissions:
Expand Down
4 changes: 3 additions & 1 deletion vscode/microsoft-kiota/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dist/
out/
.kiotabin/
*.vsix
*.vsix
.vscode-test
coverage/
14 changes: 14 additions & 0 deletions vscode/microsoft-kiota/.vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
tests:[
{
files: 'out/test/**/*.test.js'
}
],
coverage: {
includeAll: true,
exclude: ["**/src/test", "**/dist", "**/*.test.[tj]s", "**/*.ts"],
reporter: ["text-summary", "html", "json-summary", "lcov", "cobertura"],
},
});
60 changes: 31 additions & 29 deletions vscode/microsoft-kiota/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,35 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "tasks: watch-tests"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "tasks: watch-tests"
}
]
}
2 changes: 2 additions & 0 deletions vscode/microsoft-kiota/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ vsc-extension-quickstart.md
.kiotabin/
.vsix
images/samples/
.vscode-test
coverage/
6 changes: 3 additions & 3 deletions vscode/microsoft-kiota/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import stylisticTs from '@stylistic/eslint-plugin-ts'
import stylisticTs from '@stylistic/eslint-plugin-ts';
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [{
ignores: ["**/out", "**/dist", "**/*.d.ts", ".vscode-test", "node_modules", "eslint.config.mjs", "webpack.config.cjs"],
ignores: ["**/out", "**/dist", "**/*.d.ts", ".vscode-test", "node_modules", "eslint.config.mjs", "webpack.config.cjs", "coverage"],
}, {
files: ["**/*.ts"],
plugins: {
Expand Down Expand Up @@ -31,4 +31,4 @@ export default [{
"no-throw-literal": "warn",
semi: "off",
},
}];
}];
Loading
Loading