You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer_resources.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,24 @@
2
2
3
3
## Tests
4
4
5
-
Tests are run with pytest, e.g.,
5
+
Run the unit and integration tests with the following command. We recommend using `make test` to run the tests that do not require simulation or compilation.
6
6
7
7
```bash
8
-
poetry run pytest
8
+
make test
9
+
```
10
+
11
+
This runs tests that do not require simulation or compilation in parallel. The
12
+
following additional targets run resource-intensive tests serially:
13
+
14
+
```bash
15
+
# OpenModelica simulations and compilations in Docker
16
+
make test-resource-intensive
17
+
18
+
# Fast tests followed by the Docker tests
19
+
make test-all
20
+
21
+
# Dymola-only tests; requires a local Dymola installation and license
22
+
make test-resources-intensive-dymola
9
23
```
10
24
11
25
## Snapshot Testing
@@ -52,12 +66,12 @@ Follow the instructions below in order to configure your local environment:
52
66
- For developers, dependency management is through [Poetry](https://python-poetry.org/docs/). Poetry can be acquired by running `pip install poetry`.
53
67
- If you haven't already installed a virtual environment, Poetry will automatically create a simplified environment for your project.
54
68
- Move to the GMT root directory and run `poetry install` to install the dependencies.
55
-
- Verify that everything is installed correctly by running `poetry run pytest -m 'not compilation and not simulation and not dymola'`. This will run all the unit and integration tests.
69
+
- Verify that everything is installed correctly by running `make test`. This runs all unit and integration tests that do not require simulation or compilation.
56
70
- Follow the instructions below to install pre-commit.
57
71
- To confirm that models will build and simulate, you can run
58
72
59
73
```bash
60
-
poetry run pytest -m 'not dymola' --cov-report term-missing --cov .
74
+
make test-all
61
75
```
62
76
63
77
The tests should all pass assuming the libraries, Docker, and all dependencies are installed correctly on your computer. Also, there will be a set
The default tag will be `nrel/gmt-om-runner:4.0.0`, which is the default version used in the modelica_runner.py file.
25
25
26
+
If you run the image directly with a bind mount, note that the image runs as `root` so it can access the pre-installed Modelica libraries under `/root/.openmodelica`.
27
+
28
+
The GMT `ModelicaRunner` passes `HOST_UID`/`HOST_GID` into the container and `chown`s the mounted `/mnt/shared/<model_name>` directory at the end of the run so generated files are accessible on the host.
29
+
26
30
### Versioning
27
31
28
32
In GMT Runner Version 2.0.0 we detached the OM version from the GMT Runner version.
0 commit comments