Skip to content

Commit

Permalink
Merge pull request #697 from microsoft/tyriar/conpty4
Browse files Browse the repository at this point in the history
Disable APIScan and reduce test flakiness on Windows
  • Loading branch information
Tyriar authored Aug 1, 2024
2 parents 5874200 + 59f5d47 commit 47c16e2
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 67 deletions.
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

0 comments on commit 47c16e2

Please sign in to comment.