Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions .CI/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pipeline {

booleanParam(name: 'v1_26', defaultValue: false, description: 'maintenance/v1.26 branch (ryzen-5950x-1)')
booleanParam(name: 'v1_27', defaultValue: false, description: 'maintenance/v1.27 branch (ryzen-5950x-1)')
booleanParam(name: 'master', defaultValue: false, description: 'master branch, simulated with the solver each model asks for, filling master (ryzen-5950x-1).')
booleanParam(name: 'master', defaultValue: false, description: 'master branch, simulated with the solver each model asks for, filling master (ryzen-9950x).')

booleanParam(name: 'fmi_v1_26', defaultValue: false, description: 'maintenance/v1.26 branch with FMI, simulated by OMSimulator, filling v1.26-fmi (ryzen-5950x-2). Ticking it together with fmpy_fmi_v1_26 runs one job that builds every FMU once and simulates it with both.')
booleanParam(name: 'fmi_v1_27', defaultValue: false, description: 'maintenance/v1.27 branch with FMI, simulated by OMSimulator, filling v1.27-fmi (ryzen-5950x-2). Ticking it together with fmpy_fmi_v1_27 runs one job that builds every FMU once and simulates it with both.')
Expand Down Expand Up @@ -41,9 +41,10 @@ pipeline {
booleanParam(name: 'heavy_tests_wasm', defaultValue: false, description: 'heavy_tests with --simCodeTarget=wasm-jit, filling heavy_tests_wasm (r7945). Its results are in the heavy_tests report. This is an experimental job that does not run on a fixed schedule.')

string(name: 'pull_request', defaultValue: '', description: 'Test an OpenModelica pull request rather than a branch: its number, e.g. 16354. omc is built from refs/pull/<N>/merge - the pull request as it would land - the results fill a pr-<N> table, and the report compares them against the newest run of pull_request_baseline. Left empty, nothing of this runs.')
string(name: 'pull_request_baseline', defaultValue: 'master', description: 'The branch a pull request is compared against. Its newest run has to come from pull_request_node, or the report compares the machines as much as the pull request.')
choice(name: 'pull_request_target', choices: ['wasm-jit', 'C'], description: 'The --simCodeTarget a pull request is simulated with. wasm-jit is the cheaper run and is compared against the wasm-jit job; C against master.')
string(name: 'pull_request_baseline', defaultValue: '', description: 'The branch a pull request is compared against. Left empty, the one pull_request_target is tested by: wasm-jit for wasm-jit, master for C. Its newest run has to come from pull_request_node, or the report compares the machines as much as the pull request.')
string(name: 'pull_request_config', defaultValue: 'configs/conf.json', description: 'What a pull request run tests. A full run takes days, so a smaller configuration file is often the better question to ask.')
choice(name: 'pull_request_node', choices: ['ryzen-5950x-1', 'ryzen-5950x-2-1', 'ryzen-9950x'], description: 'The machine a pull request runs on. The default is the one that produces the master runs it is compared against.')
choice(name: 'pull_request_node', choices: ['ryzen-9950x', 'ryzen-5950x-1', 'ryzen-5950x-2-1'], description: 'The machine a pull request runs on. The default is the one that produces the master and wasm-jit runs it is compared against.')
booleanParam(name: 'pull_request_comment', defaultValue: false, description: 'Post the summary of a pull request run as a comment on the pull request, replacing the one an earlier run posted. Needs an OpenModelica-Hudson credential; without it the report is still written and published, only not commented.')
booleanParam(name: 'drop_stale_pull_request_tables', defaultValue: false, description: 'Drop the pr-<N> tables of pull requests that have been merged or closed, and of those tested more than 60 days ago. The reports published for them are not touched.')
}
Expand Down Expand Up @@ -145,7 +146,7 @@ pipeline {
stage('pull request') {
agent {
node {
label "${params.pull_request_node ?: 'ryzen-5950x-1'}"
label "${params.pull_request_node ?: 'ryzen-9950x'}"
customWorkspace 'ws/OpenModelicaLibraryTestingWork'
}
}
Expand Down Expand Up @@ -176,7 +177,15 @@ pipeline {
find "$HOME/saved_omc/pr" -mindepth 1 -maxdepth 1 -type d -mtime +14 -exec rm -rf {} ";" 2> /dev/null || true
find "$HOME/saved_omc" -mindepth 1 -maxdepth 1 -name "pr-*" -type d -mtime +14 -exec rm -rf {} ";" || true
'''
runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", '', '', false, '', '', false, false, 0, params.pull_request_config ?: 'configs/conf.json')
script {
def config = params.pull_request_config ?: 'configs/conf.json'
if (pullRequestTarget() == 'C') {
runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", '', '', false, '', '', false, false, 0, config)
} else {
runRegressiontest("pr/${pullRequest()}", "pr/${pullRequest()}", 'setCommandLineOptions("--simCodeTarget=wasm-jit")', '', false, '', '--nobuildmodel', false, false, 0, config,
wasmCmakeFlags())
}
}
}
}

Expand Down Expand Up @@ -691,7 +700,7 @@ pipeline {
}
}
sh 'rm -rf history'
sh "./pr-report.py '${pullRequest()}' --baseline='${(params.pull_request_baseline ?: 'master').trim()}'"
sh "./pr-report.py '${pullRequest()}' --baseline='${pullRequestBaseline()}'"
// Uploaded before it is announced, as the branch reports are: the
// comment links to the report, and nothing after this may be what stops
// it from being published.
Expand Down Expand Up @@ -725,6 +734,14 @@ def pullRequest() {
return (params.pull_request ?: '').trim()
}

def pullRequestTarget() {
return params.pull_request_target ?: 'wasm-jit'
}

def pullRequestBaseline() {
return (params.pull_request_baseline ?: '').trim() ?: (pullRequestTarget() == 'C' ? 'master' : 'wasm-jit')
}

/**
* The cores of the node a build is running on, physical and logical, asked for
* the way the OpenModelica job asks (numPhysicalCPU in .CI/common.groovy
Expand Down Expand Up @@ -1162,9 +1179,10 @@ def runRegressiontest(branch, name, extraFlags, omsHash, omcompiler, extrasimfla
export OPENMODELICAHOME="`pwd`/build"

git rev-parse --verify HEAD > .newhash
# Part of the stamp rather than the commit alone: a build/ cached from the other build system is
# not what this job would produce for the same commit.
# Part of the stamp rather than the commit alone: a build/ cached from the other build system, or
# with other cmake flags, is not what this job would produce for the same commit.
echo "${useCMake ? 'cmake' : 'autotools'}" >> .newhash
${cmakeFlags ? "echo '${cmakeFlags}' >> .newhash" : ''}
echo New Hash:
cat .newhash
echo Old Hash:
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,14 @@ builds every model once and simulates it with each.

A branch is tested against its own previous run, which says what broke *after* a
change was merged. A pull request can be tested before that, against the newest
run of `master`.
run of `wasm-jit`, or of `master` when it is simulated with the C target.

In Jenkins, set the **`pull_request`** parameter to the pull request number and
start the job; `pull_request_baseline`, `pull_request_config` and
`pull_request_node` say what it is compared against, what it tests and where.
start the job; `pull_request_target` says which `--simCodeTarget` it is
simulated with (`wasm-jit` by default, which is the cheaper run), and
`pull_request_baseline`, `pull_request_config` and `pull_request_node` what it
is compared against, what it tests and where. The baseline defaults to the job
testing that target.
None of the branch jobs run unless their own parameter is ticked as well.

By hand it is two steps. The compiler is built from the merge ref - the pull
Expand All @@ -439,18 +442,19 @@ request as it would land, not the branch on its own - and the run fills a
```bash
git fetch --force https://github.com/OpenModelica/OpenModelica.git refs/pull/<N>/merge
git checkout -f --detach FETCH_HEAD
# build omc, then
./test.py --branch=pr/<N> configs/conf.json
# build omc with -DOM_OMC_ENABLE_RUST=ON, then
./test.py --branch=pr/<N> --nobuildmodel \
--extraflags='--simCodeTarget=wasm-jit' configs/conf.json
```

`pr/<N>` rather than `pr-<N>`: the pull requests sit together in one directory
of `branches/`, which otherwise holds branches. It is the one job name that
keeps the directory part of its name - `maintenance/v1.27` is tested as `v1.27`.

The report compares that run against the newest run of `master`:
The report compares that run against the newest run of `wasm-jit`:

```bash
./pr-report.py <N> # --baseline=master by default
./pr-report.py <N> # --baseline=wasm-jit by default; master for C
```

It writes `history/pr/<N>/<baseline run>..<pull request run>.html`, the same
Expand Down
4 changes: 2 additions & 2 deletions pr-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
all-reports.py reports a branch against its own previous run, which is what a
pull request must not do: pr-<N> has no previous run, and the question is not
"what changed since yesterday" but "what does this pull request change against
master". The comparison itself is the same one - the phase a model reached and
wasm-jit (or master)". The comparison itself is the same one - the phase a model reached and
what each phase cost - only the two runs it is given come from two branches.
"""

Expand All @@ -17,7 +17,7 @@

parser = argparse.ArgumentParser(description='OpenModelica library testing pull request report')
parser.add_argument('pullrequest', help='the pull request number, or its branch name pr/<N>')
parser.add_argument('--baseline', default="master", help='the branch the pull request is compared against')
parser.add_argument('--baseline', default="wasm-jit", help='the branch the pull request is compared against; master for a run with the C target')
parser.add_argument('--date', type=int, default=0, help='the pull request run to report on (default: its newest)')
parser.add_argument('--baselinedate', type=int, default=0, help='the baseline run to compare against (default: its newest)')
parser.add_argument('--baseurl', default="http://libraries.openmodelica.org/branches")
Expand Down
Loading