-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
170 lines (132 loc) · 4.81 KB
/
makefile
File metadata and controls
170 lines (132 loc) · 4.81 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
.PHONY: build
format:
cargo fmt --all
.PHONY: docs.install
docs.install:
pnpm --dir docs install
.PHONY: docs.dev
docs.dev:
pnpm --dir docs dev --host
.PHONY: docs.build
docs.build:
pnpm --dir docs build
.PHONY: docs.preview
docs.preview: docs.build
pnpm --dir docs preview --host
.PHONY: lints
lints:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# build for kafka
.PHONY: build.kafka
build.kafka:
docker compose down -v
docker compose up -d --build init-kafka --wait
# For tests that need postgres
.PHONY: build.sql
build.sql:
docker compose down -v
docker compose up --build postgres --wait
.PHONY: test.sql
test.sql:
cargo test -p scouter-sql test_postgres --all-features -- --nocapture --test-threads=1
.PHONY: test.server
test.server:
cargo test -p scouter-server --all-features -- --nocapture --test-threads=1 --skip test_storage_integration_cloud
.PHONY: test.server.archive.agent
test.server.archive.agent:
cargo test -p scouter-server test_data_archive_agent --all-features -- --nocapture --test-threads=1
.PHONY: test.server.cloud
test.server.cloud: build.all_backends
cargo test -p scouter-server test_storage_integration_cloud --all-features -- --nocapture --test-threads=1
.PHONY: test.drift.executor
test.drift.executor:
cargo test -p scouter-drift test_drift_executor --all-features -- --nocapture --test-threads=1
.PHONY: test.needs_sql
test.needs_sql: test.sql test.server test.evaluate test.drift.executor
#### Unit tests
.PHONY: test.types
test.types:
cargo test -p scouter-types --all-features -- --nocapture --test-threads=1
#### agent profile tests
.PHONY: test.agent
test.agent:
cargo test -p scouter-types test_agent --all-features -- --nocapture --test-threads=1
.PHONY: test.dispatch
test.dispatch:
cargo test -p scouter-dispatch -- --nocapture --test-threads=1
.PHONY: test.drift
test.drift:
cargo test -p scouter-drift --all-features -- --nocapture --test-threads=1 --skip test_drift_executor
.PHONY: test.profile
test.profile:
cargo test -p scouter-profile -- --nocapture --test-threads=1
.PHONY: test.unit
test.unit: test.types test.dispatch test.drift test.profile
.PHONY: test.kafka_events
test.kafka_events:
cargo run --example kafka_integration --all-features -- --nocapture
.PHONY: test.redis_events
test.redis_events:
cargo run --example redis_integration --all-features -- --nocapture
.PHONY: test.rabbitmq_events
test.rabbitmq_events:
cargo run --example rabbitmq_integration --all-features -- --nocapture
.PHONY: test.events
test.events: test.kafka_events test.rabbitmq_events
test.evaluate: test.evaluate
cargo test -p scouter-evaluate -- --nocapture --test-threads=1
.PHONY: test.dataframe
test.dataframe:
cargo test -p scouter-dataframe -- --nocapture --test-threads=1
.PHONY: test.dataframe.cloud.gcs
test.dataframe.cloud.gcs:
cargo test -p scouter-dataframe test_trace_service_gcs_integration \
--all-features -- --nocapture --test-threads=1
.PHONY: test.dataframe.cloud.s3
test.dataframe.cloud.s3:
cargo test -p scouter-dataframe test_trace_service_s3_integration \
--all-features -- --nocapture --test-threads=1
.PHONY: test.dataframe.cloud.azure
test.dataframe.cloud.azure:
cargo test -p scouter-dataframe test_trace_service_azure_integration \
--all-features -- --nocapture --test-threads=1
.PHONY: test
test: build.all_backends test.needs_sql test.unit build.shutdown
###### Server tests
.PHONY: build.all_backends
build.all_backends:
docker compose down -v
docker compose up --build server-backends --wait
.PHONE: start.server
start.server: stop.server build.all_backends
export KAFKA_BROKERS=localhost:9092 && \
export RABBITMQ_ADDR=amqp://guest:guest@127.0.0.1:5672/%2f && \
export REDIS_ADDR=redis://127.0.0.1:6379 && \
cargo build -p scouter-server --all-features && \
./target/debug/scouter-server &
.PHONY: build.shutdown_backends
build.shutdown:
docker compose down -v
.PHONY: start.server.http
start.server.http: stop.server build.all_backends
export KAFKA_BROKERS=localhost:9092 && \
export RABBITMQ_ADDR=amqp://guest:guest@127.0.0.1:5672/%2f && \
export REDIS_ADDR=redis://127.0.0.1:6379 && \
cargo build -p scouter-server --all-features && \
./target/debug/scouter-server --mode http &
.PHONY: start.server.grpc
start.server.grpc: stop.server build.all_backends
export KAFKA_BROKERS=localhost:9092 && \
export RABBITMQ_ADDR=amqp://guest:guest@127.0.0.1:5672/%2f && \
export REDIS_ADDR=redis://127.0.0.1:6379 && \
cargo build -p scouter-server --all-features && \
./target/debug/scouter-server --mode grpc &
.PHONE: stop.server
stop.server:
-lsof -ti:8000 | xargs kill -9 2>/dev/null || true
-lsof -ti:50051 | xargs kill -9 2>/dev/null || true
.PHONY: changelog
prepend.changelog:
# get version from Cargo.toml
@VERSION=$(shell grep '^version =' Cargo.toml | cut -d '"' -f 2) && \
git cliff --unreleased --tag $$VERSION --prepend CHANGELOG.md