Skip to content

Commit

Permalink
support multiple ignoreModelPrefix in configs
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo committed Mar 28, 2024
1 parent 2ef9357 commit cacb092
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions configs/conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
},
{
"library":"Buildings",
"ignoreModelPrefix":"Buildings.Utilities.IO.BCVTB.Examples",
"ignoreModelPrefix":["Buildings.Utilities.IO.BCVTB.Examples", "Buildings.Obsolete"],
"libraryVersionNameForTests":"9",
"libraryVersion":"maint.9.1.x",
"libraryVersionLatestInPackageManager":true,
Expand All @@ -162,7 +162,7 @@
},
{
"library":"Buildings",
"ignoreModelPrefix":"Buildings.Utilities.IO.BCVTB.Examples",
"ignoreModelPrefix":["Buildings.Utilities.IO.BCVTB.Examples", "Buildings.Obsolete"],
"libraryVersion":"maint.10.0.x",
"libraryVersionNameForTests":"10",
"runOnceBeforeTesting":[["$resourceLocation/src/ThermalZones/install.py", "--binaries-for-os-only"]],
Expand All @@ -172,7 +172,7 @@
},
{
"library":"Buildings",
"ignoreModelPrefix":"Buildings.Utilities.IO.BCVTB.Examples",
"ignoreModelPrefix":["Buildings.Utilities.IO.BCVTB.Examples", "Buildings.Obsolete"],
"libraryVersion":"master",
"libraryVersionNameForTests":"latest",
"runOnceBeforeTesting":[["$resourceLocation/src/ThermalZones/install.py", "--binaries-for-os-only"]],
Expand Down
8 changes: 6 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,12 @@ def hashReferenceFiles(s):
conf["libraryLastChange"] = conf["libraryLastChange"] + " " + fmisimulatorversion.decode("ascii")
res=omc.sendExpression('{c for c guard isExperiment(c) and not regexBool(typeNameString(x), "^Modelica_Synchronous\\.WorkInProgress") in getClassNames(%s, recursive=true)}' % library)
if conf.get("ignoreModelPrefix"):
prefix = conf["ignoreModelPrefix"]
res=list(filter(lambda x: not x.startswith(prefix), res))
if isinstance(conf["ignoreModelPrefix"], list):
prefixes = conf["ignoreModelPrefix"]
res=list(filter(lambda x: not x.startswith(prefix), res) for prefix in prefixes)
else: # in this part it should be only a string
prefix = conf["ignoreModelPrefix"]
res=list(filter(lambda x: not x.startswith(prefix), res))
libName=shared.libname(library, conf)
v = cursor.execute("""SELECT date,libversion,libname,branch,omcversion FROM [libversion] NATURAL JOIN [omcversion]
WHERE libversion=? AND libname=? AND branch=? AND omcversion=? AND confighash=? ORDER BY date DESC LIMIT 1""", (conf["libraryLastChange"],libName,branch,omc_version,confighash)).fetchone()
Expand Down

0 comments on commit cacb092

Please sign in to comment.