Skip to content

Commit 5e8f845

Browse files
committed
sync with unit tests
1 parent b51f095 commit 5e8f845

File tree

3 files changed

+51
-36
lines changed

3 files changed

+51
-36
lines changed

.ci/install-project.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ pip install -e ".[test]"
2828
# Verify installation
2929
echo "Verifying installation..."
3030
python -c "import tritonparse; print(f'tritonparse installed successfully')"
31-
python -c "import pytest; print(f'pytest version: {pytest.__version__}')"
31+
python -c "import coverage; print(f'coverage version: {coverage.__version__}')"
3232

3333
echo "Project installation completed successfully!"

.ci/run-tests.sh

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,66 @@ conda activate "$CONDA_ENV"
2929
# export TORCHINDUCTOR_FX_GRAPH_CACHE=0
3030
# export TRITONPARSE_DEBUG=1
3131

32-
# Build pytest command
33-
PYTEST_CMD="python -m unittest tests.test_tritonparse"
34-
35-
# Add verbose flag
36-
if [ "$VERBOSE" = "true" ]; then
37-
PYTEST_CMD="$PYTEST_CMD -v"
38-
fi
39-
40-
# Add coverage if requested
41-
if [ "$COVERAGE" = "true" ]; then
42-
PYTEST_CMD="$PYTEST_CMD --cov=tritonparse --cov-report=xml"
43-
fi
44-
45-
# Run tests based on type
32+
# Build unittest command based on test type
4633
case "$TEST_TYPE" in
4734
"cpu")
4835
echo "Running CPU tests only..."
49-
$PYTEST_CMD -m "not cuda"
36+
if [ "$COVERAGE" = "true" ]; then
37+
echo "Running with coverage..."
38+
if [ "$VERBOSE" = "true" ]; then
39+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU -v
40+
else
41+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU
42+
fi
43+
coverage report
44+
coverage xml
45+
else
46+
if [ "$VERBOSE" = "true" ]; then
47+
python -m unittest tests.test_tritonparse.TestTritonparseCPU -v
48+
else
49+
python -m unittest tests.test_tritonparse.TestTritonparseCPU
50+
fi
51+
fi
5052
;;
5153
"cuda")
5254
echo "Running CUDA tests only..."
5355
export CUDA_VISIBLE_DEVICES=0
54-
$PYTEST_CMD -m cuda
56+
if [ "$COVERAGE" = "true" ]; then
57+
echo "Running with coverage..."
58+
if [ "$VERBOSE" = "true" ]; then
59+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
60+
else
61+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA
62+
fi
63+
coverage report
64+
coverage xml
65+
else
66+
if [ "$VERBOSE" = "true" ]; then
67+
python -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
68+
else
69+
python -m unittest tests.test_tritonparse.TestTritonparseCUDA
70+
fi
71+
fi
5572
;;
5673
"all")
5774
echo "Running all tests..."
5875
export CUDA_VISIBLE_DEVICES=0
59-
$PYTEST_CMD
76+
if [ "$COVERAGE" = "true" ]; then
77+
echo "Running with coverage..."
78+
if [ "$VERBOSE" = "true" ]; then
79+
coverage run -m unittest tests.test_tritonparse -v
80+
else
81+
coverage run -m unittest tests.test_tritonparse
82+
fi
83+
coverage report
84+
coverage xml
85+
else
86+
if [ "$VERBOSE" = "true" ]; then
87+
python -m unittest tests.test_tritonparse -v
88+
else
89+
python -m unittest tests.test_tritonparse
90+
fi
91+
fi
6092
;;
6193
*)
6294
echo "Unknown test type: $TEST_TYPE"

pyproject.toml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ dependencies = [
1111

1212
[project.optional-dependencies]
1313
test = [
14-
"pytest>=7.0.0",
15-
"pytest-cov>=4.0.0",
16-
"pytest-xdist>=3.0.0",
14+
"coverage>=7.0.0",
1715
]
1816

1917
[tool.setuptools.packages.find]
@@ -26,20 +24,5 @@ line-length = 88
2624
line-length = 88
2725
target-version = ["py310"]
2826

29-
[tool.pytest.ini_options]
30-
testpaths = ["tests"]
31-
python_files = ["test_*.py"]
32-
python_classes = ["Test*"]
33-
python_functions = ["test_*"]
34-
addopts = [
35-
"-v",
36-
"--tb=short",
37-
"--strict-markers",
38-
"--disable-warnings",
39-
]
40-
markers = [
41-
"cuda: mark test as requiring CUDA",
42-
]
43-
4427
[project.urls]
4528
"Homepage" = "https://github.com/pytorch-labs/tritonparse"

0 commit comments

Comments
 (0)