Skip to content

Commit 8f75857

Browse files
stephane-caronStéphane Caron
authored andcommitted
WIP: Separate testing for coverage and loaders
1 parent d73af27 commit 8f75857

File tree

3 files changed

+83
-22
lines changed

3 files changed

+83
-22
lines changed

.github/workflows/test.yml

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,9 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
test:
12-
name: "${{ matrix.os }}, python-${{ matrix.python-version }}"
13-
runs-on: ${{ matrix.os }}
14-
15-
env:
16-
USING_COVERAGE: "3.8"
17-
18-
strategy:
19-
matrix:
20-
os: [ubuntu-latest]
21-
python-version: ["3.7", "3.8", "3.9", "3.10"]
11+
coverage:
12+
name: "Coverage"
13+
runs-on: ubuntu-latest
2214

2315
steps:
2416
- name: "Checkout sources"
@@ -27,22 +19,67 @@ jobs:
2719
- name: "Set up Python"
2820
uses: actions/setup-python@v4
2921
with:
30-
python-version: "${{ matrix.python-version }}"
22+
python-version: "3.8"
3123

3224
- name: "Install dependencies"
3325
run: |
34-
python -m pip install --upgrade pip
35-
python -m pip install coverage coveralls flake8 flit mccabe mypy pylint pytest tox tox-gh-actions
26+
python -m pip install -U pip tox tox-gh-actions
3627
37-
- name: "Run tox targets for ${{ matrix.python-version }}"
28+
- name: "Check coverage"
3829
run: |
39-
tox
40-
env:
41-
PLATFORM: ${{ matrix.os }}
30+
tox -e coverage
4231
4332
- name: "Coveralls"
4433
env:
4534
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4635
run: |
4736
coveralls --service=github
48-
if: ${{ runner.os == 'Linux' && contains(env.USING_COVERAGE, matrix.python-version) }}
37+
38+
lint:
39+
name: "Code style"
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: "Checkout sources"
44+
uses: actions/checkout@v3
45+
46+
- name: "Set up Python"
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: "3.8"
50+
51+
- name: "Install dependencies"
52+
run: |
53+
python -m pip install -U pip tox tox-gh-actions
54+
55+
- name: "Check code format"
56+
run: |
57+
tox -e lint
58+
59+
loaders:
60+
name: "Loader: ${{ matrix.loader }}"
61+
runs-on: ubuntu-latest
62+
63+
strategy:
64+
matrix:
65+
python-version: ["3.8"]
66+
loader: ["mujoco", "pinocchio", "pybullet", "robomeshcat", "yourdfpy"]
67+
68+
steps:
69+
- name: "Checkout sources"
70+
uses: actions/checkout@v3
71+
72+
- name: "Set up Python"
73+
uses: actions/setup-python@v4
74+
with:
75+
python-version: "${{ matrix.python-version }}"
76+
77+
- name: "Install dependencies"
78+
run: |
79+
python -m pip install -U pip tox tox-gh-actions
80+
81+
- name: "Run loader tests"
82+
run: |
83+
tox -e loaders
84+
env:
85+
LOADER: ${{ matrix.loader }}

tests/__init__.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
# Make sure Python treats the test directory as a package.
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2022 Stéphane Caron
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
from .test_cache import TestCache
19+
from .test_descriptions import TestDescriptions
20+
from .test_loaders import TestLoaders
21+
22+
__all__ = [
23+
"TestCache",
24+
"TestDescriptions",
25+
"TestLoaders",
26+
]

tests/loaders/test_mujoco.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import unittest
2020

2121
from robot_descriptions._descriptions import DESCRIPTIONS
22-
from robot_descriptions.loaders.mujoco import load_robot_description
2322

23+
from robot_descriptions.loaders.mujoco import load_robot_description
2424

2525
class TestMuJoCo(unittest.TestCase):
2626

@@ -50,7 +50,6 @@ def test(self):
5050

5151
return test
5252

53-
5453
for name, description in DESCRIPTIONS.items():
5554
if description.has_mjcf:
5655
setattr(

0 commit comments

Comments
 (0)