build, lib/model: Add flag to run tests without -short and fix failure (#7716)
This commit is contained in:
parent
fbaf696821
commit
fcb19518c7
11
build.go
11
build.go
|
@ -50,7 +50,9 @@ var (
|
||||||
benchRun string
|
benchRun string
|
||||||
debugBinary bool
|
debugBinary bool
|
||||||
coverage bool
|
coverage bool
|
||||||
|
long bool
|
||||||
timeout = "120s"
|
timeout = "120s"
|
||||||
|
longTimeout = "600s"
|
||||||
numVersions = 5
|
numVersions = 5
|
||||||
withNextGenGUI = os.Getenv("BUILD_NEXT_GEN_GUI") != ""
|
withNextGenGUI = os.Getenv("BUILD_NEXT_GEN_GUI") != ""
|
||||||
)
|
)
|
||||||
|
@ -363,6 +365,7 @@ func parseFlags() {
|
||||||
flag.StringVar(&cc, "cc", os.Getenv("CC"), "Set CC environment variable for `go build`")
|
flag.StringVar(&cc, "cc", os.Getenv("CC"), "Set CC environment variable for `go build`")
|
||||||
flag.BoolVar(&debugBinary, "debug-binary", debugBinary, "Create unoptimized binary to use with delve, set -gcflags='-N -l' and omit -ldflags")
|
flag.BoolVar(&debugBinary, "debug-binary", debugBinary, "Create unoptimized binary to use with delve, set -gcflags='-N -l' and omit -ldflags")
|
||||||
flag.BoolVar(&coverage, "coverage", coverage, "Write coverage profile of tests to coverage.txt")
|
flag.BoolVar(&coverage, "coverage", coverage, "Write coverage profile of tests to coverage.txt")
|
||||||
|
flag.BoolVar(&long, "long", long, "Run tests without the -short flag")
|
||||||
flag.IntVar(&numVersions, "num-versions", numVersions, "Number of versions for changelog command")
|
flag.IntVar(&numVersions, "num-versions", numVersions, "Number of versions for changelog command")
|
||||||
flag.StringVar(&run, "run", "", "Specify which tests to run")
|
flag.StringVar(&run, "run", "", "Specify which tests to run")
|
||||||
flag.StringVar(&benchRun, "bench", "", "Specify which benchmarks to run")
|
flag.StringVar(&benchRun, "bench", "", "Specify which benchmarks to run")
|
||||||
|
@ -374,7 +377,13 @@ func test(tags []string, pkgs ...string) {
|
||||||
lazyRebuildAssets()
|
lazyRebuildAssets()
|
||||||
|
|
||||||
tags = append(tags, "purego")
|
tags = append(tags, "purego")
|
||||||
args := []string{"test", "-short", "-timeout", timeout, "-tags", strings.Join(tags, " ")}
|
args := []string{"test", "-tags", strings.Join(tags, " ")}
|
||||||
|
if long {
|
||||||
|
timeout = longTimeout
|
||||||
|
} else {
|
||||||
|
args = append(args, "-short")
|
||||||
|
}
|
||||||
|
args = append(args, "-timeout", timeout)
|
||||||
|
|
||||||
if runtime.GOARCH == "amd64" {
|
if runtime.GOARCH == "amd64" {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
|
|
|
@ -1472,9 +1472,9 @@ func (m *model) ccCheckEncryption(fcfg config.FolderConfiguration, folderDevice
|
||||||
|
|
||||||
if !(hasTokenRemote || hasTokenLocal) {
|
if !(hasTokenRemote || hasTokenLocal) {
|
||||||
if isEncryptedRemote {
|
if isEncryptedRemote {
|
||||||
return errEncryptionPlainForReceiveEncrypted
|
|
||||||
} else {
|
|
||||||
return errEncryptionPlainForRemoteEncrypted
|
return errEncryptionPlainForRemoteEncrypted
|
||||||
|
} else {
|
||||||
|
return errEncryptionPlainForReceiveEncrypted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue