Skip to content

Commit

Permalink
azdo ext add node 20 for warning (#4497)
Browse files Browse the repository at this point in the history
* Update Install Azd - azdo task

* increase timeout for resolving 404
  • Loading branch information
vhvb1989 authored Oct 29, 2024
1 parent f67bbd7 commit 56eaa40
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 67 deletions.
4 changes: 2 additions & 2 deletions ext/azuredevops/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites

Learn about [Azure devops custom tasks](https://learn.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops).
Learn about [Azure devops custom tasks](https://learn.microsoft.com/azure/devops/extend/develop/add-build-task?view=azure-devops).

## Submitting A Change

Expand Down Expand Up @@ -36,4 +36,4 @@ From `setupAzd` folder, run `npm test`
- Update `setupAzd/task.json` with the `version` number.
- Update `vss-extension.json` with the `version` to release.
- Run the `build` steps to produce the `vsix` release artifact.
- Follow [publish steps](https://learn.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops#5-publish-your-extension) to update the Marketplace.
- Follow [publish steps](https://learn.microsoft.com/azure/devops/extend/develop/add-build-task?view=azure-devops#5-publish-your-extension) to update the Marketplace.
183 changes: 144 additions & 39 deletions ext/azuredevops/setupAzd/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ext/azuredevops/setupAzd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@types/decompress": "^4.2.4",
"@types/download": "^8.0.2",
"@types/mocha": "^10.0.1",
"@types/mocha": "^10.0.9",
"@types/node": "^20.4.2",
"@types/q": "^1.5.5",
"@typescript-eslint/parser": "^5.62.0",
Expand Down
6 changes: 5 additions & 1 deletion ext/azuredevops/setupAzd/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "AzureDeveloperCLI",
"version": {
"Major": 0,
"Minor": 13,
"Minor": 14,
"Patch": 0
},
"instanceNameFormat": "Installs azd: $(rootFolder)",
Expand All @@ -25,6 +25,10 @@
"Node10": {
"target": "index.js",
"argumentFormat": ""
},
"Node20_1": {
"target": "index.js",
"argumentFormat": ""
}
}
}
19 changes: 11 additions & 8 deletions ext/azuredevops/setupAzd/tests/InstallFail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as fs from 'fs'
import { log } from 'console';

describe('setup azd tests - fails', function () {
setTimeout(() => {}, 10000);
setTimeout(() => { }, 60000);
before(function () { });
afterEach(() => {
fs.rmSync('path', { recursive: true, force: true })
Expand All @@ -15,12 +15,15 @@ describe('setup azd tests - fails', function () {
setTimeout(() => { }, 10000);
let tp = path.join(__dirname, 'invalidVersion.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

tr.run();
assert.equal(tr.succeeded, false, 'should have failed');
assert.equal(tr.warningIssues.length, 0, "should have no warnings");
assert.equal(tr.errorIssues.length, 1, "should have error");
assert.equal(tr.stdout.indexOf('Response code 404 (Not Found)') >= 0, true, "should display error");
done();

tr.runAsync().then(() => {
assert.equal(tr.succeeded, false, 'should have failed');
assert.equal(tr.warningIssues.length, 0, "should have no warnings");
assert.equal(tr.errorIssues.length, 1, "should have error");
assert.equal(tr.stdout.indexOf('Response code 404 (The specified blob does not exist.)') >= 0, true, "should display error");
done();
}).catch((reason) => {
done(reason);
});
});
});
34 changes: 20 additions & 14 deletions ext/azuredevops/setupAzd/tests/InstallSuccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as ttm from 'azure-pipelines-task-lib/mock-test';
import * as fs from 'fs'

describe('setup azd tests', function () {
setTimeout(() => {}, 10000);
setTimeout(() => { }, 10000);
before(function () { });
afterEach(() => {
fs.rmSync('path', { recursive: true, force: true })
Expand All @@ -14,24 +14,30 @@ describe('setup azd tests', function () {
setTimeout(() => { }, 10000);
let tp = path.join(__dirname, 'success.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
assert.equal(tr.succeeded, true, 'should have succeeded');
assert.equal(tr.warningIssues.length, 0, "should have no warnings");
assert.equal(tr.errorIssues.length, 0, "should have no errors");
assert.equal(tr.stdout.indexOf('using version: latest') >= 0, true, "should display version");
done();
tr.runAsync().then(() => {
assert.equal(tr.succeeded, true, 'should have succeeded');
assert.equal(tr.warningIssues.length, 0, "should have no warnings");
assert.equal(tr.errorIssues.length, 0, "should have no errors");
assert.equal(tr.stdout.indexOf('using version: latest') >= 0, true, "should display version");
done();
}).catch((reason) => {
done(reason);
});
});

it('should succeed with version', function (done: Mocha.Done) {
setTimeout(() => { }, 10000);
let tp = path.join(__dirname, 'successVersion.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

tr.run();
assert.equal(tr.succeeded, true, 'should have succeeded');
assert.equal(tr.warningIssues.length, 0, "should have no warnings");
assert.equal(tr.errorIssues.length, 0, "should have no errors");
assert.equal(tr.stdout.indexOf('using version: 1.0.0') >= 0, true, "should display version");
done();

tr.runAsync().then(() => {
assert.equal(tr.succeeded, true, 'should have succeeded');
assert.equal(tr.warningIssues.length, 0, "should have no warnings");
assert.equal(tr.errorIssues.length, 0, "should have no errors");
assert.equal(tr.stdout.indexOf('using version: 1.0.0') >= 0, true, "should display version");
done();
}).catch((reason) => {
done(reason);
});
});
});
2 changes: 1 addition & 1 deletion ext/azuredevops/setupAzd/tests/invalidVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ tmr.setAnswers({
}
}
});
tmr.setInput('version', '1.99.0');
tmr.setInput('version', '1.9999999.0');
tmr.run();
2 changes: 1 addition & 1 deletion ext/azuredevops/vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "azd",
"name": "Install azd",
"version": "0.13.0",
"version": "0.14.0",
"publisher": "ms-azuretools",
"targets": [
{
Expand Down

0 comments on commit 56eaa40

Please sign in to comment.