diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..4fea60b95 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +go.mod text eol=lf +go.sum text eol=lf \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d6f23d5b7..2c51b94a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: script: #- make lint #- make vet -- go test -mod=vendor +- make it before_deploy: - if [ "$TRAVIS_BRANCH" = "develop" ]; then export TAG_SUFFIX="_dev"; fi - export STASH_VERSION="v0.0.0-alpha${TAG_SUFFIX}" diff --git a/Makefile b/Makefile index 0cc0a180f..dd9f8336d 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,16 @@ vet: lint: revive -config revive.toml -exclude ./vendor/... ./... +# runs unit tests - excluding integration tests +.PHONY: test +test: + go test -mod=vendor ./... + +# runs all tests - including integration tests +.PHONY: it +it: + go test -mod=vendor -tags=integration ./... + .PHONY: ui ui: cd ui/v2 && yarn build diff --git a/pkg/manager/generator.go b/pkg/manager/generator.go index 4859a6406..53d5a92f5 100644 --- a/pkg/manager/generator.go +++ b/pkg/manager/generator.go @@ -3,13 +3,14 @@ package manager import ( "bytes" "fmt" - "github.com/stashapp/stash/pkg/ffmpeg" - "github.com/stashapp/stash/pkg/logger" - "github.com/stashapp/stash/pkg/utils" "math" "os/exec" "runtime" "strconv" + + "github.com/stashapp/stash/pkg/ffmpeg" + "github.com/stashapp/stash/pkg/logger" + "github.com/stashapp/stash/pkg/utils" ) type GeneratorInfo struct { @@ -84,7 +85,7 @@ func (g *GeneratorInfo) configure() error { // Something seriously wrong with this file if numberOfFrames == 0 || !utils.IsValidFloat64(framerate) { logger.Errorf( - "number of frames or framerate is 0. nb_frames <%s> framerate <%s> duration <%s>", + "number of frames or framerate is 0. nb_frames <%s> framerate <%f> duration <%f>", videoStream.NbFrames, framerate, g.VideoFile.Duration,