Skip to content

Commit 9e8b7ca

Browse files
authored
Allow to clear OMParser result dictionary (#123)
Use two different docker containers Run CI in parallel, cache the omc install
1 parent a5c90a0 commit 9e8b7ca

4 files changed

Lines changed: 32 additions & 11 deletions

File tree

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ RUN apt-get update \
66
&& wget https://build.openmodelica.org/apt/openmodelica.asc -O- | apt-key add - \
77
&& apt-get update \
88
&& apt-get install -qy --no-install-recommends omc \
9-
&& pip2 install pytest \
10-
&& pip3 install pytest \
119
&& rm -rf /var/lib/apt/lists/*
10+
RUN pip2 install --no-cache pytest

.jenkins/python3/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM docker.openmodelica.org/build-deps
2+
3+
RUN apt-get update \
4+
&& apt-get install -qy gnupg wget ca-certificates apt-transport-https sudo \
5+
&& echo "deb https://build.openmodelica.org/apt `lsb_release -sc` release" > /etc/apt/sources.list.d/openmodelica.list \
6+
&& wget https://build.openmodelica.org/apt/openmodelica.asc -O- | apt-key add - \
7+
&& apt-get update \
8+
&& apt-get install -qy --no-install-recommends omc \
9+
&& rm -rf /var/lib/apt/lists/*
10+
RUN pip3 install --no-cache pytest

Jenkinsfile

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
pipeline {
2-
agent {
3-
dockerfile {
4-
// Large image with full OpenModelica build dependencies; lacks omc and OMPython
5-
label 'linux'
6-
dir '.jenkins'
7-
additionalBuildArgs '--pull'
8-
}
9-
}
2+
agent none
103
stages {
11-
stage('build') {
4+
stage('test') {
125
parallel {
136
stage('python2') {
7+
agent {
8+
dockerfile {
9+
// Large image with full OpenModelica build dependencies; lacks omc and OMPython
10+
label 'linux'
11+
dir '.jenkins/python2'
12+
additionalBuildArgs '--pull'
13+
}
14+
}
1415
steps {
1516
sh 'python2 setup.py build'
1617
timeout(3) {
@@ -21,6 +22,14 @@ pipeline {
2122
}
2223
}
2324
stage('python3') {
25+
agent {
26+
dockerfile {
27+
// Large image with full OpenModelica build dependencies; lacks omc and OMPython
28+
label 'linux'
29+
dir '.jenkins/python3'
30+
additionalBuildArgs '--pull'
31+
}
32+
}
2433
steps {
2534
sh 'python3 setup.py build'
2635
timeout(3) {

OMPython/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ def _connect_to_omc(self, timeout):
212212
def execute(self, command):
213213
pass
214214

215+
def clearOMParserResult(self):
216+
OMParser.result = {}
217+
215218
# FIXME: we should have one function which interacts with OMC. Either execute OR sendExpression.
216219
# Execute uses OMParser.check_for_values and sendExpression uses OMTypedParser.parseString.
217220
# We should have one parser. Then we can get rid of one of these functions.

0 commit comments

Comments
 (0)