Skip to content

Commit 50bbec7

Browse files
committed
fix appveyor build problem
1 parent df2f8ec commit 50bbec7

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.appveyor.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ os:
55
Windows Server 2012 R2
66

77
clone_folder:
8-
C:\go\src\github.com\fstab\grok_exporter
8+
C:\grok_exporter
99

1010
environment:
11-
PATH: c:\go\bin;C:\msys64\mingw64\bin;%PATH%
11+
PATH: C:\go\bin;C:\msys64\mingw64\bin;%PATH%
1212
GOPATH: c:\go
1313
CC: x86_64-w64-mingw32-gcc
1414
CGO_ENABLED: 1
@@ -48,22 +48,13 @@ install:
4848
# --------------------------------------------------------------------------
4949

5050
build_script:
51-
- cd c:\go\src\github.com\fstab\grok_exporter
51+
- cd c:\grok_exporter
5252
- git submodule update --init --recursive
5353
- set GO111MODULE=on
5454
- go version
55-
- go test github.com/fstab/grok_exporter
56-
- go test github.com/fstab/grok_exporter/config
57-
- go test github.com/fstab/grok_exporter/config/v1
58-
- go test github.com/fstab/grok_exporter/config/v2
59-
- go test github.com/fstab/grok_exporter/exporter
60-
- go test github.com/fstab/grok_exporter/oniguruma
61-
- go test github.com/fstab/grok_exporter/tailer
62-
- go test github.com/fstab/grok_exporter/tailer/fswatcher
63-
- go test github.com/fstab/grok_exporter/tailer/glob
64-
- go test github.com/fstab/grok_exporter/template
65-
- go install github.com/fstab/grok_exporter
66-
- C:\cygwin\bin\bash -c "cd /cygdrive/c/go/src/github.com/fstab/grok_exporter ; PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./integration-test.sh"
55+
- go test ./...
56+
- go install
57+
- C:\cygwin\bin\bash -c "cd /cygdrive/c/grok_exporter ; PATH='/usr/sbin:/usr/bin:/sbin:/bin' ./integration-test.sh"
6758

6859
# Print the linked DLLs, so we can check that grok_exporter does not have
6960
# a runtime dependency on Oniguruma.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: go
22

33
go:
4-
- "1.12"
4+
- "1.13"
55

66
os:
77
- linux

exporter/patterns_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/fstab/grok_exporter/oniguruma"
1919
"os"
2020
"path/filepath"
21+
"regexp"
2122
"testing"
2223
)
2324

@@ -30,8 +31,14 @@ func loadPatternDir(t *testing.T) *Patterns {
3031
if len(*p) != 0 {
3132
t.Errorf("Expected initial pattern list to be empty, but got len = %v\n", len(*p))
3233
}
33-
patternDir := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "fstab", "grok_exporter", "logstash-patterns-core", "patterns")
34-
err := p.AddDir(patternDir)
34+
// patternDir := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "fstab", "grok_exporter", "logstash-patterns-core", "patterns")
35+
pwd, err := os.Getwd()
36+
if err != nil {
37+
t.Fatalf("failed to get the current working directory: %v", err)
38+
}
39+
pwd = regexp.MustCompile("grok_exporter.*").ReplaceAllString(pwd, "grok_exporter") // if in a subdirectory, go up to the project root
40+
patternDir := filepath.Join(pwd, "logstash-patterns-core", "patterns")
41+
err = p.AddDir(patternDir)
3542
if err != nil {
3643
t.Errorf("Unexpected error: %v", err.Error())
3744
}

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ require (
88
github.com/sirupsen/logrus v1.4.2
99
gopkg.in/yaml.v2 v2.2.2
1010
)
11+
12+
go 1.13

0 commit comments

Comments
 (0)