mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Add test and integration tests to the Makefile (#222)
* Add unit and integration test to make file * Add gitattributes for go.mod/go.sum files * Always run integration tests * Removed redundant call. Clarified targets
This commit is contained in:
parent
46654f1672
commit
2a02e5a65d
4 changed files with 18 additions and 5 deletions
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
go.mod text eol=lf
|
||||||
|
go.sum text eol=lf
|
||||||
|
|
@ -16,7 +16,7 @@ before_install:
|
||||||
script:
|
script:
|
||||||
#- make lint
|
#- make lint
|
||||||
#- make vet
|
#- make vet
|
||||||
- go test -mod=vendor
|
- make it
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- if [ "$TRAVIS_BRANCH" = "develop" ]; then export TAG_SUFFIX="_dev"; fi
|
- if [ "$TRAVIS_BRANCH" = "develop" ]; then export TAG_SUFFIX="_dev"; fi
|
||||||
- export STASH_VERSION="v0.0.0-alpha${TAG_SUFFIX}"
|
- export STASH_VERSION="v0.0.0-alpha${TAG_SUFFIX}"
|
||||||
|
|
|
||||||
10
Makefile
10
Makefile
|
|
@ -34,6 +34,16 @@ vet:
|
||||||
lint:
|
lint:
|
||||||
revive -config revive.toml -exclude ./vendor/... ./...
|
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
|
.PHONY: ui
|
||||||
ui:
|
ui:
|
||||||
cd ui/v2 && yarn build
|
cd ui/v2 && yarn build
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,14 @@ package manager
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/stashapp/stash/pkg/ffmpeg"
|
|
||||||
"github.com/stashapp/stash/pkg/logger"
|
|
||||||
"github.com/stashapp/stash/pkg/utils"
|
|
||||||
"math"
|
"math"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/stashapp/stash/pkg/ffmpeg"
|
||||||
|
"github.com/stashapp/stash/pkg/logger"
|
||||||
|
"github.com/stashapp/stash/pkg/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GeneratorInfo struct {
|
type GeneratorInfo struct {
|
||||||
|
|
@ -84,7 +85,7 @@ func (g *GeneratorInfo) configure() error {
|
||||||
// Something seriously wrong with this file
|
// Something seriously wrong with this file
|
||||||
if numberOfFrames == 0 || !utils.IsValidFloat64(framerate) {
|
if numberOfFrames == 0 || !utils.IsValidFloat64(framerate) {
|
||||||
logger.Errorf(
|
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,
|
videoStream.NbFrames,
|
||||||
framerate,
|
framerate,
|
||||||
g.VideoFile.Duration,
|
g.VideoFile.Duration,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue