diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index a02586bd..6f15f343 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -8,10 +8,13 @@ on: branches: - main +permissions: + contents: read + jobs: e2e: runs-on: ${{ matrix.os }} - name: Run + name: Run (${{ matrix.os }}) strategy: matrix: os: [ubuntu-latest, macos-latest] @@ -27,3 +30,23 @@ jobs: - name: Run E2E tests run: ./scripts/run-e2e.sh + + e2e-freebsd: + runs-on: ubuntu-latest + name: Run (freebsd) + steps: + - uses: actions/checkout@v6 + + - name: Run E2E tests in FreeBSD + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + copyback: false + prepare: | + pkg install -y bash cmake curl python314 uv + run: | + export UV_PYTHON=/usr/local/bin/python3.14 + export UV_PYTHON_DOWNLOADS=never + cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_AGGRESSIVE_OPT=ON + cmake --build build -j$(sysctl -n hw.ncpu) + R2H_E2E_NO_DEV=1 ./scripts/run-e2e.sh diff --git a/e2e/helpers/constants.py b/e2e/helpers/constants.py index b9853f30..7dc7ec36 100644 --- a/e2e/helpers/constants.py +++ b/e2e/helpers/constants.py @@ -9,5 +9,5 @@ BINARY_PATH = PROJECT_ROOT / "build" / "rtp2httpd" FIXTURES_DIR = PROJECT_ROOT / "tools" / "fixtures" -LOOPBACK_IF = "lo0" if sys.platform == "darwin" else "lo" +LOOPBACK_IF = "lo0" if sys.platform == "darwin" or sys.platform.startswith("freebsd") else "lo" MCAST_ADDR = "239.255.0.1" diff --git a/scripts/run-e2e.sh b/scripts/run-e2e.sh index 35c4a34e..346190b0 100755 --- a/scripts/run-e2e.sh +++ b/scripts/run-e2e.sh @@ -11,6 +11,7 @@ # ./scripts/run-e2e.sh -m "not multicast"# Skip multicast tests # ./scripts/run-e2e.sh -x # Stop on first failure # ./scripts/run-e2e.sh --co # Collect & list tests (dry run) +# R2H_E2E_NO_DEV=1 ./scripts/run-e2e.sh # Skip dependency-group dev tools # set -euo pipefail @@ -91,8 +92,13 @@ echo "" cd "$PROJECT_ROOT" +UV_RUN_CMD=(uv run) +if [[ "${R2H_E2E_NO_DEV:-0}" == "1" ]]; then + UV_RUN_CMD+=(--no-dev) +fi + if [[ "$PARALLEL" == "1" ]]; then - exec uv run pytest "$TEST_PATH" -v "${PYTEST_ARGS[@]+"${PYTEST_ARGS[@]}"}" + exec "${UV_RUN_CMD[@]}" pytest "$TEST_PATH" -v "${PYTEST_ARGS[@]+"${PYTEST_ARGS[@]}"}" else - exec uv run pytest "$TEST_PATH" -v -n "$PARALLEL" --dist loadscope "${PYTEST_ARGS[@]+"${PYTEST_ARGS[@]}"}" + exec "${UV_RUN_CMD[@]}" pytest "$TEST_PATH" -v -n "$PARALLEL" --dist loadscope "${PYTEST_ARGS[@]+"${PYTEST_ARGS[@]}"}" fi diff --git a/tools/devlab/devlab.py b/tools/devlab/devlab.py index 875f9b5d..04c7c594 100644 --- a/tools/devlab/devlab.py +++ b/tools/devlab/devlab.py @@ -756,8 +756,7 @@ def build_services_m3u(http_hostport: str, rtsp_hostport: str, mcast_channels: l # mpegts-over-RTSP live + RTSP TS catchup window: covers mpegts 回看 src = f"rtsp://{rtsp_hostport}/catchup/{prof}?{tpl}" extinf = ( - f'#EXTINF:-1 group-title="mpegts (RTSP)" catchup="default" ' - f'catchup-source="{src}",mpegts (RTSP) ({prof})' + f'#EXTINF:-1 group-title="mpegts (RTSP)" catchup="default" catchup-source="{src}",mpegts (RTSP) ({prof})' ) lines += [ extinf,