Skip to content

Commit

Permalink
Rename files to follow yaml file naming conventions (#2607)
Browse files Browse the repository at this point in the history
* rename files, refactor testing to use templates
* read parameter to maxParallel
* dry up common template steps
* define EnvVars in tests-common.yml
* use a storage-specific testing template
* move archetype-sdk-tests-storage.yml and dry up tests.yml env vars
  • Loading branch information
danieljurek authored and weshaggard committed Jun 3, 2019
1 parent 6687005 commit 582d163
Show file tree
Hide file tree
Showing 10 changed files with 229 additions and 0 deletions.
44 changes: 44 additions & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-tests-browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
parameters:
TestType: "browser"
PackageName: ""
EnvVars: []
MaxParallel: 0
Matrix:
Linux_Node10X:
OSName: "Linux"
OSVmImage: "ubuntu-16.04"
Windows_Node10X:
OSName: "Windows"
OSVmImage: "vs2017-win2016"
Mac_Node10X:
OSName: "Mac"
OSVmImage: "macOS-10.13"

jobs:
- job: "Test_Browser"
variables:
- template: ../variables/globals.yml

strategy:
maxParallel: ${{ parameters.MaxParallel }}
matrix: ${{ parameters.Matrix }}

pool:
vmImage: "$(OSVmImage)"

timeoutInMinutes: 240

steps:
- template: ../steps/tests-common.yml
parameters:
PackageName: ${{ parameters.PackageName }}
TestType: ${{ parameters.TestType }}
EnvVars: ${{ parameters.EnvVars }}

- task: PublishTestResults@2
inputs:
testRunner: JUnit
testResultsFiles: "**/test-results.browser.xml"
testRunTitle: "$(OSName) Node $(NodeVersion) - Browser"
condition: succeededOrFailed()
displayName: "Publish browser test results"
43 changes: 43 additions & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-tests-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
parameters:
TestType: "node"
PackageName: ""
EnvVars: []
MaxParallel: 0
Matrix:
Linux_Node10X:
OSName: "Linux"
OSVmImage: "ubuntu-16.04"
Windows_Node10X:
OSName: "Windows"
OSVmImage: "vs2017-win2016"
Mac_Node10X:
OSName: "Mac"
OSVmImage: "macOS-10.13"

jobs:
- job: "Test_Node"
variables:
- template: ../variables/globals.yml

strategy:
maxParallel: ${{ parameters.MaxParallel }}
matrix: ${{ parameters.Matrix }}

pool:
vmImage: "$(OSVmImage)"

timeoutInMinutes: 240

steps:
- template: ../steps/tests-common.yml
parameters:
PackageName: ${{ parameters.PackageName }}
TestType: ${{ parameters.TestType }}
EnvVars: ${{ parameters.EnvVars }}

- task: PublishTestResults@2
inputs:
testResultsFiles: "**/test-results.xml"
testRunTitle: "$(OSName) Node $(NodeVersion) - Node"
condition: succeededOrFailed()
displayName: "Publish node test results"
27 changes: 27 additions & 0 deletions eng/pipelines/templates/steps/tests-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
parameters:
EnvVars: []
PackageName: ""
TestType: ""

steps:
- task: NodeTool@0
inputs:
versionSpec: "$(NodeVersion)"
displayName: "Install Node.js $(NodeVersion)"

- script: |
node common/scripts/install-run-rush.js install
displayName: "Install dependencies"
- script: |
node common/scripts/install-run-rush.js build -t "${{parameters.PackageName}}" --verbose
displayName: 'rush build -t "${{parameters.PackageName}}"'
- script: |
node common/scripts/install-run-rush.js build:test -t "${{parameters.PackageName}}" --verbose
displayName: 'rush build:test -t "${{parameters.PackageName}}"'
- script: |
node common/scripts/install-run-rush.js integration-test:${{ parameters.TestType }} -t "${{parameters.PackageName}}" --verbose
displayName: 'rush integration-test:${{ parameters.TestType }} -t "${{parameters.PackageName}}"'
env: ${{ parameters.EnvVars }}
12 changes: 12 additions & 0 deletions sdk/eventhub/event-hubs/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
trigger: none

jobs:
- template: ../../../eng/pipelines/templates/jobs/archetype-sdk-tests-node.yml
parameters:
PackageName: "@azure/event-hubs"
EnvVars:
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)
# Event Hubs tests do not support concurrent execution
MaxParallel: 1
13 changes: 13 additions & 0 deletions sdk/eventhub/event-processor-host/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trigger: none

jobs:
- template: ../../../eng/pipelines/templates/jobs/archetype-sdk-tests-node.yml
parameters:
PackageName: "@azure/event-processor-host"
EnvVars:
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)
# Event Hubs tests do not support concurrent execution
MaxParallel: 1
16 changes: 16 additions & 0 deletions sdk/servicebus/service-bus/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
trigger: none

jobs:
- template: ../../../eng/pipelines/templates/jobs/archetype-sdk-tests-node.yml
parameters:
PackageName: "@azure/service-bus"
EnvVars:
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)
# Service Bus tests do not support concurrent execution
MaxParallel: 1
56 changes: 56 additions & 0 deletions sdk/storage/archetype-sdk-tests-storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
parameters:
PackageName: ""
EnvVars:
ACCOUNT_NAME: $(js-storage-test-account-name)
ACCOUNT_KEY: $(js-storage-test-account-key)
ACCOUNT_SAS: $(js-storage-test-account-sas)
Matrix:
Linux_Node8X:
OSName: "Linux"
OSVmImage: "ubuntu-16.04"
NodeVersion: "8.x"
Linux_Node10X:
OSName: "Linux"
OSVmImage: "ubuntu-16.04"
NodeVersion: "10.x"
Linux_Node12X:
OSName: "Linux"
OSVmImage: "ubuntu-16.04"
NodeVersion: "12.x"
Windows_Node8X:
OSName: "Windows"
OSVmImage: "vs2017-win2016"
NodeVersion: "8.x"
Windows_Node10X:
OSName: "Windows"
OSVmImage: "vs2017-win2016"
NodeVersion: "10.x"
Windows_Node12X:
OSName: "Windows"
OSVmImage: "vs2017-win2016"
NodeVersion: "12.x"
Mac_Node8X:
OSName: "Mac"
OSVmImage: "macOS-10.13"
NodeVersion: "8.x"
Mac_Node10X:
OSName: "Mac"
OSVmImage: "macOS-10.13"
NodeVersion: "10.x"
Mac_Node12X:
OSName: "Mac"
OSVmImage: "macOS-10.13"
NodeVersion: "12.x"

jobs:
- template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests-node.yml
parameters:
EnvVars: ${{ parameters.EnvVars }}
PackageName: ${{ parameters.PackageName }}
Matrix: ${{ parameters.Matrix }}

- template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests-browser.yml
parameters:
EnvVars: ${{ parameters.EnvVars }}
PackageName: ${{ parameters.PackageName }}
Matrix: ${{ parameters.Matrix }}
6 changes: 6 additions & 0 deletions sdk/storage/storage-blob/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
trigger: none

jobs:
- template: ../archetype-sdk-tests-storage.yml
parameters:
PackageName: "@azure/storage-blob"
6 changes: 6 additions & 0 deletions sdk/storage/storage-file/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
trigger: none

jobs:
- template: ../archetype-sdk-tests-storage.yml
parameters:
PackageName: "@azure/storage-file"
6 changes: 6 additions & 0 deletions sdk/storage/storage-queue/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
trigger: none

jobs:
- template: ../archetype-sdk-tests-storage.yml
parameters:
PackageName: "@azure/storage-queue"

0 comments on commit 582d163

Please sign in to comment.