I have an issue with Jenkins Pipeline. I have two application that i want to checkout and test in parallel :
pipeline {
agent none
stages {
stage('Build') {
parallel {
stage('First app') {
agent any
steps {
echo "checkout first app"
}
}
stage('Second app') {
agent any
steps {
echo "checkout second app"
}
}
}
}
stage('Test') {
parallel {
stage('First app') {
agent any
steps {
echo 'test First app'
}
post {
always {
junit 'build/*.xml'
}
}
}
stage('Second app') {
agent any
steps {
echo "test second app"
}
post {
failure {
echo "failure"
}
}
}
}
}
stage('Deploy') {
echo "Deploy all
}
}
}
I don't understand exactly how it works, because it says :
[First app] Running on maître in /var/lib/jenkins/workspace/My Project
[Second app] Running on maître in /var/lib/jenkins/workspace/My Project@2
But in the Test stage workspace switch :
[Second app] Running on maître in /var/lib/jenkins/workspace/My Project
[First app] Running on maître in /var/lib/jenkins/workspace/My Project@2
So my test's stage is not relevant.
What can i do in order to fix this problem?