Skip to content

[Question]: Is it possible to create dependency on PublishTestResults@2 task #20213

Closed
@luckeyca

Description

Task name

PublishTestResults@2

Task version

2

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04

Question

Is there a way to directly setup dependency on PublishTestResults@2 with failed condition as there is no "name" property on this type of tasks. example: task2 depends on both task1 and PublishTestResults@2 task with condition on task1 succeeds and PublishedTestResultTask@2 fails

steps:
- task: PublishTestResults@2
  displayName: Publish JUnit Test Reports
  inputs:
    testResultsFormat: 'JUnit'
    testResultsFiles: '**/reports/*-junit.xml' 
    failTaskOnFailedTests: true
    publishRunAttachments: true
- script: echo "task 1"
  condition: failed()
  name: task1
- script: echo "task 2"
  dependsOn:
  - <PublishTestResults@2 reference>
  - task1
  condition: and(succeeded('task1'), failed(<PublishTestResults@2 reference>))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions