Add Node 8 to smoke test matrix (#14623)

- Use NodeTestVersion after samples are prepared
  - dev-tool is not compatible with Node 8
- Use readdirSync() for Node 8 compat
- Add --harmony_async_iteration flag for Node 8
  - Samples depend on async iterators
This commit is contained in:
Mike Harder 2021-04-22 10:43:37 -07:00 коммит произвёл GitHub
Родитель 4cb5b456e7
Коммит 96e203b010
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -7,6 +7,7 @@
"license": "ISC",
"scripts": {
"smoke-test": "node run.js",
"smoke-test-node8": "node --harmony_async_iteration run.js",
"test": "echo \"Error: no test specified\" && exit 1"
}
}

Просмотреть файл

@ -1,4 +1,4 @@
const fs = require("fs").promises;
const fs = require("fs");
// Runs smoke tests from manifest
async function main() {
@ -22,7 +22,7 @@ async function main() {
}
const skipFiles = smokeTestConfig.skip || [];
const jsFiles = (await fs.readdir(entry.SamplesDirectory))
const jsFiles = fs.readdirSync(entry.SamplesDirectory)
.filter((name) => name.endsWith(".js"))
.filter((name) => !skipFiles.includes(name));

Просмотреть файл

@ -51,6 +51,12 @@ jobs:
condition: and(succeeded(), eq(dependencies.smoke_test_eligibility.outputs['check_smoke_tests.RunSmokeTests'], true))
strategy:
matrix:
Linux Node8 (AzureCloud):
Pool: Azure Pipelines
OSVmImage: "macOS-10.14"
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
ArmTemplateParameters: $(AzureCloudArmTemplateParameters)
NodeTestVersion: "8.x"
Mac Node10 (AzureCloud):
Pool: Azure Pipelines
OSVmImage: "macOS-10.14"
@ -118,10 +124,6 @@ jobs:
steps:
- template: /eng/pipelines/templates/steps/common.yml
- template: /eng/pipelines/templates/steps/use-node-version.yml
parameters:
NodeVersion: $(NodeTestVersion)
# As of npm v7, "npm install -g" no longer installs local dependencies as part of the global install.
# As a workaround, we run "npm install --prod" before "npm install -g".
# https://github.com/npm/cli/issues/2968
@ -171,6 +173,10 @@ jobs:
workingDirectory: $(Build.SourcesDirectory)/common/smoke-test
displayName: Print run manifest
- template: /eng/pipelines/templates/steps/use-node-version.yml
parameters:
NodeVersion: $(NodeTestVersion)
- task: Npm@1
inputs:
command: install
@ -185,9 +191,15 @@ jobs:
displayName: List packages installed from the feed
- script: npm run smoke-test -- --devops-logging
condition: and(succeeded(), ne(variables.NodeTestVersion, '8.x'))
workingDirectory: common/smoke-test/
displayName: Run smoke tests
- script: npm run smoke-test-node8 -- --devops-logging
condition: and(succeeded(), eq(variables.NodeTestVersion, '8.x'))
workingDirectory: common/smoke-test/
displayName: Run smoke tests (Node 8)
- template: /eng/common/TestResources/remove-test-resources.yml
parameters:
SubscriptionConfiguration: $(SubscriptionConfiguration)