diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 0c4bd3bb34d4..c2fe523211cf 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -8,6 +8,12 @@ parameters: - name: TestMarkArgument type: string default: '' + - name: BeforeTestSteps + type: object + default: [] + - name: AfterTestSteps + type: object + default: [] - name: BuildTargetingString type: string default: 'azure-*' @@ -110,3 +116,7 @@ jobs: parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }} BuildTargetingString: ${{ parameters.BuildTargetingString }} + + - ${{ each step in parameters.BeforeTestSteps }}: + - ${{ step }} + AfterTestSteps: ${{ parameters.AfterTestSteps }} diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 71d5b0fcb93f..0f008939f29d 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -17,6 +17,12 @@ parameters: - name: TestMarkArgument type: string default: '' + - name: BeforeTestSteps + type: object + default: [] + - name: AfterTestSteps + type: object + default: [] - name: BuildTargetingString type: string default: 'azure-*' @@ -121,6 +127,8 @@ jobs: ServiceDirectory: ${{ parameters.ServiceDirectory }} TestPipeline: ${{ parameters.TestPipeline }} TestMarkArgument: ${{ parameters.TestMarkArgument }} + BeforeTestSteps: ${{ parameters.BeforeTestSteps }} + AfterTestSteps: ${{ parameters.AfterTestSteps }} BuildTargetingString: ${{ parameters.BuildTargetingString }} TestTimeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }} ToxEnvParallel: ${{ parameters.ToxEnvParallel }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 0f3ffcf9f0f6..3c28d3ba5426 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -11,6 +11,12 @@ parameters: - name: TestPipeline type: boolean default: false +- name: BeforeTestSteps + type: object + default: [] +- name: AfterTestSteps + type: object + default: [] - name: BeforePublishSteps type: object default: [] @@ -74,6 +80,8 @@ stages: CondaArtifacts: ${{ parameters.CondaArtifacts }} ${{ if eq(parameters.ServiceDirectory, 'template') }}: TestPipeline: true + BeforeTestSteps: ${{ parameters.BeforeTestSteps }} + AfterTestSteps: ${{ parameters.AfterTestSteps }} BeforePublishSteps: ${{ parameters.BeforePublishSteps }} TestMarkArgument: ${{ parameters.TestMarkArgument }} BuildTargetingString: $(BuildTargetingStringValue)