mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 20:07:06 +00:00
Build instructions and fixes
This commit is contained in:
committed by
Tom Wilkie
parent
0e19360215
commit
5ad24319f2
@@ -1,19 +0,0 @@
|
||||
.PHONY: all vet lint build test clean
|
||||
|
||||
all: build test vet lint
|
||||
|
||||
vet:
|
||||
go vet ./...
|
||||
|
||||
lint:
|
||||
golint .
|
||||
|
||||
build:
|
||||
go build
|
||||
|
||||
test:
|
||||
go test
|
||||
|
||||
clean:
|
||||
go clean
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// cmdline is e.g. `fixprobe -publish.interval=10ms fixture.json`
|
||||
// cmdline is e.g. `experimental/fixprobe/fixprobe -publish.interval=10ms fixture.json`
|
||||
func start(t *testing.T, cmdline string) *exec.Cmd {
|
||||
toks := strings.Split(cmdline, " ")
|
||||
if len(toks) <= 0 {
|
||||
@@ -19,7 +19,7 @@ func start(t *testing.T, cmdline string) *exec.Cmd {
|
||||
|
||||
component, args := toks[0], toks[1:]
|
||||
|
||||
relpath := fmt.Sprintf("../%s/%s", component, component)
|
||||
relpath := fmt.Sprintf("../%s", component)
|
||||
|
||||
if _, err := os.Stat(relpath); err != nil {
|
||||
t.Fatalf("%s: %s", component, err)
|
||||
|
||||
@@ -31,22 +31,22 @@ func withContext(t *testing.T, c context, tests ...func()) {
|
||||
|
||||
switch c {
|
||||
case oneProbe:
|
||||
probe := start(t, fmt.Sprintf(`fixprobe -listen=:%d -publish.interval=%s %s/test_single_report.json`, probePort1, publish, cwd()))
|
||||
probe := start(t, fmt.Sprintf(`experimental/fixprobe/fixprobe -listen=:%d -publish.interval=%s %s/test_single_report.json`, probePort1, publish, cwd()))
|
||||
defer stop(t, probe)
|
||||
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
app := start(t, fmt.Sprintf(`app -http.address=:%d -probes=localhost:%d -batch=%s`, appPort, probePort1, batch))
|
||||
app := start(t, fmt.Sprintf(`app/app -http.address=:%d -probes=localhost:%d -batch=%s`, appPort, probePort1, batch))
|
||||
defer stop(t, app)
|
||||
|
||||
case twoProbes:
|
||||
probe1 := start(t, fmt.Sprintf(`fixprobe -listen=:%d -publish.interval=%s %s/test_single_report.json`, probePort1, publish, cwd()))
|
||||
probe1 := start(t, fmt.Sprintf(`experimental/fixprobe/fixprobe -listen=:%d -publish.interval=%s %s/test_single_report.json`, probePort1, publish, cwd()))
|
||||
defer stop(t, probe1)
|
||||
|
||||
probe2 := start(t, fmt.Sprintf(`fixprobe -listen=:%d -publish.interval=%s %s/test_extra_report.json`, probePort2, publish, cwd()))
|
||||
probe2 := start(t, fmt.Sprintf(`experimental/fixprobe/fixprobe -listen=:%d -publish.interval=%s %s/test_extra_report.json`, probePort2, publish, cwd()))
|
||||
defer stop(t, probe2)
|
||||
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
app := start(t, fmt.Sprintf(`app -http.address=:%d -probes=localhost:%d,localhost:%d -batch=%s`, appPort, probePort1, probePort2, batch))
|
||||
app := start(t, fmt.Sprintf(`app/app -http.address=:%d -probes=localhost:%d,localhost:%d -batch=%s`, appPort, probePort1, probePort2, batch))
|
||||
defer stop(t, app)
|
||||
|
||||
default:
|
||||
|
||||
@@ -12,13 +12,12 @@ import (
|
||||
)
|
||||
|
||||
func TestComponentsAreAvailable(t *testing.T) {
|
||||
var pause = 1 * time.Millisecond
|
||||
|
||||
pause := time.Millisecond
|
||||
for _, c := range []string{
|
||||
fmt.Sprintf(`app -http.address=:%d`, appPort),
|
||||
fmt.Sprintf(`bridge -listen=:%d`, bridgePort),
|
||||
fmt.Sprintf(`fixprobe -listen=:%d`, probePort1),
|
||||
fmt.Sprintf(`demoprobe -listen=:%d`, probePort1),
|
||||
fmt.Sprintf(`app/app -http.address=:%d`, appPort),
|
||||
fmt.Sprintf(`experimental/bridge/bridge -listen=:%d`, bridgePort),
|
||||
fmt.Sprintf(`experimental/fixprobe/fixprobe -listen=:%d`, probePort1),
|
||||
fmt.Sprintf(`experimental/demoprobe/demoprobe -listen=:%d`, probePort1),
|
||||
} {
|
||||
cmd := start(t, c)
|
||||
time.Sleep(pause)
|
||||
|
||||
Reference in New Issue
Block a user