mirror of
https://github.com/Luzifer/duplicity-backup.git
synced 2024-11-08 15:10:06 +00:00
Fix tests
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c315e35161
commit
c6d5a68e2b
4 changed files with 6 additions and 14 deletions
8
Makefile
8
Makefile
|
@ -14,13 +14,7 @@ setup-testenv:
|
|||
gometalinter --install --update
|
||||
|
||||
test:
|
||||
ginkgo
|
||||
gometalinter \
|
||||
--cyclo-over=15 \
|
||||
--deadline=20s \
|
||||
--exclude=bindata.go \
|
||||
--exclude=configfile_test.go \
|
||||
-D errcheck
|
||||
go test -v
|
||||
|
||||
install:
|
||||
go install -a -ldflags "-X main.version=$(shell git describe --tags || git rev-parse --short HEAD || echo dev)"
|
||||
|
|
|
@ -63,7 +63,7 @@ type configFile struct {
|
|||
} `yaml:"swift"`
|
||||
Include []string `yaml:"inclist"`
|
||||
Exclude []string `yaml:"exclist"`
|
||||
IncExcFile string `yaml:"incexcfile" valid:"customFileExistsValidator,required"`
|
||||
IncExcFile string `yaml:"incexcfile" valid:"customFileExistsValidator"`
|
||||
ExcludeDeviceFiles bool `yaml:"excdevicefiles"`
|
||||
Encryption struct {
|
||||
Enable bool `yaml:"enable"`
|
||||
|
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"regexp"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
@ -30,7 +29,6 @@ logdir: /var/log/duplicity/
|
|||
|
||||
var (
|
||||
commandLine, env, argv []string
|
||||
logFilter *regexp.Regexp
|
||||
loadErr, err error
|
||||
t string
|
||||
cf *configFile
|
||||
|
@ -42,7 +40,7 @@ logdir: /var/log/duplicity/
|
|||
if loadErr != nil {
|
||||
panic(loadErr)
|
||||
}
|
||||
commandLine, env, logFilter, err = cf.GenerateCommand(argv, t)
|
||||
commandLine, env, _, err = cf.GenerateCommand(argv, t)
|
||||
})
|
||||
|
||||
Context("Backup with given config", func() {
|
||||
|
|
6
main.go
6
main.go
|
@ -39,8 +39,7 @@ var (
|
|||
)
|
||||
|
||||
func initCFG() {
|
||||
var err error
|
||||
if err = rconfig.Parse(&cfg); err != nil {
|
||||
if err := rconfig.Parse(&cfg); err != nil {
|
||||
log.WithError(err).Fatal("Error while parsing arguments")
|
||||
}
|
||||
|
||||
|
@ -55,6 +54,7 @@ func initCFG() {
|
|||
log.Fatalf("Unable to parse log level: %s", err)
|
||||
}
|
||||
|
||||
var err error
|
||||
if cfg.ConfigFile, err = homedir.Expand(cfg.ConfigFile); err != nil {
|
||||
log.WithError(err).Fatal("Unable to expand config-file")
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ func main() {
|
|||
}
|
||||
|
||||
// Initialize logfile
|
||||
if err := os.MkdirAll(config.LogDirectory, 0750); err != nil {
|
||||
if err = os.MkdirAll(config.LogDirectory, 0750); err != nil {
|
||||
log.WithError(err).Fatal("Unable to create log dir")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue