Skip to content

Commit

Permalink
update ubuntu image
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisRumyantsev committed Apr 20, 2023
1 parent 2915809 commit 13543c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
#################################################
displayName: Linux
pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-22.04

steps:
steps:
- template: azure-pipelines-steps-node.yml
parameters:
nodeVersion: $(nodeVersion)
Expand All @@ -57,7 +57,7 @@ jobs:
#################################################
displayName: macOS
pool:
vmImage: macOS-10.15
vmImage: macOS-12

steps:
- template: azure-pipelines-steps-node.yml
Expand Down
23 changes: 5 additions & 18 deletions node/test/dirtests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1381,33 +1381,20 @@ describe('Dir Operation Tests', function () {
tl.mkdirP(testPath);
assert(shell.test('-d', testPath), 'directory created');

// can't remove folder with locked file on windows
// starting from windows-2022,
// can remove folder with locked file on windows as well,
// using the command `rd /s /q <path>`
var filePath = path.join(testPath, 'file.txt');
fs.appendFileSync(filePath, 'some data');
assert(shell.test('-e', filePath), 'file exists');

var fd = fs.openSync(filePath, 'r');

var worked = false;
try {
tl.rmRF(testPath);
worked = true;
}
catch (err) { }

if (os.platform() === 'win32') {
assert(!worked, 'should not work on windows');
assert(shell.test('-e', testPath), 'directory still exists');
}
else {
assert(worked, 'should work on nix');
assert(!shell.test('-e', testPath), 'directory removed');
}

fs.closeSync(fd);
tl.rmRF(testPath);
assert(!shell.test('-e', testPath), 'directory removed');

fs.closeSync(fd);

done();
});

Expand Down
3 changes: 2 additions & 1 deletion node/test/toolrunnertests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ describe('Toolrunner Tests', function () {
ls.exec(_testExecOptions)
.then(function (code) {
var contents = stdStream.getContents();
assert(contents.indexOf('exec tool: /bin/ls') >= 0, 'should exec ls');
const usr = os.platform() === 'linux' ? '/usr' : '';
assert(contents.indexOf(`exec tool: ${usr}/bin/ls`) >= 0, 'should exec ls');
assert.equal(code, 0, 'return code of ls should be 0');
done();
})
Expand Down

0 comments on commit 13543c5

Please sign in to comment.