-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
97 lines (83 loc) · 2.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# go option
GO ?= go
TAGS :=
BUILDFLAGS := -race
TESTS := ./...
TESTFLAGS := -race
LDFLAGS :=
GOFLAGS :=
BINARIES := sstables
VERSION := v1.7.0
# Required for globs to work correctly
SHELL=/bin/bash
.DEFAULT_GOAL := unit-test
.PHONY: compile-proto
compile-proto:
@echo
@echo "==> Compiling Protobuf files <=="
protoc --go_out=. --go_opt=paths=source_relative recordio/test_files/text_line.proto
protoc --go_out=. --go_opt=paths=source_relative simpledb/proto/wal_mutation.proto
protoc --go_out=. --go_opt=paths=source_relative simpledb/proto/compaction_metadata.proto
protoc --go_out=. --go_opt=paths=source_relative wal/test_files/seq_number.proto
protoc --go_out=. --go_opt=paths=source_relative _examples/proto/hello_world.proto
protoc --go_out=. --go_opt=paths=source_relative _examples/proto/mutation.proto
protoc --go_out=. --go_opt=paths=source_relative sstables/proto/sstable.proto
.PHONY: release
release:
@echo
@echo "==> Preparing the release $(VERSION) <=="
go mod tidy
git tag ${VERSION}
.PHONY: bench
bench:
$(GO) test -v -benchmem -bench=RecordIO ./benchmark
$(GO) test -v -benchmem -bench=SSTable ./benchmark
.PHONY: bench-simpledb
bench-simpledb:
$(GO) test -v -benchmem -bench=SimpleDB ./benchmark
.PHONY: unit-test
unit-test:
@echo
@echo "==> Building <=="
$(GO) build $(BUILDFLAGS) -race $(TESTS)
@echo "==> Running unit tests <=="
$(GO) clean -testcache
$(GO) test $(GOFLAGS) $(TESTFLAGS) $(TESTS)
# separately test simpledb, because the race detector
# increases the runtime of the end2end tests too much (10-20m)
# the race-simpledb target can be used to test that
$(GO) test -v --tags simpleDBe2e $(GOFLAGS) ./simpledb
.PHONY: race-simpledb
race-simpledb:
@echo
@echo "==> Running simpledb race tests <=="
$(GO) clean -testcache
$(GO) test -v -timeout 30m --tags simpleDBe2e $(GOFLAGS) ./simpledb $(TESTFLAGS)
.PHONY: crash-simpledb
crash-simpledb:
@echo
@echo "==> Running simpledb crash tests <=="
$(GO) clean -testcache
$(GO) test -v -timeout 30m --tags simpleDBcrash $(GOFLAGS) ./simpledb/_crash_tests $(TESTFLAGS)
.PHONY: linear-simpledb
linear-simpledb:
@echo
@echo "==> Running simpledb linearizability tests <=="
$(GO) clean -testcache
$(GO) test -v -timeout 30m --tags simpleDBlinear $(GOFLAGS) ./simpledb/porcupine $(TESTFLAGS)
.PHONY: example-test
example-test:
/bin/bash test_examples.sh
.PHONY: generate-test-files
generate-test-files:
@echo
@echo "==> Generate Test Files <=="
$(GO) clean -testcache
export generate_compatfiles=true && $(GO) test $(GOFLAGS) $(TESTS) -run .*TestGenerateTestFiles.*
.PHONY: vet
vet:
@echo
@echo "==> Go vet <=="
$(GO) vet $(TESTS)
.PHONY: test
test: vet unit-test linear-simpledb race-simpledb crash-simpledb