Build instructions and fixes

This commit is contained in:
Peter Bourgon
2015-05-12 19:18:37 +02:00
committed by Tom Wilkie
parent 0e19360215
commit 5ad24319f2
12 changed files with 2046 additions and 2899 deletions

View File

@@ -1,18 +1,32 @@
.PHONY: all build static test clean
.PHONY: all build client static dist test clean
APP=app/app
FIXPROBE=experimental/fixprobe/fixprobe
all: build
build: static
build:
go build ./...
client:
cd client && make build && rm -f dist/.htaccess
static:
go get github.com/mjibson/esc
cd client && make build && rm -f dist/.htaccess
cd app && esc -o static.go -prefix ../client/dist ../client/dist
test:
dist: client static build
test: ${APP} ${FIXPROBE}
# app and fixprobe needed for integration tests
go test ./...
${APP}:
cd app && go build
${FIXPROBE}:
cd experimental/fixprobe && go build
clean:
go clean ./...

View File

@@ -1,3 +1,32 @@
# Scope
## Overview
TODO
## Developing
### Building
To build everything in-place,
```
make build
```
Note that this doesn't build or include the latest version of the user
interface. The UI is decoupled, living in `client` and following a node/gulp
workflow. To build that and include it in the application binary,
```
make client
make static
make build
```
Or, as a shortcut,
```
make dist
```

View File

@@ -1,24 +0,0 @@
.PHONY: all vet lint build test clean static
all: build test vet lint
vet:
go vet ./...
lint:
golint .
build:
go build
test:
go test
clean:
go clean
static:
go get github.com/mjibson/esc
cd ../client && make build && rm -f dist/.htaccess
esc -o static.go -prefix ../client/dist ../client/dist
${MAKE} build

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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

View File

@@ -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)

View File

@@ -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:

View File

@@ -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)