Skip to content

Commit 9319a79

Browse files
committed
sync with unit tests
1 parent 044421c commit 9319a79

File tree

2 files changed

+50
-18
lines changed

2 files changed

+50
-18
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"

0 commit comments

Comments
 (0)