I am trying to run 2 different browser tests as parallel. However, pipeline is even not able to start running.
pipeline {
agent any
triggers {
cron('0 0 * * *')
}
stages {
stage('Stop old build') {
steps {
milestone label: '', ordinal: Integer.parseInt(env.BUILD_ID) - 1
milestone label: '', ordinal: Integer.parseInt(env.BUILD_ID)
}
}
stage('CI') {
stages {
stage('Prepare containers to run tests') {
agent {
kubernetes {
yaml """\
apiVersion: v1
kind: Pod
spec:
containers:
- name: cypress
image: cypress/included:8.7.0
resources:
limits:
cpu: "500m"
memory: "3000Mi"
requests:
cpu: "500m"
memory: "500Mi"
tty: true
command:
- cat
tty: true
""".stripIndent()
}
}
stages {
stage('Electron') {
steps {
container('cypress') {
parallel {
electron:
{
sh '''
cd ./cypress
npm i -D
npm run cy:run:electron-dashboard
'''
}
chrome:
{
sh '''
cd ./cypress
npm i -D
npm run cy:run:chrome-dashboard
'''
}
}
}
}
stage('reports') {
steps {
script {
allure([
includeProperties: false,
jdk : '',
properties : [],
reportBuildPolicy: 'ALWAYS',
results : [[path: './allure-results']]
])
}
}
}
}
}
}
}
}
post {
success {
slackSend(channel: 'b2b-tribe-alerts', color: '#00ff00', message: "Branch: ${env.JOB_NAME} | Job: [${env.BUILD_NUMBER}] \nStatus: *SUCCESSFUL*\nBuild URL: ${env.BUILD_URL}")
}
failure {
slackSend(channel: 'b2b-tribe-alerts', color: '#ff0000', message: "Branch: ${env.JOB_NAME} | Job: [${env.BUILD_NUMBER}] \nStatus: *FAILED*\nBuild URL: ${env.BUILD_URL}")
}
}
}
}