onnxruntime/tools/ci_build/github/azure-pipelines/nodejs/templates/test.yml
Edward Chen 6d46007028
Add explicit 'set +x' before printing a vso[] command to avoid output getting parsed again with a trailing quote. (#15986)
Here's the motivating issue:
https://github.com/microsoft/azure-pipelines-tasks/issues/10331

Noticed some problems in other repos so also updating usages in ORT.

We may be fine now without it, but this change adds some safeguard against future additions of 'set -x' for debugging.
2023-05-17 19:30:28 -07:00

40 lines
1.5 KiB
YAML

steps:
- checkout: none
- task: DownloadPipelineArtifact@0
displayName: 'Download NPM packages'
inputs:
artifactName: NPM_packages
targetPath: '$(Build.BinariesDirectory)/nodejs-artifact'
- script: mkdir e2e_test
workingDirectory: '$(Build.BinariesDirectory)'
- task: PowerShell@2
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
displayName: 'Extract package file name (Windows)'
inputs:
targetType: 'inline'
script: |
Write-Host "##vso[task.setvariable variable=NpmPackageFilesForTest;]$(ls $(Build.BinariesDirectory)/nodejs-artifact/*.tgz)"
workingDirectory: '$(Build.BinariesDirectory)/e2e_test'
- task: CmdLine@2
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
displayName: 'Extract package file name (POSIX)'
inputs:
script: |
# Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote.
set +x
echo "##vso[task.setvariable variable=NpmPackageFilesForTest;]`ls $(Build.BinariesDirectory)/nodejs-artifact/*.tgz | tr '\n' ' '`"
workingDirectory: '$(Build.BinariesDirectory)/e2e_test'
- script: |
npm init -y
npm install $(NpmPackageFilesForTest)
node -p "require('onnxruntime-node')"
workingDirectory: '$(Build.BinariesDirectory)/e2e_test'
- template: ../../templates/component-governance-component-detection-steps.yml
parameters :
condition : 'always'
- template: ../../templates/clean-agent-build-directory-step.yml