Skip to content

Commit

Permalink
Integration test with image comparison #9
Browse files Browse the repository at this point in the history
  • Loading branch information
mammatus95 committed Jul 31, 2024
1 parent 135a506 commit 2216ece
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .jenkins/RunMaps
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
pipeline {
agent any
stages {
stage('Install pip') {
steps {
//sh 'wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | gpg --dearmor | sudo tee /usr/share/keyrings/jenkins-archive-keyring.gpg > /dev/null'
sh 'sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BA31D57EF5975CA'
sh 'apt-get update && apt-get install -y python3-pip'
}
}
stage('Install Requirements') {
steps {
sh 'pip3 install --upgrade pip'
sh 'pip3 install -r requirements.txt'
}
}
stage('version') {
steps {
sh 'python3 --version'
}
}

stage('Install imagemagick') {
steps {
sh 'sudo apt-get install imagemagick'
}
}

stage('Compare Images') {
steps {
sh 'ls -al ./images'
script {
def img1 = './images/hodographmap_ICON_Nest.png'
def img2 = './images/example.png'
def diffImg = './diff.png'

// Compare images using ImageMagick
def result = sh(script: "compare -metric AE ${img1} ${img2} ${diffImg} 2>&1", returnStatus: true)

if (result != 0) {
echo "Images are different. Check the diff image: ${diffImg}"
//error("Image comparison failed")
} else {
echo "Images are identical"
}
}
}
}

stage('Run HodographMaps') {
steps {
sh 'export PYTHONPATH=$(pwd) && echo $PYTHONPATH'
sh 'ls -al'
sh './run_script.sh 12'
}
}
}
post {
always {
// Archive images and diff for review
archiveArtifacts artifacts: './images/hodographmap_ICON_Nest.png, ./images/example.png, ./diff.png', allowEmptyArchive: true
}
}
}

0 comments on commit 2216ece

Please sign in to comment.