Skip to content

Commit 467ca13

Browse files
AndreyIvanov42Andrey IvanovDmitrii Bobreshevtintse-thxsky-MSFT
authored
Migrate TwineAuthenticateV0-1 to Node 10 (#15924)
* migrate TwineAuthenticateV0 to Node 10 * migrate task TwineAuthenticateV1 to Node 10 * bump version * fixed tests * increase timeout for test * Fix test call * Bump TwineAuthenticateV0/V2 Task version from 207 to 208 Co-authored-by: Andrey Ivanov <[email protected]> Co-authored-by: Dmitrii Bobreshev <[email protected]> Co-authored-by: tintse-thxsky-MSFT <[email protected]>
1 parent 7b2af93 commit 467ca13

File tree

10 files changed

+994
-105
lines changed

10 files changed

+994
-105
lines changed

Tasks/TwineAuthenticateV0/Tests/L0.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('TwineAuthenticateV1 Suite', function () {
99
after(() => {
1010
});
1111

12-
it('Does a basic hello world test', function(done: MochaDone) {
12+
it('Does a basic hello world test', function(done: Mocha.Done) {
1313
// TODO - add real tests
1414
done();
1515
});

Tasks/TwineAuthenticateV0/package-lock.json

Lines changed: 505 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tasks/TwineAuthenticateV0/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
},
1818
"homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme",
1919
"dependencies": {
20-
"azure-pipelines-task-lib": "2.8.0",
21-
"ini": "1.3.8",
20+
"@types/mocha": "^5.2.7",
21+
"@types/node": "^10.17.0",
22+
"@types/uuid": "^8.3.0",
23+
"azure-pipelines-task-lib": "^3.1.7",
24+
"ini": "^1.3.6",
2225
"packaging-common": "file:../../_build/Tasks/Common/packaging-common-1.0.1.tgz",
2326
"typed-rest-client": "^0.11.0",
2427
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz"
28+
},
29+
"devDependencies": {
30+
"typescript": "4.0.2"
2531
}
2632
}

Tasks/TwineAuthenticateV0/task.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
"version": {
1111
"Major": 0,
1212
"Minor": 208,
13-
"Patch": 1
13+
"Patch": 2
1414
},
1515
"runsOn": [
1616
"Agent",
1717
"DeploymentGroup"
1818
],
19-
"minimumAgentVersion": "2.115.0",
19+
"minimumAgentVersion": "2.144.0",
2020
"instanceNameFormat": "Twine Authenticate $(message)",
2121
"groups": [
2222
{
@@ -81,7 +81,7 @@
8181
}
8282
],
8383
"execution": {
84-
"Node": {
84+
"Node10": {
8585
"target": "twineauthenticatemain.js",
8686
"argumentFormat": ""
8787
}
@@ -106,7 +106,7 @@
106106
"Warning_SessionCreationFailed": "Could not create provenance session: %s"
107107
},
108108
"postjobexecution": {
109-
"Node": {
109+
"Node10": {
110110
"target": "authcleanup.js",
111111
"argumentFormat": ""
112112
}

Tasks/TwineAuthenticateV0/task.loc.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"version": {
1111
"Major": 0,
1212
"Minor": 208,
13-
"Patch": 1
13+
"Patch": 2
1414
},
1515
"runsOn": ["Agent", "DeploymentGroup"],
16-
"minimumAgentVersion": "2.115.0",
16+
"minimumAgentVersion": "2.144.0",
1717
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
1818
"groups": [
1919
{
@@ -74,7 +74,7 @@
7474
}
7575
],
7676
"execution": {
77-
"Node": {
77+
"Node10": {
7878
"target": "twineauthenticatemain.js",
7979
"argumentFormat": ""
8080
}
@@ -99,7 +99,7 @@
9999
"Warning_SessionCreationFailed": "ms-resource:loc.messages.Warning_SessionCreationFailed"
100100
},
101101
"postjobexecution": {
102-
"Node": {
102+
"Node10": {
103103
"target": "authcleanup.js",
104104
"argumentFormat": ""
105105
}

Tasks/TwineAuthenticateV1/Tests/L0.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ describe('Twine Authenticate V1 Suite', function () {
1616
tl.rmRF(tempDir);
1717
});
1818

19-
it('sets authentication for current organization feed', (done: MochaDone) => {
20-
this.timeout(1000);
19+
it('sets authentication for current organization feed', function (done: Mocha.Done) {
20+
this.timeout(5000);
2121
let tp = path.join(__dirname, './setAuthInternalFeed.js')
2222
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
2323

2424
tr.run();
2525
assert(tr.invokedToolCount == 0, 'no tool should be invoked.');
2626
assert(tr.succeeded, 'should have succeeded');
27-
assert.equal(tr.errorIssues.length, 0, "should have no errors");
27+
assert.strictEqual(tr.errorIssues.length, 0, "should have no errors");
2828
let fileContent = ini.parse(fs.readFileSync(tempDir + path.sep + ".pypirc", "utf-8"));
2929

30-
assert.equal(fileContent["distutils"]["index-servers"], "TestFeed", "Test Feed should be added to auth list.");
30+
assert.strictEqual(fileContent["distutils"]["index-servers"], "TestFeed", "Test Feed should be added to auth list.");
3131

32-
assert.equal(fileContent["TestFeed"]["repository"],
32+
assert.strictEqual(fileContent["TestFeed"]["repository"],
3333
"https://vsts/packagesource/TestFeed",
3434
"Test Feed repository should be correct.");
3535

36-
assert.equal(fileContent["TestFeed"]["username"],
36+
assert.strictEqual(fileContent["TestFeed"]["username"],
3737
"build",
3838
"Default username should be correct.");
3939

40-
assert.equal(fileContent["TestFeed"]["password"],
40+
assert.strictEqual(fileContent["TestFeed"]["password"],
4141
"token",
4242
"Default password from environment variable should be correct.");
4343

0 commit comments

Comments
 (0)