Skip to content

psundstrom/ExampleTestLibrary

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExampleTestLibrary

This repository contains an example library with Modelica model regression tests. Some of the tests reference external data that is stored on the file system in a relative path to the expected working directory (in this case ../Data). The Modelica models are structured in a main "CustomerLibrary" with component and test case models. A second library named "LocalTests" contains the running simulation models. These would contain any specific configurations for the running simulations. The third library named "RegressionTests" contains the regression test models that extend from test cases in "LocalTests" and also extend from the "Regression Test Library".

There are two separate regression test run configurations. One of these is for dymosim based tests (ExampleTestLibrary/LibraryConfig/test_mtt_default.yaml) and the other is for FMU based tests (ExampleTestLibrary/LibraryConfig/test_mtt_fmu_64.yaml). In the FMU based tests for this example, the FMUs are generated by Dymola but simulated by JModelica. The "Groovy" scripts that are used by Jenkins to execute the tests are TestingMTT/LibraryConfig/Jenkinsfile-default.groovy and TestingMTT/LibraryConfig/Jenkinsfile-FMU.groovy. These reference each of the YAML files respectively (on line 27 of the Groovy scripts). The other content of the Groovy script that needs customization for the specific Jenkins server are "oct_home" (the path to the OCT installation), "mtt_home" (the path to the MTT installation), "mtt_egg" (the path to the MTT Python egg file), "repo_path" (the GitHub URL to the repository), and "yaml_file" (the relative path to the yaml configuration file within the repository, e.g. ExampleTestLibrary\LibraryConfig\test_mtt_default.yaml)

In Jenkins, separate Multibranch Pipeline jobs are created for each run configuration (dymosim and FMU in this case). For each job, the GitHub Branch Source type is selected (presumably Git could be used for other cloud based Git repos). Appropriate credentials and the repository https URL specified (e.g. https://github.com/modelon-community/JenkinsTest.git/) are also added in the GitHub Branch Source. Finally the path to the Groovy script within the repository (e.g. TestingMTT/LibraryConfig/Jenkinsfile-default.groovy) is specified in the Script Path under Build Configuration.

In GitHub, an appropriate Webhook needs to be added to trigger the Jenkins jobs on push events. This is specified in the Payload URL box under the Webhooks section of the repository Settings. The URL normally includes the Jenkins URL followed by "github-webhook" (e.g. http://b827d28d7bf3.ngrok.io/github-webhook/).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 55.9%
  • Groovy 22.4%
  • Modelica 21.7%