Издатель Jenkins HTML не отображается через сценарий конвейера - PullRequest
1 голос
/ 09 июля 2020

У меня есть задача отобразить результаты тестов с помощью Jenkins HTML плагина Publisher.

Freestyle job

Когда я создал фристайл-работу с Jenkins HTML Издатель в действиях после сборки У меня нет проблем.

enter image description here

Pipeline Job

When I created the same test using the pipeline script the HTML Report is not getting published. This is my pipeline script

 pipeline {
 agent any
 tools {
  nodejs "node"
 }
 stages {
  stage('Cloning Git') {
   steps {
    git credentialsId: '04cd87-8c6-443-b526-f2457526', url: 'https://github.com/testcafe-poc.git'
   }
  }
  stage('Install Dependencies') {
   steps {
    bat "npm install"
   }
  }
  stage('Run test') {
   steps {
    bat "npm run test:chrome"
   }
  }
 }
 post {
  always {
    publishHTML(target: [allowMissing: false,
    alwaysLinkToLastBuild: false,
    keepAll: false,
    reportDir: 'e2e\\artifacts\\reports\\',
    reportFiles: 'report.html',
    reportName: 'HTML Report',
    reportTitles: ''
   ])
  }
 }
}

I can see in the console output archiving html reports

[Pipeline] { (Declarative: Post Actions)
[Pipeline] publishHTML
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level C:\Program Files (x86)\Jenkins\workspace\node-test\e2e\artifacts\reports to C:\Program Files (x86)\Jenkins\jobs\node-test\htmlreports\HTML_20Report

But I don't see any HTML Report on the dashboard

введите описание изображения здесь

Я также заметил, что если сборка прошла успешно, я могу увидеть отчет HTML, не знаю, почему он не публикуется, когда сборка не выполняется, поскольку я использую всегда.

не уверен, в чем проблема, нужна помощь !!

...