diff --git a/.azure-pipelines/.prettierrc.yml b/.azure-pipelines/.prettierrc.yml new file mode 100644 index 000000000000..01769692264f --- /dev/null +++ b/.azure-pipelines/.prettierrc.yml @@ -0,0 +1 @@ +singleQuote: true diff --git a/.azure-pipelines/client.test.live.yml b/.azure-pipelines/client.test.live.yml index 937f83ef156f..2dc6c0adbcb6 100644 --- a/.azure-pipelines/client.test.live.yml +++ b/.azure-pipelines/client.test.live.yml @@ -13,55 +13,55 @@ variables: NodeVersion: '10.x' jobs: -- job: 'Test' + - job: 'Test' - pool: - vmImage: '$(OSVmImage)' + pool: + vmImage: '$(OSVmImage)' - timeoutInMinutes: 240 + timeoutInMinutes: 240 - steps: - - task: NodeTool@0 - inputs: - versionSpec: '$(NodeVersion)' - displayName: 'Install Node.js $(NodeVersion)' + steps: + - task: NodeTool@0 + inputs: + versionSpec: '$(NodeVersion)' + displayName: 'Install Node.js $(NodeVersion)' - # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, - # which is the minimum required to run the composite script commands. - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'install npm-run-all' - displayName: 'npm install npm-run-all' + # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, + # which is the minimum required to run the composite script commands. + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'install npm-run-all' + displayName: 'npm install npm-run-all' - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'run install-client-$(Package)' - displayName: 'npm run install-client-$(Package)' + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'run install-client-$(Package)' + displayName: 'npm run install-client-$(Package)' - # To get realtime logging of test progress in Azure Pipelines, we need to use "script" instead of "Npm@1", - # since "Npm@1" currently buffers output (https://github.com/Microsoft/azure-pipelines-tasks/issues/8171). - - script: npm run live-test-client-$(Package) -- -- --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- $(AdditionalTestArguments) - displayName: 'npm run live-test-client-$(Package)' - env: - # Service Bus - AAD_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AAD_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AAD_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) - AZURE_SUBSCRIPTION_ID: $(test-subscription-id) - CLEAN_NAMESPACE: 'true' - RESOURCE_GROUP: $(service-bus-test-resource-group) - SERVICEBUS_CONNECTION_STRING: $(service-bus-test-connection-string) - # Event Hubs - EVENTHUB_CONNECTION_STRING: $(js-event-hubs-test-connection-string) - EVENTHUB_NAME: $(js-event-hubs-test-name) - IOTHUB_CONNECTION_STRING: $(js-event-hubs-test-iothub-connection-string) - STORAGE_CONNECTION_STRING: $(js-event-hubs-test-storage-connection-string) + # To get realtime logging of test progress in Azure Pipelines, we need to use "script" instead of "Npm@1", + # since "Npm@1" currently buffers output (https://github.com/Microsoft/azure-pipelines-tasks/issues/8171). + - script: npm run live-test-client-$(Package) -- -- --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- $(AdditionalTestArguments) + displayName: 'npm run live-test-client-$(Package)' + env: + # Service Bus + AAD_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AAD_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AAD_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + AZURE_SUBSCRIPTION_ID: $(test-subscription-id) + CLEAN_NAMESPACE: 'true' + RESOURCE_GROUP: $(service-bus-test-resource-group) + SERVICEBUS_CONNECTION_STRING: $(service-bus-test-connection-string) + # Event Hubs + EVENTHUB_CONNECTION_STRING: $(js-event-hubs-test-connection-string) + EVENTHUB_NAME: $(js-event-hubs-test-name) + IOTHUB_CONNECTION_STRING: $(js-event-hubs-test-iothub-connection-string) + STORAGE_CONNECTION_STRING: $(js-event-hubs-test-storage-connection-string) - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: '$(OSName) Node $(NodeVersion)' - condition: succeededOrFailed() - displayName: 'Publish test results' + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: '$(OSName) Node $(NodeVersion)' + condition: succeededOrFailed() + displayName: 'Publish test results' diff --git a/.azure-pipelines/client.yml b/.azure-pipelines/client.yml index fa96bf9294d4..e27ae30bdd90 100644 --- a/.azure-pipelines/client.yml +++ b/.azure-pipelines/client.yml @@ -1,174 +1,174 @@ trigger: -- master + - master variables: NodeVersion: '10.x' jobs: -- job: 'Build' - - pool: - vmImage: 'ubuntu-16.04' - - steps: - - task: NodeTool@0 - inputs: - versionSpec: '$(NodeVersion)' - displayName: 'Install Node.js $(NodeVersion)' - - # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, - # which is the minimum required to run the composite script commands. - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'install npm-run-all' - displayName: 'npm install npm-run-all' - - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'run install-client' - displayName: 'npm run install-client' - - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'run build-client' - displayName: 'npm run build-client' - - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'run pack-client' - displayName: 'npm run pack-client' - - - task: CopyFiles@2 - inputs: - contents: 'packages/**/*.tgz' - targetFolder: $(Build.ArtifactStagingDirectory) - flattenFolders: true - displayName: 'Copy Packages' - - - task: PublishBuildArtifacts@1 - condition: succeededOrFailed() - displayName: 'Publish Artifacts' - inputs: - artifactName: packages - -- job: 'Analyze' - - pool: - vmImage: 'ubuntu-16.04' - - steps: - - task: NodeTool@0 - inputs: - versionSpec: '$(NodeVersion)' - displayName: 'Install Node.js $(NodeVersion)' - - # sudo is required for pip install, as a console_entrypoint shim needs to be placed in bin - - script: | - pip install setuptools wheel - sudo pip install doc-warden - ward scan -d $(Build.SourcesDirectory) - displayName: 'Verify Readmes' - - # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, - # which is the minimum required to run the composite script commands. - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'install npm-run-all' - displayName: 'npm install npm-run-all' - - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'run audit-client' - displayName: 'npm run audit-client' - - - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - # ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR - # builds should be sufficient. - condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest')) - displayName: 'Component Detection' - -- job: 'Test' - - strategy: - matrix: - Linux_Node8: - OSName: 'Linux' - OSVmImage: 'ubuntu-16.04' - NodeVersion: '8.x' - Linux_Node10: - OSName: 'Linux' - OSVmImage: 'ubuntu-16.04' - NodeVersion: '10.x' - Linux_Node11: - OSName: 'Linux' - OSVmImage: 'ubuntu-16.04' - NodeVersion: '11.x' - macOS_Node8: - OSName: 'macOS' - OSVmImage: 'macOS-10.13' - NodeVersion: '8.x' - macOS_Node10: - OSName: 'macOS' - OSVmImage: 'macOS-10.13' - NodeVersion: '10.x' - macOS_Node11: - OSName: 'macOS' - OSVmImage: 'macOS-10.13' - NodeVersion: '11.x' - Windows_Node8: - OSName: 'Windows' - OSVmImage: 'vs2017-win2016' - NodeVersion: '8.x' - Windows_Node10: - OSName: 'Windows' - OSVmImage: 'vs2017-win2016' - NodeVersion: '10.x' - Windows_Node11: - OSName: 'Windows' - OSVmImage: 'vs2017-win2016' - NodeVersion: '11.x' - - pool: - vmImage: '$(OSVmImage)' - - steps: - - task: NodeTool@0 - inputs: - versionSpec: '$(NodeVersion)' - displayName: 'Install Node.js $(NodeVersion)' - - # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, - # which is the minimum required to run the composite script commands. - # - # Also, "npm install" in the repo root fails when using Node11 on Windows or Linux - # (https://github.com/Azure/azure-sdk-for-js/issues/845) - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'install npm-run-all' - displayName: 'npm install npm-run-all' - - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'run install-client' - displayName: 'npm run install-client' - - - task: Npm@1 - inputs: - command: 'custom' - customCommand: 'run test-client -- -- -- --reporter mocha-junit-reporter' - displayName: 'npm run test-client' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: '$(OSName) Node $(NodeVersion)' - condition: succeededOrFailed() - displayName: 'Publish test results' + - job: 'Build' + + pool: + vmImage: 'ubuntu-16.04' + + steps: + - task: NodeTool@0 + inputs: + versionSpec: '$(NodeVersion)' + displayName: 'Install Node.js $(NodeVersion)' + + # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, + # which is the minimum required to run the composite script commands. + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'install npm-run-all' + displayName: 'npm install npm-run-all' + + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'run install-client' + displayName: 'npm run install-client' + + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'run build-client' + displayName: 'npm run build-client' + + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'run pack-client' + displayName: 'npm run pack-client' + + - task: CopyFiles@2 + inputs: + contents: 'packages/**/*.tgz' + targetFolder: $(Build.ArtifactStagingDirectory) + flattenFolders: true + displayName: 'Copy Packages' + + - task: PublishBuildArtifacts@1 + condition: succeededOrFailed() + displayName: 'Publish Artifacts' + inputs: + artifactName: packages + + - job: 'Analyze' + + pool: + vmImage: 'ubuntu-16.04' + + steps: + - task: NodeTool@0 + inputs: + versionSpec: '$(NodeVersion)' + displayName: 'Install Node.js $(NodeVersion)' + + # sudo is required for pip install, as a console_entrypoint shim needs to be placed in bin + - script: | + pip install setuptools wheel + sudo pip install doc-warden + ward scan -d $(Build.SourcesDirectory) + displayName: 'Verify Readmes' + + # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, + # which is the minimum required to run the composite script commands. + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'install npm-run-all' + displayName: 'npm install npm-run-all' + + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'run audit-client' + displayName: 'npm run audit-client' + + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 + # ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR + # builds should be sufficient. + condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest')) + displayName: 'Component Detection' + + - job: 'Test' + + strategy: + matrix: + Linux_Node8: + OSName: 'Linux' + OSVmImage: 'ubuntu-16.04' + NodeVersion: '8.x' + Linux_Node10: + OSName: 'Linux' + OSVmImage: 'ubuntu-16.04' + NodeVersion: '10.x' + Linux_Node11: + OSName: 'Linux' + OSVmImage: 'ubuntu-16.04' + NodeVersion: '11.x' + macOS_Node8: + OSName: 'macOS' + OSVmImage: 'macOS-10.13' + NodeVersion: '8.x' + macOS_Node10: + OSName: 'macOS' + OSVmImage: 'macOS-10.13' + NodeVersion: '10.x' + macOS_Node11: + OSName: 'macOS' + OSVmImage: 'macOS-10.13' + NodeVersion: '11.x' + Windows_Node8: + OSName: 'Windows' + OSVmImage: 'vs2017-win2016' + NodeVersion: '8.x' + Windows_Node10: + OSName: 'Windows' + OSVmImage: 'vs2017-win2016' + NodeVersion: '10.x' + Windows_Node11: + OSName: 'Windows' + OSVmImage: 'vs2017-win2016' + NodeVersion: '11.x' + + pool: + vmImage: '$(OSVmImage)' + + steps: + - task: NodeTool@0 + inputs: + versionSpec: '$(NodeVersion)' + displayName: 'Install Node.js $(NodeVersion)' + + # Rather than running "npm install" in the repo root, reduce build time by only installing the "npm-run-all" package, + # which is the minimum required to run the composite script commands. + # + # Also, "npm install" in the repo root fails when using Node11 on Windows or Linux + # (https://github.com/Azure/azure-sdk-for-js/issues/845) + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'install npm-run-all' + displayName: 'npm install npm-run-all' + + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'run install-client' + displayName: 'npm run install-client' + + - task: Npm@1 + inputs: + command: 'custom' + customCommand: 'run test-client -- -- -- --reporter mocha-junit-reporter' + displayName: 'npm run test-client' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: '$(OSName) Node $(NodeVersion)' + condition: succeededOrFailed() + displayName: 'Publish test results'