Skip to content

Commit 87ff22e

Browse files
samanklesariapearu
andauthored
Enable integration tests (#4092)
* Enable integration tests * Remove test/torchcodec --------- Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
1 parent 7260d09 commit 87ff22e

File tree

3 files changed

+74
-67
lines changed

3 files changed

+74
-67
lines changed
Lines changed: 74 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,74 @@
1-
# name: Integration Test
2-
3-
# on:
4-
# pull_request:
5-
# branches: [ main ]
6-
7-
# workflow_dispatch:
8-
9-
# jobs:
10-
# build:
11-
12-
# runs-on: ubuntu-22.04
13-
# strategy:
14-
# fail-fast: false
15-
# matrix:
16-
# python-version: [ 3.9 ]
17-
18-
# steps:
19-
# - uses: actions/checkout@v2
20-
# - name: Set up Python ${{ matrix.python-version }}
21-
# uses: actions/setup-python@v2
22-
# with:
23-
# python-version: ${{ matrix.python-version }}
24-
# - name: Install dependencies
25-
# run: |
26-
# sudo apt install -y -qq libavfilter-dev libavdevice-dev
27-
# - name: Install packages
28-
# run: |
29-
# python -m pip install --quiet --upgrade pip
30-
# python -m pip install --quiet --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
31-
# python -m pip install --quiet pytest requests cmake ninja deep-phonemizer sentencepiece flashlight-text git+https://github.com/kpu/kenlm
32-
# python -m pip install . -v --no-build-isolation
33-
# - name: Run integration test
34-
# run: |
35-
# cd test && pytest integration_tests -v --use-tmp-hub-dir
1+
name: Integration tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
python-version: ["3.11"]
14+
ffmpeg-version: ["7"]
15+
fail-fast: false
16+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
17+
permissions:
18+
id-token: write
19+
contents: read
20+
with:
21+
runner: linux.12xlarge
22+
repository: pytorch/audio
23+
gpu-arch-type: cpu
24+
gpu-arch-version:
25+
timeout: 120
26+
job-name: linux-cpu
27+
28+
script: |
29+
set -ex
30+
# Set up Environment Variables
31+
export PYTHON_VERSION="${{ matrix.python-version }}"
32+
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
33+
export PIP_PROGRESS_BAR=off
34+
export CONDA_QUIET=1
35+
36+
# Set UPLOAD_CHANNEL
37+
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
38+
export UPLOAD_CHANNEL=test
39+
else
40+
export UPLOAD_CHANNEL=nightly
41+
fi
42+
43+
echo "::group::Create conda env"
44+
# Mark Build Directory Safe
45+
git config --global --add safe.directory /__w/audio/audio
46+
conda create -c conda-forge --strict-channel-priority -y -n ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja
47+
conda activate ci_env
48+
conda info
49+
ffmpeg -version
50+
python -m pip install --upgrade pip
51+
# We add conda library path as otherwise torchcodec is not
52+
# able to load ffmpeg shared libraries:
53+
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}
54+
echo "::endgroup::"
55+
56+
echo "::group::Install TorchAudio integration test and PyTorch dependencies"
57+
python -m pip install parameterized pytest numpy expecttest
58+
echo "::endgroup::"
59+
60+
echo "::group::Install PyTorch and TorchCodec"
61+
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cpu"
62+
python -m pip install --pre torch torchcodec --index-url="${PYTORCH_WHEEL_INDEX}"
63+
python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}")'
64+
python -c 'import torchcodec; print(f"{torchcodec.__version__}"); print(f"{torchcodec.__file__}")'
65+
echo "::endgroup::"
66+
67+
echo "::group::Build and install TorchAudio"
68+
python -m pip install . -v --no-build-isolation
69+
echo "::endgroup::"
70+
71+
echo "::group::Run TorchAudio integration tests"
72+
python -m pip install deep-phonemizer sentencepiece flashlight-text git+https://github.com/kpu/kenlm
73+
pytest test/integration_tests/ -x --use-tmp-hub-dir
74+
echo "::endgroup::"

test/torchcodec/decoders.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/torchcodec/encoders.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)