summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/windows/.azure-pipelines/templates/test.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/community/windows/.azure-pipelines/templates/test.yml')
-rw-r--r--ansible_collections/community/windows/.azure-pipelines/templates/test.yml53
1 files changed, 53 insertions, 0 deletions
diff --git a/ansible_collections/community/windows/.azure-pipelines/templates/test.yml b/ansible_collections/community/windows/.azure-pipelines/templates/test.yml
new file mode 100644
index 000000000..4f859c981
--- /dev/null
+++ b/ansible_collections/community/windows/.azure-pipelines/templates/test.yml
@@ -0,0 +1,53 @@
+# This template uses the provided list of jobs to create test one or more test jobs.
+# It can be used directly if needed, or through the matrix template.
+
+parameters:
+ # A required list of dictionaries, one per test job.
+ # Each item in the list must contain a "job" and "name" key.
+ - name: jobs
+ type: object
+
+jobs:
+ - ${{ each job in parameters.jobs }}:
+ - job: test_${{ replace(replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_'), '@', '_') }}
+ displayName: ${{ job.name }}
+ container: default
+ workspace:
+ clean: all
+ steps:
+ - checkout: self
+ fetchDepth: $(fetchDepth)
+ path: $(checkoutPath)
+ - task: DownloadPipelineArtifact@2
+ inputs:
+ artifact: CollectionRequirements
+ path: $(Agent.TempDirectory)
+ - bash: |
+ sudo chown -R "$(whoami)" "${PWD}/../../../ansible_collections"
+ cp -R "$(Agent.TempDirectory)/ansible_collections"/. "${PWD}/../../../ansible_collections"
+ displayName: Set up dependencies
+ - bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)"
+ displayName: Run Tests
+ - bash: .azure-pipelines/scripts/process-results.sh
+ condition: succeededOrFailed()
+ displayName: Process Results
+ - bash: .azure-pipelines/scripts/aggregate-coverage.sh "$(Agent.TempDirectory)"
+ condition: eq(variables.haveCoverageData, 'true')
+ displayName: Aggregate Coverage Data
+ - task: PublishTestResults@2
+ condition: eq(variables.haveTestResults, 'true')
+ inputs:
+ testResultsFiles: "$(outputPath)/junit/*.xml"
+ displayName: Publish Test Results
+ - task: PublishPipelineArtifact@1
+ condition: eq(variables.haveBotResults, 'true')
+ displayName: Publish Bot Results
+ inputs:
+ targetPath: "$(outputPath)/bot/"
+ artifactName: "Bot $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
+ - task: PublishPipelineArtifact@1
+ condition: eq(variables.haveCoverageData, 'true')
+ displayName: Publish Coverage Data
+ inputs:
+ targetPath: "$(Agent.TempDirectory)/coverage/"
+ artifactName: "Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"