Skip to content
Open
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
26 changes: 25 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
Contributions are always welcome. Before creating [Pull Requests](https://github.com/52North/WeatherRoutingTool/pulls) or commenting [Issues](https://github.com/52North/WeatherRoutingTool/issues) please carefully read the [Contributing](https://52north.github.io/WeatherRoutingTool/source/guidelines/contribution_guidelines.html) section in our documentation.

Please do not ask if you can work on an issue. Just re-read our documentation and remember that contributions are welcome! Also be aware that we do not assign issues to contributors we have not worked with yet. If this applies to you please do not ask to be assigned.
Please do not ask if you can work on an issue. Just re-read our documentation and remember that contributions are welcome! Also be aware that we do not assign issues to contributors we have not worked with yet. If this applies to you please do not ask to be assigned.

## Running tests

The test suite uses pytest markers to separate fast unit tests from broader integration tests and optional/manual tests.

### Unit tests
```bash
./.venv/bin/pytest -m "unit" -q
```

### Integration tests
```bash
./.venv/bin/pytest -m "integration and not manual and not maripower" -q
```

### Manual tests
```bash
./.venv/bin/pytest -m "manual" -q
```

### Maripower tests
```bash
./.venv/bin/pytest -m "maripower" -q
```
8 changes: 3 additions & 5 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[pytest]

markers =
markers =
unit: fast tests for isolated functions/classes
integration: tests using configs, datasets, or multiple components
genetic: tests for genetic algorithm
maripower: tests that need maripower support
manual: tests that produce figures as output
addopts = -ra --tb=short --strict-markers




2 changes: 2 additions & 0 deletions tests/test_direct_power_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
except ModuleNotFoundError:
pass # maripower installation is optional

pytestmark = pytest.mark.integration


class TestDPM:
'''
Expand Down
2 changes: 2 additions & 0 deletions tests/test_genetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from WeatherRoutingTool.ship.ship_config import ShipConfig
from WeatherRoutingTool.utils.maps import Map

pytestmark = pytest.mark.integration


def test_isofuelpatcher_singleton():
dirname = os.path.dirname(__file__)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_maripower_tanker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
except ModuleNotFoundError:
pass # maripower installation is optional

pytestmark = pytest.mark.integration


@pytest.mark.skip(reason="maripower needs update of requirements.")
# @pytest.mark.skipif(not have_maripower, reason="maripower is not installed")
Expand Down
2 changes: 2 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import WeatherRoutingTool.algorithms.genetic.utils as gen_utils
from WeatherRoutingTool.utils.maps import Map

pytestmark = pytest.mark.unit


def test_get_angle_bins_2greater360():
min_alpha = 380 * u.degree
Expand Down
2 changes: 2 additions & 0 deletions tests/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from WeatherRoutingTool.weather import WeatherCond

pytestmark = pytest.mark.unit


@pytest.mark.parametrize("u,v,theta_res", [(-1, -1, 45), (1, -1, 315), (1, 1, 225), (-1, 1, 135)])
def test_theta_from_uv(u, v, theta_res):
Expand Down