Skip to content

Commit 3bcfefd

Browse files
committed
feat(cinder-understack): wire up tests like upstream
We'll want to leverage upstream tests so we need to wire them up using the same libraries they use.
1 parent e341cf2 commit 3bcfefd

File tree

6 files changed

+2752
-145
lines changed

6 files changed

+2752
-145
lines changed

.github/workflows/code-test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ jobs:
5353
python-version-file: python/${{ matrix.project }}/pyproject.toml
5454
- run: uv sync
5555
- run: uv build --wheel
56-
- run: "uv run pytest --cov --cov-report xml:coverage.xml"
56+
- run: |
57+
set -e
58+
if [ -e .stestr.conf ]; then
59+
uv run stestr run
60+
else
61+
uv run pytest --cov --cov-report xml:coverage.xml
62+
fi
5763
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
5864
with:
5965
name: coverage-${{ matrix.project }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.stestr/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[DEFAULT]
2+
test_path=${OS_TEST_PATH:-./cinder_understack/tests}
3+
top_dir=./
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
def test_noop():
2-
pass
1+
from cinder.tests.unit import test
2+
3+
4+
class NoopTestCase(test.TestCase):
5+
def test_noop(self):
6+
pass

python/cinder-understack/pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ classifiers = [
2424
"Programming Language :: Python :: 3.10",
2525
]
2626
dependencies = [
27+
"cinder>=25.0.0,<26",
28+
"oslo.utils>=6.0.0,<8"
2729
]
2830

2931
[project.urls]
3032
Source = "https://github.com/rackerlabs/understack"
3133

3234
[dependency-groups]
3335
test = [
34-
"pytest>=8.3.2,<9",
35-
"pytest-cov>=6.2.1,<7",
36-
"pytest-mock>=3.14.0,<4",
37-
]
36+
"ddt>=1.4.4",
37+
"fixtures>=3.0.0",
38+
"stestr>=3.2.1",
39+
]
3840

3941
[tool.uv]
4042
default-groups = ["test"]

0 commit comments

Comments
 (0)