Skip to content

Disable APIScan and reduce test flakiness on Windows #697

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

Merged
merged 2 commits into from
Aug 1, 2024
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
126 changes: 63 additions & 63 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,72 +93,72 @@ extends:
npm run lint
displayName: 'Lint'

- job: APIScan
dependsOn: []
pool:
name: 1es-oss-windows-2022-x64
os: Windows
strategy:
matrix:
node_18_x:
node_version: 18.x
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: 'Install Node.js'
- pwsh: |
$includes = @'
{
'target_defaults': {
'conditions': [
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/Zi',
'/FS'
],
},
'VCLinkerTool': {
'AdditionalOptions': [
'/profile'
]
}
}
}]
]
}
}
'@
# - job: APIScan
# dependsOn: []
# pool:
# name: 1es-oss-windows-2022-x64
# os: Windows
# strategy:
# matrix:
# node_18_x:
# node_version: 18.x
# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: $(node_version)
# displayName: 'Install Node.js'
# - pwsh: |
# $includes = @'
# {
# 'target_defaults': {
# 'conditions': [
# ['OS=="win"', {
# 'msvs_settings': {
# 'VCCLCompilerTool': {
# 'AdditionalOptions': [
# '/Zi',
# '/FS'
# ],
# },
# 'VCLinkerTool': {
# 'AdditionalOptions': [
# '/profile'
# ]
# }
# }
# }]
# ]
# }
# }
# '@

if (!(Test-Path "~/.gyp")) {
mkdir "~/.gyp"
echo $includes > "~/.gyp/include.gypi"
}
displayName: Create include.gypi
- script: |
npm i
displayName: 'Install dependencies and build'
# if (!(Test-Path "~/.gyp")) {
# mkdir "~/.gyp"
# echo $includes > "~/.gyp/include.gypi"
# }
# displayName: Create include.gypi
# - script: |
# npm i
# displayName: 'Install dependencies and build'

- task: APIScan@2
inputs:
softwareFolder: $(Build.SourcesDirectory)\build\Release
softwareName: 'vscode-node-pty'
softwareVersionNum: '1'
isLargeApp: false
toolVersion: 'Latest'
displayName: Run ApiScan
condition: succeeded()
env:
AzureServicesAuthConnectionString: $(apiscan-connectionstring)
# - task: APIScan@2
# inputs:
# softwareFolder: $(Build.SourcesDirectory)\build\Release
# softwareName: 'vscode-node-pty'
# softwareVersionNum: '1'
# isLargeApp: false
# toolVersion: 'Latest'
# displayName: Run ApiScan
# condition: succeeded()
# env:
# AzureServicesAuthConnectionString: $(apiscan-connectionstring)

- task: PublishSecurityAnalysisLogs@3
inputs:
ArtifactName: CodeAnalysisLogs
ArtifactType: Container
PublishProcessedResults: false
AllTools: true
# - task: PublishSecurityAnalysisLogs@3
# inputs:
# ArtifactName: CodeAnalysisLogs
# ArtifactType: Container
# PublishProcessedResults: false
# AllTools: true

- stage: Release
dependsOn: Build
Expand Down
4 changes: 2 additions & 2 deletions src/windowsPtyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ export class WindowsPtyAgent {
if (this._exitCode !== undefined) {
throw new Error('Cannot resize a pty that has already exited');
}
this._ptyNative.resize(this._pty, cols, rows, this._useConptyDll);
(this._ptyNative as IConptyNative).resize(this._pty, cols, rows, this._useConptyDll);
return;
}
this._ptyNative.resize(this._pid, cols, rows, this._useConptyDll);
(this._ptyNative as IWinptyNative).resize(this._pid, cols, rows);
}

public clear(): void {
Expand Down
4 changes: 2 additions & 2 deletions src/windowsTerminal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if (process.platform === 'win32') {
(<any>term)._defer(done);
});
it('should kill the process tree', function (done: Mocha.Done): void {
this.timeout(5000);
this.timeout(10000);
const term = new WindowsTerminal('cmd.exe', [], { useConpty });
// Start sub-processes
term.write('powershell.exe\r');
Expand Down Expand Up @@ -134,7 +134,7 @@ if (process.platform === 'win32') {
it('should throw a non-native exception when resizing a killed terminal', (done) => {
const term = new WindowsTerminal('cmd.exe', [], { useConpty });
(<any>term)._defer(() => {
term.on('exit', () => {
term.once('exit', () => {
assert.throws(() => term.resize(1, 1));
done();
});
Expand Down