Skip to content

Commit f7e0cac

Browse files
azp: fix vscode extension path handling problem + add test framework (#599)
* azp: improve url joining * add basic test to extension * update timeout
1 parent 9f14299 commit f7e0cac

8 files changed

Lines changed: 1307 additions & 42 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
node_modules/.bin/vsce pack -o azure-pipelines-vscode-ext.vsix
4444
node_modules/.bin/vsce pack --pre-release -o azure-pipelines-vscode-ext-pre-release.vsix
4545
working-directory: src/azure-pipelines-vscode-ext
46+
- name: Run azure-pipelines-vscode-ext Tests
47+
run: ${{ runner.os == 'Linux' && 'xvfb-run -a ' || ''}}npm test
48+
working-directory: src/azure-pipelines-vscode-ext
4649
- name: Build runner-server-vscode
4750
run: |
4851
npm install

src/azure-pipelines-vscode-ext/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### v0.3.1
2+
- remove additional space caused by export task as Cli Command
3+
- fix saving a single untitled pipeline file from browser broke syntax checker due to invalid uri joining
4+
15
### v0.3.1 (Preview)
26
- fix -q flag had no space between cli command and hypen
37
- rename command of v0.3.1 to `Copy Azure Pipeline Linter Task as Cli Command for use in CI or debugging`

src/azure-pipelines-vscode-ext/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const vscode = require('vscode');
22
import { basePaths, customImports } from "./config.js"
33
import { AzurePipelinesDebugSession } from "./azure-pipelines-debug";
4-
import { integer, Position } from "vscode-languageclient";
4+
import { integer } from "vscode-languageclient";
55
import jsYaml from "js-yaml";
66
import { applyEdits, modify } from "jsonc-parser";
77
import vsVars from "vscode-variables";
88

99
function joinPath(l, r) {
10-
return l ? l + "/" + r : r;
10+
return l ? l.replace(/\/+$/g, '') + "/" + r.replace(/^\/+/g, '') : r;
1111
}
1212

1313
function cliQuote(str) {
@@ -621,7 +621,7 @@ function activate(context) {
621621
}
622622
}
623623
}
624-
await vscode.env.clipboard.writeText(`Runner.Client azexpand -W ${cliQuote(filename)} ${parameters ? Object.entries(parameters).reduce((p, c) => `${p} --input ${cliQuote(`${c[0]}=${typeof c[1] === 'object' ? JSON.stringify(c[1]) : c[1]}`)}`, "") : ""}${variables ? Object.entries(variables).reduce((p, c) => `${p} --var ${cliQuote(`${c[0]}=${c[1]}'`)}`, "") : ""}${flags}`);
624+
await vscode.env.clipboard.writeText(`Runner.Client azexpand -W ${cliQuote(filename)}${parameters ? Object.entries(parameters).reduce((p, c) => `${p} --input ${cliQuote(`${c[0]}=${typeof c[1] === 'object' ? JSON.stringify(c[1]) : c[1]}`)}`, "") : ""}${variables ? Object.entries(variables).reduce((p, c) => `${p} --var ${cliQuote(`${c[0]}=${c[1]}'`)}`, "") : ""}${flags}`);
625625
await vscode.window.showInformationMessage("Copied to clipboard");
626626
return;
627627
}

0 commit comments

Comments
 (0)