Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update images in the CI #925

Merged
merged 2 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
#################################################
displayName: windows
pool:
vmImage: windows-2019
vmImage: windows-2022

steps:
- template: azure-pipelines-steps-node.yml
Expand All @@ -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