diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 977fdfd0c..f288ccf29 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,8 +19,8 @@ jobs: include: - name: linux-amd64 cmd: >- - make linux-amd64 && make static-test && make check && make - ci-lexicons + make linux-amd64 && make test-vod && make static-test && make + check && make ci-lexicons - name: linux-arm64 cmd: "make linux-arm64" - name: windows-amd64 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62e5ae62a..87db46a4c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,7 +71,7 @@ builder-rebuild: script: - rm -rf /usr/x86_64-w64-mingw32/include/d3dcompiler.h /usr/share/mingw-w64/include/d3dcompiler.h /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libssp.dll.a /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libssp-0.dll /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libssp-0.dll /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libssp.dll.a - git fetch --unshallow || echo 'already unshallow' - - bash -c "make version && make $TARGET && make desktop-$TARGET && make pkg-$TARGET && make ci-upload-node-$TARGET -j$(nproc)" + - bash -c "make version && make $TARGET && make test-vod && make desktop-$TARGET && make pkg-$TARGET && make ci-upload-node-$TARGET -j$(nproc)" artifacts: reports: dotenv: .ci/build.env diff --git a/Makefile b/Makefile index a4fce7feb..b8d0e4b2e 100644 --- a/Makefile +++ b/Makefile @@ -272,6 +272,14 @@ static-test: && PKG_CONFIG_PATH=$(shell realpath $(BUILDDIR)/meson-uninstalled) \ bash -euo pipefail -c "go test -p 1 -timeout 300s ./pkg/... -v | tee /dev/stderr | go-junit-report -out test.xml" +# Run `streamplace vod-test` against a known set of fixture VODs using +# the static binary at ./build-linux-amd64/streamplace. Skips cleanly +# on cross-compiled targets where the amd64 binary can't run on the +# build host. Driven by hack/test-vod.sh. +.PHONY: test-vod +test-vod: + bash hack/test-vod.sh + # _____ ________ __ # | __ \| ____\ \ / / # | | | | |__ \ \ / / diff --git a/hack/test-vod.sh b/hack/test-vod.sh new file mode 100755 index 000000000..1863826a6 --- /dev/null +++ b/hack/test-vod.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -euo pipefail + +# Smoke test: run `streamplace vod-test` against a list of fixture VODs +# using a built static binary. Used in CI right after `make linux-amd64` +# to catch crashes (gstreamer plugin bugs, codec mishandling, etc.) +# that the Go test suite can miss when it isn't actually linking against +# the static gstreamer-full plugin set. +# +# Each fixture is "/", matching the layout used by +# pkg/test/remote/RemoteFixture. Files are cached at +# ~/.streamplace-test-cache//, same as the Go helper. +# +# Skips cleanly if the binary isn't present — we only run on the +# linux-amd64 build host; other targets cross-compile and can't +# execute the produced binary. + +BIN="${1:-./build-linux-amd64/streamplace}" +CACHE_DIR="${HOME}/.streamplace-test-cache" +FIXTURE_URL="https://storage.googleapis.com/streamplace-fixtures" + +FIXTURES=( + "8d03302f5fcf2b5e13e2be48af5340dbd28b2d77ac1875a693c52adff45438c4/THE-FINALS-2026-05-16-7-44-18-PM.h264.tiny.10s.mp4" + "eb34493396ec3606e3f6d5543c7f695b6ec4b8959c083ffbd04623ea16ed9598/RocketLeague_30s_1sGOP-1080p60_NoBframes.mp4" +) + +if [ ! -x "$BIN" ]; then + echo "test-vod: $BIN not found, skipping (cross-compiled target?)" + exit 0 +fi + +mkdir -p "$CACHE_DIR" + +for fixture in "${FIXTURES[@]}"; do + hash="${fixture%%/*}" + filename="${fixture#*/}" + target_dir="$CACHE_DIR/$hash" + target_path="$target_dir/$filename" + + if [ ! -f "$target_path" ]; then + echo "=== test-vod: downloading $filename ===" + mkdir -p "$target_dir" + tmp_path="$target_path.download" + curl -fsSL "$FIXTURE_URL/$fixture" -o "$tmp_path" + actual_hash=$(sha256sum "$tmp_path" | awk '{print $1}') + if [ "$actual_hash" != "$hash" ]; then + rm -f "$tmp_path" + echo "test-vod: hash mismatch for $filename: expected $hash got $actual_hash" >&2 + exit 1 + fi + mv "$tmp_path" "$target_path" + fi + + echo "=== test-vod: $filename ===" + "$BIN" vod-test "$target_path" +done + +echo "test-vod: all fixtures passed" diff --git a/pkg/media/vod_pipeline_test.go b/pkg/media/vod_pipeline_test.go index dba517708..fb7979980 100644 --- a/pkg/media/vod_pipeline_test.go +++ b/pkg/media/vod_pipeline_test.go @@ -92,7 +92,7 @@ func TestRunVODPipeline_h264AAC_TheFinals(t *testing.T) { defer cancel() ctx = log.WithLogValues(ctx, "test", "TestRunVODPipeline_h264AAC_TheFinals") - fixture, err := os.ReadFile(remote.RemoteFixture("fc0911e573e846532982a8069bbf1829b73818dd08e536f48039eed8cfab454e/THE-FINALS-2026-05-16-7-44-18-PM.h264.tiny.mp4")) + fixture, err := os.ReadFile(remote.RemoteFixture("8d03302f5fcf2b5e13e2be48af5340dbd28b2d77ac1875a693c52adff45438c4/THE-FINALS-2026-05-16-7-44-18-PM.h264.tiny.10s.mp4")) require.NoError(t, err) out := &bytes.Buffer{}