Skip to content

Commit

Permalink
Use the library cache also for OMEdit tests (#9650)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Nov 5, 2022
1 parent 64229a6 commit 13fe6b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .CI/common.groovy
Expand Up @@ -130,7 +130,7 @@ void patchConfigStatus() {
}
}

void makeLibsAndCache(libs='core') {
void makeLibsAndCache() {
if (isWindows())
{
// do nothing
Expand Down Expand Up @@ -417,6 +417,9 @@ void buildAndRunOMEditTestsuite(stash) {
patchConfigStatus()
}
sh 'echo ./configure `./config.status --config` > config.status.2 && bash ./config.status.2'
if (stash) {
makeLibsAndCache()
}
sh "touch omc.skip omc-diff.skip ReferenceFiles.skip omsimulator.skip omedit.skip omplot.skip && ${makeCommand()} -j${numPhysicalCPU()} omc omc-diff ReferenceFiles omsimulator omedit omplot omparser" // Pretend we already built omc since we already did so
sh "${makeCommand()} -j${numPhysicalCPU()} --output-sync=recurse omedit-testsuite" // Builds the OMEdit testsuite
sh label: 'RunOMEditTestsuite', script: '''
Expand Down Expand Up @@ -454,7 +457,7 @@ void compliance() {
} else {
standardSetup()
unstash 'omc-clang'
makeLibsAndCache('all')
makeLibsAndCache()
sh 'HOME=$PWD/libraries/ build/bin/omc -g=MetaModelica build/share/doc/omc/testmodels/ComplianceSuite.mos'
sh "mv ${env.COMPLIANCEPREFIX}.html ${env.COMPLIANCEPREFIX}-current.html"
sh "test -f ${env.COMPLIANCEPREFIX}.xml"
Expand Down
13 changes: 11 additions & 2 deletions Jenkinsfile
Expand Up @@ -208,7 +208,8 @@ pipeline {
def deps = docker.build('testsuite-fmu-crosscompile', '--pull .CI/cache')
// deps.pull() // Already built...
def dockergid = sh (script: 'stat -c %g /var/run/docker.sock', returnStdout: true).trim()
deps.inside("-v /var/run/docker.sock:/var/run/docker.sock --group-add '${dockergid}'") {
deps.inside("-v /var/run/docker.sock:/var/run/docker.sock --group-add '${dockergid}' " +
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary") {
common.standardSetup()
unstash 'omc-clang'
common.makeLibsAndCache()
Expand Down Expand Up @@ -446,6 +447,7 @@ pipeline {
image 'docker.openmodelica.org/build-deps:v1.16.3'
label 'linux'
alwaysPull true
args "--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
steps {
Expand Down Expand Up @@ -674,10 +676,17 @@ pipeline {
image 'docker.openmodelica.org/build-deps:v1.16.3'
label 'linux'
alwaysPull true
args "--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary"
}
}
environment {
RUNTESTDB = "/cache/runtest/"
LIBRARIES = "/cache/omlibrary"
}
steps {
script { common.buildAndRunOMEditTestsuite('omedit-testsuite-clang') }
script {
common.buildAndRunOMEditTestsuite('omedit-testsuite-clang')
}
}
}
}
Expand Down

0 comments on commit 13fe6b7

Please sign in to comment.