Skip to content

Commit

Permalink
ci: move timeouts closer to running test
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Bandeira <[email protected]>
  • Loading branch information
Vitor Bandeira committed Nov 21, 2024
1 parent 7c8114b commit fde52dc
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 57 deletions.
66 changes: 33 additions & 33 deletions jenkins/Jenkinsfile.coverage
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
@Library('[email protected]') _

timeout(time: 2, unit: 'HOURS') {
node {
node {

stage('Checkout'){
checkout scm;
}
stage('Checkout'){
checkout scm;
}

def DOCKER_IMAGE;
stage('Build and Push Docker Image') {
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
echo "Docker image is ${DOCKER_IMAGE}";
}
def DOCKER_IMAGE;
stage('Build and Push Docker Image') {
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
echo "Docker image is ${DOCKER_IMAGE}";
}

docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
stage('Build for Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh label: 'Build OpenROAD', script: './etc/Build.sh -no-warnings -coverage';
}
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
stage('Build for Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh label: 'Build OpenROAD', script: './etc/Build.sh -no-warnings -coverage';
}
}

stage('Dynamic Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
stage('Dynamic Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
timeout(time: 2, unit: 'HOURS') {
sh './etc/CodeCoverage.sh dynamic';
}
}

stage('Publish Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: 'coverage-output',
reportFiles: 'index.html',
reportName: 'Dynamic Code Coverage',
reportTitles: ''
]);
}
}
}

stage('Send Email Report') {
sendEmail();
stage('Publish Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: 'coverage-output',
reportFiles: 'index.html',
reportName: 'Dynamic Code Coverage',
reportTitles: ''
]);
}
}
}

stage('Send Email Report') {
sendEmail();
}

}
44 changes: 22 additions & 22 deletions jenkins/Jenkinsfile.coverity
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
@Library('[email protected]') _

timeout(time: 2, unit: 'HOURS') {
node {
node {

stage('Checkout'){
checkout scm;
}
stage('Checkout'){
checkout scm;
}

def DOCKER_IMAGE;
stage('Build and Push Docker Image') {
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
echo "Docker image is ${DOCKER_IMAGE}";
}
def DOCKER_IMAGE;
stage('Build and Push Docker Image') {
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
echo "Docker image is ${DOCKER_IMAGE}";
}

docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /home/jenkins/cov-latest:/root/cov-latest') {
stage("Setup") {
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
}
stage('Run Static Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
withCredentials([string(credentialsId: 'COVERITY_TOKEN', variable: 'TOKEN')]) {
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /home/jenkins/cov-latest:/root/cov-latest') {
stage("Setup") {
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
}
stage('Run Static Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
withCredentials([string(credentialsId: 'COVERITY_TOKEN', variable: 'TOKEN')]) {
timeout(time: 2, unit: 'HOURS') {
sh label: 'CodeCoverage Script', script: '''
export PATH=/root/cov-latest/bin:$PATH
./etc/CodeCoverage.sh static ${TOKEN}
''';
}
}
archiveArtifacts artifacts: 'openroad.tgz';
}
archiveArtifacts artifacts: 'openroad.tgz';
}
}

stage('Send Email Report') {
sendEmail();
}

stage('Send Email Report') {
sendEmail();
}

}
8 changes: 6 additions & 2 deletions jenkins/Jenkinsfile.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ node {
}
stage("Run ${name}") {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh "python3 src/drt/test/run-ispd.py --program ${WORKSPACE}/build/src/openroad --tests ispd${ispd_year}_test${test_to_run}";
timeout(time: 8, unit: 'HOURS') {
sh "python3 src/drt/test/run-ispd.py --program ${WORKSPACE}/build/src/openroad --tests ispd${ispd_year}_test${test_to_run}";
}
}
}
stage("Save ${name} Results") {
Expand All @@ -68,7 +70,9 @@ node {
}
stage('Run GPL Tests') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh './src/gpl/test/regression-large';
timeout(time: 2, unit: 'HOURS') {
sh './src/gpl/test/regression-large';
}
}
}
stage('Save GPL Results') {
Expand Down

0 comments on commit fde52dc

Please sign in to comment.