Skip to content

Commit 623f9e9

Browse files
CopilotJaclynCodes
andauthored
Add CI caching and parallel test execution support (#186)
* Initial plan * Add performance optimizations to project configuration - Add pip dependency caching in GitHub Actions workflow - Enable pytest strict mode and configure cache directory - Add pytest-xdist for parallel test execution - Update test requirements with pytest-xdist Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com> * Remove duplicate pytest options from workflow Move all pytest options to pytest.ini to avoid duplication and ensure consistency Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com> * Remove --cache-clear flag to improve test performance Allow pytest to utilize its cache for better performance instead of clearing it on every run Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com> * Add documentation for pytest strict mode flags Add comments explaining the purpose of --strict-markers and --strict-config flags Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com> * Add markers section to pytest.ini for strict mode Add workflow, integration, and unit markers to satisfy --strict-markers requirement Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
1 parent 8c6370c commit 623f9e9

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.github/workflows/blank.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
uses: actions/setup-python@v6
3232
with:
3333
python-version: '3.12'
34+
cache: 'pip'
35+
cache-dependency-path: |
36+
requirements.txt
37+
tests/requirements.txt
3438
3539
# Install dependencies
3640
- name: Install dependencies
@@ -50,7 +54,7 @@ jobs:
5054
# Run tests with pytest
5155
- name: Run tests with pytest
5256
run: |
53-
python -m pytest tests/ -v --tb=short
57+
python -m pytest tests/
5458
5559
# Runs a single command using the runners shell
5660
- name: Run a one-line script

pytest.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,12 @@ testpaths = tests
33
python_files = test_*.py
44
python_classes = Test*
55
python_functions = test_*
6-
addopts = -v --tb=short
6+
# strict-markers: Ensures all markers are registered in pytest config
7+
# strict-config: Raises errors on unknown config options
8+
# These flags help catch configuration issues early
9+
addopts = -v --tb=short --strict-markers --strict-config
10+
cache_dir = .pytest_cache
11+
markers =
12+
workflows: marks tests as workflow tests
13+
integration: marks tests as integration tests
14+
unit: marks tests as unit tests

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"dev": [
5454
"pytest>=7.0.0",
5555
"pytest-cov>=3.0.0",
56+
"pytest-xdist>=3.0.0", # Parallel test execution
5657
"PyYAML>=5.1",
5758
],
5859
},

tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Test dependencies for Symphonic-Joules
22
pytest>=7.0.0
33
pytest-cov>=3.0.0
4+
pytest-xdist>=3.0.0 # Parallel test execution for faster CI builds
45
PyYAML>=5.1
56

67
# Dependencies needed for testing audio and energy modules

0 commit comments

Comments
 (0)