Separate tests and build tags for CI
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
DataHoarder 2022-11-13 13:58:02 +01:00
parent db68a6c26d
commit 3d5d705361
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
4 changed files with 89 additions and 10 deletions

View file

@ -6,6 +6,7 @@ platform:
arch: amd64
environment:
GOPROXY: direct
GOARCH: amd64
GOAMD64: v3
GOOS: linux
@ -24,7 +25,9 @@ steps:
image: alpine
commands:
- apk update
- apk add --no-cache wget bash
- apk add --no-cache wget bash git git-lfs
- git lfs install
- git lfs pull
- ./testdata/prepare.sh
- name: build-x264
image: alpine
@ -33,13 +36,21 @@ steps:
- apk add --no-cache git gcc g++ musl-dev bash make libtool nasm
- cd /tmp
- git clone --depth 1 --branch stable https://code.videolan.org/videolan/x264.git && cd x264 && ./configure --disable-cli --disable-ffms --disable-lavf --disable-swscale --enable-static --bit-depth=all --chroma-format=all --enable-lto --enable-pic --disable-opencl --prefix=/drone/src/build_deps && make -j$(nproc) && make install && cd ..
- name: build-vmaf-libaom
- name: build-vmaf
image: alpine
commands:
- apk update
- apk add --no-cache git gcc g++ musl-dev bash cmake make libtool meson ccache nasm perl xxd pkgconfig
- cd /tmp
- git clone --depth 1 --branch v2.3.1 https://github.com/Netflix/vmaf.git && cd vmaf/libvmaf && meson setup build . --prefix /drone/src/build_deps --buildtype release -Denable_float=true -Dbuilt_in_models=true && ninja -vC build && ninja -vC build install && cd ../..
- name: build-libaom
image: alpine
depends_on:
- build-vmaf
commands:
- apk update
- apk add --no-cache git gcc g++ musl-dev bash cmake make libtool ccache nasm perl xxd pkgconfig
- cd /tmp
- git clone --depth 1 --branch v3.5.0 https://aomedia.googlesource.com/aom.git && cd aom && mkdir b && cd b && cmake .. -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -D CMAKE_INSTALL_PREFIX:PATH=/drone/src/build_deps -DENABLE_DOCS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_TOOLS=OFF -DENABLE_TESTS=OFF -DENABLE_CCACHE=ON -DCONFIG_FRAME_PARALLEL_ENCODE=1 -DCONFIG_AV1_TEMPORAL_DENOISING=1 -DCONFIG_BITRATE_ACCURACY=1 -DCONFIG_TUNE_VMAF=1 -DCONFIG_NN_V2=1 -DCONFIG_RT_ML_PARTITIONING=1 -DCONFIG_THREE_PASS=1 -DCONFIG_AV1_ENCODER=1 -DCONFIG_AV1_DECODER=1 && make -j$(nproc) && make install && cd ..
- name: build-dav1d
image: alpine
@ -48,11 +59,57 @@ steps:
- apk add --no-cache git gcc g++ musl-dev bash libtool meson ccache nasm pkgconfig
- cd /tmp
- git clone --depth 1 --branch 1.0.0 https://code.videolan.org/videolan/dav1d.git && cd dav1d && meson setup build . --prefix /drone/src/build_deps --buildtype release --default-library=static && ninja -vC build && ninja -vC build install && cd ..
- name: test-cgo-short
- name: test-nocgo-short
image: golang:1.19-alpine
depends_on:
- prepare-testdata
commands:
- apk update
- apk add --no-cache git
- CGO_ENABLED=0 go test -p 1 -failfast -timeout 60m -cover -gcflags=-d=checkptr -v ./... -test.short
- name: test-cgo-libdav1d-long
image: golang:1.19-alpine
depends_on:
- build-dav1d
- prepare-testdata
commands:
- apk update
- apk add --no-cache git gcc musl-dev pkgconfig
- go test -p 1 -failfast -timeout 60m -cover -gcflags=-d=checkptr -v -tags=disable_library_libaom,disable_library_libx264,disable_library_libvmaf ./decoder/libdav1d
- name: test-cgo-libaom-long
image: golang:1.19-alpine
depends_on:
- build-libaom
- prepare-testdata
commands:
- apk update
- apk add --no-cache git gcc musl-dev pkgconfig
- go test -p 1 -failfast -timeout 60m -cover -gcflags=-d=checkptr -v -tags=disable_library_libdav1d,disable_library_libx264,disable_library_libvmaf ./encoder/libaom
- name: test-cgo-libx264-long
image: golang:1.19-alpine
depends_on:
- build-x264
- build-vmaf-libaom
- prepare-testdata
commands:
- apk update
- apk add --no-cache git gcc musl-dev pkgconfig
- go test -p 1 -failfast -timeout 60m -cover -gcflags=-d=checkptr -v -tags=disable_library_libdav1d,disable_library_libaom,disable_library_libvmaf ./encoder/libx264
- name: test-cgo-libvmaf-long
image: golang:1.19-alpine
depends_on:
- build-dav1d
- build-vmaf
- prepare-testdata
commands:
- apk update
- apk add --no-cache git gcc musl-dev pkgconfig
- go test -p 1 -failfast -timeout 60m -cover -gcflags=-d=checkptr -v -tags=disable_library_libaom,disable_library_libx264 ./utilities/libvmaf
- name: test-cgo-full-short
image: golang:1.19-alpine
depends_on:
- build-x264
- build-vmaf
- build-libaom
- build-dav1d
- prepare-testdata
commands:

View file

@ -13,6 +13,9 @@ func TestVersion(t *testing.T) {
}
func TestDecodeYUV420_8bit(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
f, err := os.Open(testdata.AV1_Sintel_Trailer_720p24_YUV420_8bit_Low)
if err != nil {
t.Fatal(err)

View file

@ -47,11 +47,11 @@ func TestEncode(t *testing.T) {
settings["threads"] = runtime.NumCPU()
settings["row-mt"] = 1
settings["cpu-used"] = 8
settings["use-16bit-internal"] = 1
//settings["use-16bit-internal"] = 1
settings["frame-parallel"] = 1
settings["lag-in-frames"] = 12
settings["tile-columns"] = 4
settings["tile-rows"] = 4
settings["lag-in-frames"] = 2
settings["tile-columns"] = 1
settings["tile-rows"] = 1
if encoder, err := NewEncoder(target, stream.Properties(), settings); err != nil {
t.Fatal(err)

View file

@ -7,6 +7,7 @@ import (
"git.gammaspectra.live/S.O.N.G/Ignite/decoder/y4m"
"git.gammaspectra.live/S.O.N.G/Ignite/testdata"
"os"
"sync"
"testing"
)
@ -14,7 +15,10 @@ func TestVersion(t *testing.T) {
t.Logf("vmaf version: %s", Version())
}
func TestDecodeYUV420_8bit(t *testing.T) {
func TestVMAFYUV420_8bit(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
referenceFile, err := os.Open(testdata.Y4M_Sintel_Trailer_720p24_YUV420_8bit)
if err != nil {
t.Fatal(err)
@ -38,10 +42,24 @@ func TestDecodeYUV420_8bit(t *testing.T) {
}
defer distortedDecoder.Close()
distortedStreams := distortedDecoder.DecodeStream().Copy(2)
encoded := 0
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
for range distortedStreams[0].Channel() {
if encoded%10 == 0 {
t.Logf("frame %d/1253", encoded)
}
encoded++
}
}()
if vmaf, err := New(0, NewModelDefault()); err != nil {
t.Fatal(err)
} else {
frameCount, err := vmaf.ReadStreams(referenceDecoder.DecodeStream(), distortedDecoder.DecodeStream())
frameCount, err := vmaf.ReadStreams(referenceDecoder.DecodeStream(), distortedStreams[1])
if err != nil {
t.Fatal(err)
}
@ -61,5 +79,6 @@ func TestDecodeYUV420_8bit(t *testing.T) {
t.Fatal(err)
}
t.Logf("mean score: %f", score)
wg.Wait()
}
}