Интеграция Cypress с Дженкинс - PullRequest
0 голосов
/ 24 октября 2019

Вот моя конфигурация в Дженкинсе, я сделал новый тестовый конвейер. Я не уверен, что конфигурация правильная, потому что сборка продолжает давать сбой, когда она нажимает «Cypress Run»

Jenkins Конфигурация:

 node(label: 'FAKE_BUILDER') {
    stage('Checkout Git Repo') {
        git credentialsId: '12345',
        branch: 'master',
        url: 'https://github.com/fake'
    }
    stage('install') {
        sh label: 'NPM install', script: 'npm install'
        sh label: 'NPM start', script: 'npm start'
        sh label: 'Cypress Run', script: 'npx cypress run'
    }
}

В моем проекте файл Jenkins:

pipeline {
    notifySparkRoomId = "Y2EK"
    buildVersion = this.env.BUILD_NUMBER
    numToKeep = this.isMasterBranch() ? 50 : 3
    services = []

    builder = "FAKE_BUILDER"

    build = {
        this.sh "./bin/install.sh"
        this.sh "./bin/cypresstestscript.sh"

        if (this.isMasterBranch() || this.isHotfixBranch()) {
          this.sh "./bin/run.sh ./bin/build.sh"
          this.sh "tar -czf fake.tar.gz -C dist ."
          this.archiveArtifacts artifacts: "fake.tar.gz", allowEmptyArchive: true
      }
    }

    junitPattern = null
    spotbugsOpts = null

    deployTo = this.isMasterBranch() || this.isHotfixBranch() ? ['integration', 'production'] : []

    integration.deployMode = this.isMasterBranch() ? 'deploy' : 'input'
    integration.postDeployTests = []
    integration.runConsumerTests = false
}

1 Ответ

0 голосов
/ 25 октября 2019

Очевидно, xvfb не установлен на вашем сервере Jenkins.

Установите его через:

apt-get update && apt-get -y install xvfb
...