From d920083396c03a9f60bede2246294e74ddd5749a Mon Sep 17 00:00:00 2001 From: Enno Hermann Date: Wed, 29 Jan 2025 14:04:14 +0100 Subject: [PATCH] test: move integration tests into separate folder --- .github/workflows/tests.yml | 11 +++++++---- Makefile | 6 ------ .../test_speaker_encoder_train.py | 0 .../test_train_vocoder.py} | 0 .../test_xtts_gpt_train.py | 0 .../test_delightful_tts_layers.py | 0 .../test_feed_forward_layers.py | 0 tests/{tts_tests2 => tts_tests}/test_forward_tts.py | 0 tests/{tts_tests2 => tts_tests}/test_glow_tts.py | 0 tests/tts_tests2/__init__.py | 0 10 files changed, 7 insertions(+), 10 deletions(-) rename tests/{aux_tests => integration}/test_speaker_encoder_train.py (100%) rename tests/{vocoder_tests/test_training.py => integration/test_train_vocoder.py} (100%) rename tests/{xtts_tests => integration}/test_xtts_gpt_train.py (100%) rename tests/{tts_tests2 => tts_tests}/test_delightful_tts_layers.py (100%) rename tests/{tts_tests2 => tts_tests}/test_feed_forward_layers.py (100%) rename tests/{tts_tests2 => tts_tests}/test_forward_tts.py (100%) rename tests/{tts_tests2 => tts_tests}/test_glow_tts.py (100%) delete mode 100644 tests/tts_tests2/__init__.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa01abb874..eb6dde283f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -65,13 +65,12 @@ jobs: fail-fast: false matrix: python-version: ["3.10", "3.12"] - subset: ["test_tts", "test_tts2", "test_vocoder", "test_xtts"] + shard: [0, 1, 2, 3, 4] steps: - uses: actions/checkout@v4 - name: Setup uv uses: ./.github/actions/setup-uv - name: Install Espeak - if: contains(fromJSON('["test_tts", "test_tts2", "test_xtts"]'), matrix.subset) run: | sudo apt-get update sudo apt-get install espeak espeak-ng @@ -87,13 +86,17 @@ jobs: if [[ -n "${{ github.event.inputs.coqpit_branch }}" ]]; then uv add git+https://github.com/idiap/coqui-ai-coqpit --branch ${{ github.event.inputs.coqpit_branch }} fi - - name: Integration tests + - name: Collect tests + run: uv run pytest tests/integration --collect-only --quiet > integration_tests.txt + - name: Integration tests for shard ${{ matrix.shard }} run: | + total_shards=5 + tests=$(awk "NR % $total_shards == ${{ matrix.shard }}" integration_tests.txt) resolution=highest if [ "${{ matrix.python-version }}" == "3.10" ]; then resolution=lowest-direct fi - uv run --resolution=$resolution --extra server --extra languages make ${{ matrix.subset }} + uv run --resolution=$resolution --extra languages pytest $tests - name: Upload coverage data uses: actions/upload-artifact@v4 with: diff --git a/Makefile b/Makefile index d86845ddcf..da714e7b34 100644 --- a/Makefile +++ b/Makefile @@ -15,12 +15,6 @@ test_vocoder: ## run vocoder tests. test_tts: ## run tts tests. coverage run -m pytest -x -v --durations=0 tests/tts_tests -test_tts2: ## run tts tests. - coverage run -m pytest -x -v --durations=0 tests/tts_tests2 - -test_xtts: - coverage run -m pytest -x -v --durations=0 tests/xtts_tests - test_aux: ## run aux tests. coverage run -m pytest -x -v --durations=0 tests/aux_tests diff --git a/tests/aux_tests/test_speaker_encoder_train.py b/tests/integration/test_speaker_encoder_train.py similarity index 100% rename from tests/aux_tests/test_speaker_encoder_train.py rename to tests/integration/test_speaker_encoder_train.py diff --git a/tests/vocoder_tests/test_training.py b/tests/integration/test_train_vocoder.py similarity index 100% rename from tests/vocoder_tests/test_training.py rename to tests/integration/test_train_vocoder.py diff --git a/tests/xtts_tests/test_xtts_gpt_train.py b/tests/integration/test_xtts_gpt_train.py similarity index 100% rename from tests/xtts_tests/test_xtts_gpt_train.py rename to tests/integration/test_xtts_gpt_train.py diff --git a/tests/tts_tests2/test_delightful_tts_layers.py b/tests/tts_tests/test_delightful_tts_layers.py similarity index 100% rename from tests/tts_tests2/test_delightful_tts_layers.py rename to tests/tts_tests/test_delightful_tts_layers.py diff --git a/tests/tts_tests2/test_feed_forward_layers.py b/tests/tts_tests/test_feed_forward_layers.py similarity index 100% rename from tests/tts_tests2/test_feed_forward_layers.py rename to tests/tts_tests/test_feed_forward_layers.py diff --git a/tests/tts_tests2/test_forward_tts.py b/tests/tts_tests/test_forward_tts.py similarity index 100% rename from tests/tts_tests2/test_forward_tts.py rename to tests/tts_tests/test_forward_tts.py diff --git a/tests/tts_tests2/test_glow_tts.py b/tests/tts_tests/test_glow_tts.py similarity index 100% rename from tests/tts_tests2/test_glow_tts.py rename to tests/tts_tests/test_glow_tts.py diff --git a/tests/tts_tests2/__init__.py b/tests/tts_tests2/__init__.py deleted file mode 100644 index e69de29bb2..0000000000