Skip to content

Commit a8d5993

Browse files
authored
Bump task lib in ABTT tasks. Part 1 (#20271)
* Add getting tasks by code owner script * Bump broken node 16 version * Add script to bump tasks dependency * Bump only needed tasks * Update AndroidSigningV* tasks * Update ANTV1 task * Update ArchiveFilesV2 task * Update script logs * Add file diff in json script * fix make.js bump line endings * Check if task was already bumped * update bump script parameters * Update bump script
1 parent 6672f17 commit a8d5993

File tree

82 files changed

+4408
-3182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+4408
-3182
lines changed

Tasks/ANTV1/Tests/L0.ts

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,108 +8,100 @@ var isWindows = os.type().match(/^Win/);
88
describe('ANT Suite', function () {
99
this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000);
1010

11-
it('run ANT with all inputs', (done) => {
11+
it('run ANT with all inputs', async () => {
1212
const testPath = path.join(__dirname, 'L0AllInputs.js')
1313
const runner: MockTestRunner = new MockTestRunner(testPath);
14-
runner.run();
14+
await runner.runAsync();
1515

1616
assert(runner.ran('/usr/local/bin/ANT -version'), 'it should have run ANT -version');
1717
assert(runner.ran('/usr/local/bin/ANT -buildfile /build/build.xml'), 'it should have run ANT -buildfile ...');
1818
assert(runner.invokedToolCount == 2, 'should have only run ANT 2 times');
1919
assert(runner.stderr.length == 0, 'should not have written to stderr');
2020
assert(runner.succeeded, 'task should have succeeded');
21-
done();
2221
})
2322

24-
it('fails if missing antBuildFile input', (done) => {
23+
it('fails if missing antBuildFile input', async () => {
2524
const testPath = path.join(__dirname, 'L0MissingAntBuildFile.js')
2625
const runner: MockTestRunner = new MockTestRunner(testPath);
27-
runner.run();
26+
await runner.runAsync();
2827

2928
assert(runner.invokedToolCount == 0, 'should not have run ANT');
3029
assert(runner.failed, 'task should have failed');
3130
assert(runner.stdOutContained('Input required: antBuildFile'), 'wrong error message');
32-
done();
3331
})
3432

35-
it('fails if missing javaHomeSelection input', (done) => {
33+
it('fails if missing javaHomeSelection input', async () => {
3634
const testPath = path.join(__dirname, 'L0MissingJavaHomeSelection.js')
3735
const runner: MockTestRunner = new MockTestRunner(testPath);
38-
runner.run();
36+
await runner.runAsync();
3937

4038
assert(runner.invokedToolCount == 0, 'should not have run ANT');
4139
assert(runner.failed, 'task should have failed');
4240
assert(runner.stdOutContained('Input required: javaHomeSelection'), 'wrong error message"');
43-
done();
4441
})
4542

46-
it('fails if missing testResultsFiles input', (done) => {
43+
it('fails if missing testResultsFiles input', async () => {
4744
const testPath = path.join(__dirname, 'L0MissingTestResultsFiles.js')
4845
const runner: MockTestRunner = new MockTestRunner(testPath);
49-
runner.run();
46+
await runner.runAsync();
5047

5148
assert(runner.invokedToolCount == 0, 'should not have run ANT');
5249
assert(runner.failed, 'task should have failed');
5350
assert(runner.stdOutContained('Input required: testResultsFiles'), 'wrong error message:"');
54-
done();
5551
})
5652

57-
it('run ANT with antHomeUserInputPath', (done) => {
53+
it('run ANT with antHomeUserInputPath', async () => {
5854
const testPath = path.join(__dirname, 'L0RunWithAntHomeUserInputPath.js')
5955
const runner: MockTestRunner = new MockTestRunner(testPath);
60-
runner.run();
56+
await runner.runAsync();
6157

6258
assert(runner.ran('/usr/local/bin/ANT -version'), 'it should have run ANT -version');
6359
assert(runner.ran('/usr/local/bin/ANT -buildfile /build/build.xml'), 'it should have run ANT -buildfile ...');
6460
assert(runner.invokedToolCount == 2, 'should have only run ANT 2 times');
6561
assert(runner.stderr.length == 0, 'should not have written to stderr');
6662
assert(runner.succeeded, 'task should have succeeded');
6763
assert(runner.stdOutContained('Set ANT_HOME to /usr/local/bin/ANT2'), 'ANT_HOME not set correctly');
68-
done();
6964
})
7065

71-
it('run ANT with antHomeUserInputPath set to invalid path', (done) => {
66+
it('run ANT with antHomeUserInputPath set to invalid path', async () => {
7267
const testPath = path.join(__dirname, 'L0InvalidUserHomePath.js')
7368
const runner: MockTestRunner = new MockTestRunner(testPath);
74-
runner.run();
69+
await runner.runAsync();
7570

7671
assert(runner.invokedToolCount == 0, 'should not have run ANT');
7772
assert(runner.failed, 'task should have failed');
7873
assert(runner.stdOutContained('Not found /usr/local/bin/ANT_invalid'), 'Invalid path not detected');
79-
done();
8074
})
8175

82-
it('run ANT with ANT_HOME not set', (done) => {
76+
it('run ANT with ANT_HOME not set', async () => {
8377
const testPath = path.join(__dirname, 'L0AntHomeNotSet.js')
8478
const runner: MockTestRunner = new MockTestRunner(testPath);
85-
runner.run();
79+
await runner.runAsync();
8680

8781
// The response file will cause ANT to fail, but we are looking for the warning about ANT_HOME
8882
assert(runner.ran('/usr/local/bin/ANT -version'), 'it should have run ANT -version');
8983
assert(runner.invokedToolCount == 1, 'should have only run ANT once');
9084
assert(runner.failed, 'task should have failed');
9185
assert(runner.stdOutContained('The ANT_HOME environment variable is not set'), 'Missing JAVA_HOME not detected');
92-
done();
9386
})
9487

95-
it('run ANT with jdkVersion set to 1.8', (done) => {
88+
it('run ANT with jdkVersion set to 1.8', async () => {
9689
const testPath = path.join(__dirname, 'L0JDKSetTo8.js')
9790
const runner: MockTestRunner = new MockTestRunner(testPath);
98-
runner.run();
91+
await runner.runAsync();
9992

10093
assert(runner.ran('/usr/local/bin/ANT -version'), 'it should have run ANT -version');
10194
assert(runner.ran('/usr/local/bin/ANT -buildfile /build/build.xml'), 'it should have run ANT -buildfile ...');
10295
assert.strictEqual(runner.invokedToolCount, 2, 'should have run ANT 2 times');
10396
assert(runner.stderr.length == 0, 'should not have written to stderr');
10497
assert(runner.succeeded, 'task should have succeeded');
10598
assert(runner.stdOutContained('Set JAVA_HOME to /user/local/bin/ANT8'), 'JAVA_HOME not set correctly');
106-
done();
10799
})
108100

109-
it('run ANT with jdkVersion set to 1.5', (done) => {
101+
it('run ANT with jdkVersion set to 1.5', async () => {
110102
const testPath = path.join(__dirname, 'L0JDKSetTo5.js')
111103
const runner: MockTestRunner = new MockTestRunner(testPath);
112-
runner.run();
104+
await runner.runAsync();
113105

114106
if (isWindows) {
115107
assert.strictEqual(runner.invokedToolCount, 1, 'should have run the reg query toolrunner');
@@ -118,50 +110,45 @@ describe('ANT Suite', function () {
118110
}
119111
assert(runner.failed, 'task should have failed');
120112
assert(runner.stdOutContained('FailedToLocateSpecifiedJVM'), 'Should write FailedToLocateSpecifiedJVM error');
121-
done();
122113
})
123114

124-
it('run ANT valid inputs but it fails', (done) => {
115+
it('run ANT valid inputs but it fails', async () => {
125116
const testPath = path.join(__dirname, 'L0FailWithValidInputs.js')
126117
const runner: MockTestRunner = new MockTestRunner(testPath);
127-
runner.run();
118+
await runner.runAsync();
128119

129120
// The response file will cause ANT to fail, but we are looking for the warning about ANT_HOME
130121
assert(runner.ran('/usr/local/bin/ANT -version'), 'it should have run ANT -version');
131122
assert(runner.ran('/usr/local/bin/ANT -buildfile /build/build.xml'), 'it should have run ANT -buildfile ...');
132123
assert(runner.invokedToolCount == 2, 'should have only run ANT 2 times');
133124
assert(runner.failed, 'task should have failed');
134-
done();
135125
})
136126

137-
it('Ant build with Publish Test Results.', (done) => {
127+
it('Ant build with Publish Test Results.', async () => {
138128
const testPath = path.join(__dirname, 'L0PublishTestResults.js')
139129
const runner: MockTestRunner = new MockTestRunner(testPath);
140-
runner.run();
130+
await runner.runAsync();
141131

142132
assert(runner.succeeded, 'The task should not have failed');
143-
assert(runner.stdout.search(/##vso\[results.publish type=JUnit;mergeResults=true;publishRunAttachments=true;resultFiles=\/user\/build\/fun\/test-123.xml;\]/) >= 0)
144-
done();
133+
assert(runner.stdout.search(/##vso\[results.publish type=JUnit;mergeResults=true;publishRunAttachments=true;resultFiles=\/user\/build\/fun\/test-123.xml;\]/) >= 0);
145134
})
146135

147-
it('Ant build with Publish Test Results with no matching test result files.', (done) => {
136+
it('Ant build with Publish Test Results with no matching test result files.', async () => {
148137
const testPath = path.join(__dirname, 'L0NoMatchingTestResults.js')
149138
const runner: MockTestRunner = new MockTestRunner(testPath);
150-
runner.run();
139+
await runner.runAsync();
151140

152141
assert(runner.stdout.search(/##vso\[results.publish\]/) < 0, 'publish test results should have not got called.');
153142
assert(runner.stderr.length == 0, 'should not have written to stderr');
154143
assert(runner.stdOutContained('NoTestResults'), 'should have warned about lack of test results');
155144
assert(runner.succeeded, 'task should have succeeded');
156-
done();
157145
})
158146

159-
it('Ant build with Publish Test Results for failed builds.', (done) => {
147+
it('Ant build with Publish Test Results for failed builds.', async () => {
160148
const testPath = path.join(__dirname, 'L0FailedBuilds.js')
161149
const runner: MockTestRunner = new MockTestRunner(testPath);
162-
runner.run();
150+
await runner.runAsync();
163151

164152
assert(runner.stdout.search(/##vso\[results.publish type=JUnit;mergeResults=true;publishRunAttachments=true;resultFiles=\/user\/build\/fun\/test-123.xml;\]/) >= 0);
165-
done();
166153
})
167154
});

Tasks/ANTV1/_buildConfigs/Node20/Tests/package-lock.json

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

0 commit comments

Comments
 (0)