Skip to content

Commit 4c7e384

Browse files
authored
Mark models with non-standard Modelica as invalid (#427)
Some libraries were tested with --allowNonStandardModelica and others were not. Thus the overviews counted some non-standard models as working, and did not show how far the others would get. Testing: - test.py adds --warnNonStandardModelica to the default commands if omc accepts it, and the configurations no longer set --allowNonStandardModelica. - testmodel.py finds the "[Non-standard Modelica: ...]" tag in the messages of omc and writes the options to .stat.json. - Each branch table gets the column invalid (sqlite user_version 6). Library reports put a red cross before the name of an invalid model and give the number of invalid models. Overviews: - The newest run of master on each library says which models are invalid; --invalid-branch selects another branch, for the libraries that master does not test. - The counts and times leave out the invalid models. Buttons at the top show them included, or only them. - The "Now working in ..." tooltips are removed, and one query reads the rows of a library and branch. - New style sheet. Merge this only after a nightly omc has --warnNonStandardModelica. Fixes #426. Assisted-by: Claude Opus 5.5
1 parent c8d7eeb commit 4c7e384

13 files changed

Lines changed: 297 additions & 112 deletions

File tree

‎.CI/Jenkinsfile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,11 @@ pipeline {
592592
sh "./report.py --branches='generateSymbolicJacobian' configs/conf.json"
593593
sh "mv overview.html overview-generateSymbolicJacobian.html"
594594

595-
sh "./report.py --branches='dataReconciliation dataReconciliation-newBackend' configs/dataReconciliation.json"
595+
// master does not test these libraries.
596+
sh "./report.py --branches='dataReconciliation dataReconciliation-newBackend' --invalid-branch=dataReconciliation configs/dataReconciliation.json"
596597
sh "mv overview.html overview-dataReconciliation.html"
597598

598-
sh "./report.py --branches='heavy_tests heavy_tests_wasm' configs/heavy_tests.json"
599+
sh "./report.py --branches='heavy_tests heavy_tests_wasm' --invalid-branch=heavy_tests configs/heavy_tests.json"
599600
sh "mv overview.html overview-heavy_tests.html"
600601

601602
sh "./report.py --branches='${env.GITBRANCHES_NEWINST}' configs/conf.json"

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
- name: Verify that overview.html contains simulation and verification
7575
shell: bash
7676
run: |
77-
if ! grep -q '<tr><td><a href="${{ matrix.omc-version }}/MyLibrary_1.0.0/MyLibrary_1.0.0.html">${{ matrix.omc-version }}</a></td><td><a>2</a></td><td><a>2</a></td><td><a>2</a></td><td><a>2</a></td><td><a>2</a></td><td><a>2</a></td><td><a>2</a></td><td><a>2</a></td><td><a>2</a></td></tr></table>' overview.html; then
77+
if ! grep -q '<tr><td><a href="${{ matrix.omc-version }}/MyLibrary_1.0.0/MyLibrary_1.0.0.html">${{ matrix.omc-version }}</a></td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td></tr>' overview.html; then
7878
echo "Failed to find 2 simulating and 2 verifying models in overwiew.html:"
7979
cat overview.html
8080
exit 1

‎configs/conf.json‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@
152152
{
153153
"library":"AES",
154154
"libraryVersion":"main",
155-
"libraryVersionNameForTests":"",
156-
"extraCustomCommands":["setCommandLineOptions(\"--allowNonStandardModelica=illegalConditionalContext\");"]
155+
"libraryVersionNameForTests":""
157156
},
158157
{
159158
"library":"AixLib"
@@ -326,14 +325,12 @@
326325
"library":"Dynawo",
327326
"ulimitExeModels":{
328327
"Dynawo.Examples.RVS.TestCases.TestB.TestBNoSvcNoLoadReset":330
329-
},
330-
"extraCustomCommands":["setCommandLineOptions(\"--allowNonStandardModelica=implicitParameterStartAttribute,illegalConditionalContext\");"]
328+
}
331329
},
332330
{
333331
"library":"Dynawo",
334332
"libraryVersion":"master",
335333
"libraryVersionNameForTests":"dev",
336-
"extraCustomCommands":["setCommandLineOptions(\"--allowNonStandardModelica=implicitParameterStartAttribute,illegalConditionalContext\");"],
337334
"referenceFileExtension":"csv",
338335
"referenceFileNameDelimiter":".",
339336
"referenceFinalDot":"_res.",
@@ -673,7 +670,6 @@
673670
"libraryVersionNameForTests":"",
674671
"extraCustomCommands":
675672
[
676-
"setCommandLineOptions(\"--allowNonStandardModelica=nonStdEnumerationAsIntegers,nonStdTopLevelOuter\")",
677673
"setEnvironmentVar(\"publicData\", \"$libraryLocation/Tables/\")",
678674
"setEnvironmentVar(\"privateData\", \"$libraryLocation/Tables/\")",
679675
"setEnvironmentVar(\"superstructureTables\", \"$libraryLocation/Tables/superstructure/Tables/\")",

‎doc/README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ migrates on startup (`test.py`, around the `CREATE TABLE` block):
4444
| 0 | empty/new database; `omcversion` and `libversion` are created |
4545
| 1 | `libversion.confighash` added |
4646
| 2 | `parsing` added to every per-branch table |
47-
| 3 | current layout |
47+
| 3 | the layout of 2026-08 |
48+
| 4 | `libversion.host` and `libversion.sysinfo` added |
49+
| 5 | `maxrss` added to every per-branch table |
50+
| 6 | `invalid` added to every per-branch table; current layout |
4851

4952
A database with a higher `user_version` makes `test.py` exit rather than guess.
5053

@@ -72,7 +75,9 @@ CREATE TABLE if not exists [<branch>] (
7275
verifyfail integer NOT NULL, -- number of variables that differ from the reference
7376
verifytotal integer NOT NULL, -- number of variables compared against the reference
7477
finalphase integer NOT NULL, -- how far the model got, see below
75-
parsing real NOT NULL -- time loading/parsing the library [s]
78+
parsing real NOT NULL, -- time loading/parsing the library [s]
79+
maxrss integer NOT NULL, -- most resident memory of the test at once [bytes]
80+
invalid integer NOT NULL -- 1 if the model needs non-standard Modelica, see below
7681
)
7782
```
7883

‎library.html.tpl‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
<html lang="en">
33
<head>
44
<title>#fileName# test using OpenModelica</title>
5+
<style>
6+
tr.invalid > td:first-child, td.invalid {background-color:#F4A6A6;}
7+
span.cross {color:#D00000; font-weight:bold;}
8+
</style>
59
</head>
610
<body>
711
<h1>#fileName# test using OpenModelica</h1>
812

913
<table>
1014
<tr>
1115
<th>Total</th>
16+
<th title="Models that need non-standard Modelica (--allowNonStandardModelica)">Invalid</th>
1217
<th>Frontend</th>
1318
<th>Backend</th>
1419
<th>SimCode</th>
@@ -19,6 +24,7 @@
1924
</tr>
2025
<tr>
2126
<td>#Total#</td>
27+
<td#InvalidClass#>#Invalid#</td>
2228
<td bgcolor="#FrontendColor#">#Frontend#</td>
2329
<td bgcolor="#BackendColor#">#Backend#</td>
2430
<td bgcolor="#SimCodeColor#">#SimCode#</td>
@@ -51,6 +57,7 @@ Optimization level: #optlevel#</p>
5157
Flags: <pre>#customCommands#</pre>
5258
Config: <pre>#config#</pre>
5359
<p>Links are provided if getErrorString() or the simulation generates output. The links are coded with <font style="#FF0000">red</font> if there were errors, <font style="#FFCC66">yellow</font> if there were warnings, and normal links if there are only notifications.</p>
60+
#invalidNote#
5461
<table>
5562
<tr><th>Model</th><th>Verified</th><th>#simulateLabel#</th>#drHeader#<th>Total buildModel</th><th>Parsing</th><th>Frontend</th><th>Backend</th><th>SimCode</th><th>Templates</th><th>Compile</th><th>Total Execution</th></tr>
5663
#testsHTML#

‎overview.html.tpl‎

Lines changed: 106 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,120 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
46
<title>#title#</title>
57
<style>
6-
td.warning {background-color:#FFCC66;}
7-
td.better {background-color:#00FF00;}
8-
td.warningPerformance {background-color:#FFFC66;}
9-
td.betterPerformance {background-color:#00FAFF;}
10-
a span.tooltip {display:none;}
11-
a:hover span.tooltip {position:fixed;top:30px;left:20px;display:inline;border:2px solid black;background-color:white;}
12-
a.dot {border-bottom: 1px dotted #000; text-decoration: none;}
8+
:root {
9+
--text: #1f2328;
10+
--muted: #59636e;
11+
--border: #d8dee4;
12+
--rule: #eaeef2;
13+
--head: #f3f5f8;
14+
--page: #f6f8fa;
15+
--card: #ffffff;
16+
--accent: #2f6fd0;
17+
--invalid: #f6c3c3;
18+
--invalid-text: #b42318;
19+
}
20+
body {
21+
margin: 0 24px 24px;
22+
background: var(--page);
23+
color: var(--text);
24+
font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
25+
}
26+
a {color: var(--accent); text-decoration: none;}
27+
a:hover {text-decoration: underline;}
28+
h1 {font-size: 20px; margin: 0;}
29+
h2 {font-size: 17px; margin: 24px 0 8px;}
30+
h3 {font-size: 16px; margin: 0 0 4px;}
31+
32+
header.toolbar {
33+
position: sticky; top: 0; z-index: 1;
34+
display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
35+
margin: 0 -24px 16px; padding: 10px 24px;
36+
background: var(--card); border-bottom: 1px solid var(--border);
37+
}
38+
header.toolbar .label {color: var(--muted);}
39+
40+
.switch {display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--card);}
41+
.switch button {
42+
font: inherit; font-size: 13px; padding: 4px 12px; margin: 0;
43+
border: 0; background: transparent; color: var(--text); cursor: pointer;
44+
}
45+
.switch button + button {border-left: 1px solid var(--border);}
46+
.switch button:hover {background: var(--head);}
47+
.switch button[aria-pressed="true"] {background: var(--accent); color: #fff;}
48+
.switch button:focus-visible {outline: 2px solid var(--accent); outline-offset: -2px;}
49+
50+
.stats {display: flex; flex-wrap: wrap; gap: 12px;}
51+
.stat {background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; min-width: 120px;}
52+
.stat .value {display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;}
53+
.stat .name {color: var(--muted);}
54+
.stat.invalid {border-color: var(--invalid);}
55+
.stat.invalid .value {color: var(--invalid-text);}
56+
p.note {color: var(--muted); max-width: 70em;}
57+
58+
table {border-collapse: collapse; margin: 4px 0 12px; background: var(--card); font-variant-numeric: tabular-nums;}
59+
caption {caption-side: top; text-align: left; color: var(--muted); font-size: 12px; padding: 4px 0;}
60+
th, td {padding: 3px 10px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap;}
61+
th {background: var(--head); font-weight: 600; border-bottom: 1px solid var(--border);}
62+
th:first-child, td:first-child {text-align: left;}
63+
table.branches td:nth-child(-n+3) {text-align: left;}
64+
table.versions td, table.versions th {text-align: left;}
65+
td.warning {background-color: #ffd27a;}
66+
td.better {background-color: #9be89b;}
67+
td.warningPerformance {background-color: #FFFC66;}
68+
td.betterPerformance {background-color: #00FAFF;}
69+
.view-invalid th {background: #fbe3e3;}
70+
71+
section.library {background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px 4px; margin: 12px 0;}
72+
section.library table {background: transparent;}
73+
p.version {margin: 0 0 6px; color: var(--muted);}
74+
.badge {display: inline-block; margin: 6px 0; background: var(--invalid); color: var(--invalid-text); font-weight: 600; border-radius: 999px; padding: 2px 10px;}
75+
span.cross {color: #d00000; font-weight: bold;}
76+
details {margin: 4px 0 8px;}
77+
summary {cursor: pointer; color: var(--muted);}
78+
details p {margin: 4px 0 0 16px;}
79+
80+
[data-view] > .view {display: none;}
81+
[data-view="valid"] > .view-valid,
82+
[data-view="all"] > .view-all,
83+
[data-view="invalid"] > .view-invalid {display: block;}
1384
</style>
1485
</head>
1586
<body>
87+
<header class="toolbar">
88+
<h1>#title#</h1>
89+
<span class="label">Invalid models:</span>
90+
#viewSwitch#
91+
</header>
1692
<h2>Statistics</h2>
17-
<table>
18-
<tr><td>Number of libraries</td><td>#numlibs#</td></tr>
19-
<tr><td>Number of models</td><td>#nummodels#</td></tr>
20-
</table>
93+
<div class="stats">
94+
<div class="stat"><span class="value">#numlibs#</span><span class="name">libraries</span></div>
95+
<div class="stat"><span class="value">#nummodels#</span><span class="name">models</span></div>
96+
<div class="stat invalid"><span class="value">#numinvalid#</span><span class="name">invalid models</span></div>
97+
</div>
98+
<p class="note">A model is invalid if the newest run of #invalidBranch# on its library translated it only because
99+
--warnNonStandardModelica turned the errors of non-standard Modelica into warnings. The buttons at the top
100+
select if the counts and times leave the invalid models out (the default), include them, or count only them.</p>
21101
<h2>Tested branches</h2>
22-
<table>
23-
<tr><th>Branch</th><th>Version</th><th>Build time</th><th>Execution time</th><th>Simulation time</th><th>#simulateLabel#</th><th># Verify</th><th># Total</th></tr>
102+
<div id="branches" data-view="valid">
24103
#branches#
25-
</table>
104+
</div>
105+
<h2>Libraries</h2>
26106
#entries#
107+
<script>
108+
for (const button of document.querySelectorAll('.switch button')) {
109+
button.addEventListener('click', () => {
110+
for (const b of button.parentElement.querySelectorAll('button')) {
111+
b.setAttribute('aria-pressed', b === button);
112+
}
113+
for (const container of document.querySelectorAll('[data-view]')) {
114+
container.dataset.view = button.dataset.show;
115+
}
116+
});
117+
}
118+
</script>
27119
</body>
28120
</html>

0 commit comments

Comments
 (0)