|
| 1 | +parameters: |
| 2 | + - name: configuration |
| 3 | + type: string |
| 4 | + default: Release |
| 5 | + - name: results_path |
| 6 | + type: string |
| 7 | + default: $(System.DefaultWorkingDirectory)/test-results |
| 8 | + |
| 9 | +steps: |
| 10 | +- ${{ if ne(variables['System.TeamProject'], 'internal') }}: |
| 11 | + - pwsh: | |
| 12 | + Write-Host "##vso[task.LogIssue type=error;]Tests cannot be ran in this Azure Devops project." |
| 13 | + exit 1 |
| 14 | + displayName: Fail invalid project |
| 15 | +
|
| 16 | +- ${{ else }}: |
| 17 | + - task: AzureKeyVault@1 |
| 18 | + inputs: |
| 19 | + # Note: This is actually a Service Connection in DevOps, not an Azure subscription name |
| 20 | + azureSubscription: Azure-Functions-Host-CI-internal |
| 21 | + keyVaultName: azurefunctionshostciv1 |
| 22 | + secretsFilter: '*' |
| 23 | + |
| 24 | + - task: UseNode@1 |
| 25 | + displayName: Install Node 6.11.2 |
| 26 | + inputs: |
| 27 | + version: '6.11.2' |
| 28 | + |
| 29 | + - pwsh: .\runtests.ps1 -ResultsPath ${{ parameters.results_path }} -Configuration ${{ parameters.configuration }} |
| 30 | + displayName: Run tests |
| 31 | + env: |
| 32 | + # many of these will be empty if running unit tests, which is fine. |
| 33 | + AzureWebJobsStorage: $(Storage) |
| 34 | + AzureWebJobsDashboard: $(Storage) |
| 35 | + AzureWebJobsServiceBus: $(ServiceBus) |
| 36 | + AzureWebJobsDocumentDBConnectionString: $(CosmosDB) |
| 37 | + AzureWebJobsMobileAppUri: $(MobileUri) |
| 38 | + AzureWebJobs_TestMobileUri: $(MobileUri) |
| 39 | + AzureWebJobsDropBox: UseLocalFileSystem=true;Path=%TEMP%\DropBox |
| 40 | + AzureWebJobsEventHubSender: $(EventHub) |
| 41 | + AzureWebJobsEventHubReceiver: $(EventHub) |
| 42 | + AzureWebJobsEventHubPath: testhub |
| 43 | + AzureWebJobsNotificationHubsConnectionString: $(NotificationHub) |
| 44 | + AzureWebJobsNotificationHubName: testhub |
| 45 | + AzureWebJobsEnv: Development |
| 46 | + AzureWebJobsScriptRoot: $(System.DefaultWorkingDirectory)\test\WebJobs.Script.Tests.Integration\TestScripts\Empty |
| 47 | + AzureWebJobsCosmosDBConnectionString: $(CosmosDB) |
| 48 | + AzureWebJobsSecretStorageKeyVaultName: $(KeyVaultName) |
| 49 | + AzureWebJobsSecretStorageKeyVaultConnectionString: $(KeyVaultConnectionString) |
| 50 | + ConnectionStrings__CosmosDB: $(CosmosDB2) |
| 51 | + FILES_ACCOUNT_NAME: $(FilesAccountName) |
| 52 | + FILES_ACCOUNT_KEY: $(FilesAccountKey) |
| 53 | + MOCHA_FILE: ${{ parameters.results_path }}/junit-test-results.xml |
| 54 | + TMP: $(Agent.TempDirectory) |
| 55 | + |
| 56 | + - task: PublishTestResults@2 |
| 57 | + displayName: Publish XUnit test results |
| 58 | + inputs: |
| 59 | + testResultsFormat: XUnit |
| 60 | + testResultsFiles: ${{ parameters.results_path }}/xunit-*.xml |
| 61 | + mergeTestResults: true |
| 62 | + buildConfiguration: $(configuration) |
| 63 | + testRunTitle: XUnit Tests |
| 64 | + condition: always() |
| 65 | + |
| 66 | + |
| 67 | + - task: PublishTestResults@2 |
| 68 | + displayName: Publish JUnit test results |
| 69 | + inputs: |
| 70 | + testResultsFormat: JUnit |
| 71 | + testResultsFiles: ${{ parameters.results_path }}/junit-*.xml |
| 72 | + mergeTestResults: true |
| 73 | + buildConfiguration: $(configuration) |
| 74 | + testRunTitle: JUnit Tests |
| 75 | + condition: always() |
0 commit comments