簡體   English   中英

運行劇作家測試階段卡在Jenkins上無休止地運行state

[英]Running playwright tests stage stuck in running state endlessly on Jenkins

我創建了一個運行 dockerize 前端應用程序的 Jenkins 管道,構建它並運行 playwrite 測試用例。

我的問題是,運行測試階段在運行所有測試后不會進入下一步。

Jenkins 檔案:

 #!groovy

pipeline {
    agent any

    stages {
        stage('Checkout') {
            steps {
                echo 'Clean workspace'
                cleanWs()
                echo 'Checking out the PR'
                checkout scm
            }
        }

        stage('Build') {
            steps {
                echo 'Destroy Old Build'
                echo 'Building'
                sh 'make upbuild_d'
            }
        }

         stage('Lint') {
            steps {
                echo 'Checking Lint'
                sh 'make lint'
            }
        }

        stage('Test') {
            steps {
                echo 'Running Tests ...'
                sh 'make test-e2e'
            }
        }
    }
    // [StagePost] Clean after finishing
    post {
        always {
            echo '## BEGIN ALWAYS BLOCK ##'
            echo 'Destroy Build'
            sh 'make destroy'
            cleanWs()
            echo '## END ALWAYS BLOCK ##'
        }
    }
}

這是Makefile中的make test-e2e

test-e2e:
docker exec my-container bash -c 'npm run test:e2e'

這是test:e2e腳本npx playwright test --project=chromium

Jenkins如何檢測到所有測試都已經運行以執行post步驟? 在此處輸入圖像描述

出現此問題是因為playwright.config.js中的這一行reporter: 'html'

這導致嘗試在需要容器內找不到的 GUI 的瀏覽器中打開測試報告,因此進程掛起。 它通過將報告者配置更新為報告者來修復reporter: [['html', { open: 'never' }]]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM