-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.toml
46 lines (37 loc) · 916 Bytes
/
Makefile.toml
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
[tasks.db-up]
script = ["docker compose up --detach", "sleep 3"]
[tasks.db-up-test]
script = [
"dotenvy -f .env_files/test.env docker compose up --detach",
"sleep 3",
]
[tasks.run-server]
script = ["cargo run &", "echo $! > server.pid"]
[tasks.run-server-test]
script = [
"dotenvy -f .env_files/test-server.env cargo run &",
"echo $! > server.pid",
]
[tasks.run-tests]
script = ["cargo test", "sleep 1"]
[tasks.wait-for-server]
script = [
"until nc -z -v -w5 localhost 8080; do",
" echo 'Waiting for server to start on port 8080...'",
" sleep 1",
"done",
]
[tasks.kill-server]
script = ["kill $(cat server.pid)", "rm server.pid"]
[tasks.db-down]
script = ["docker compose down"]
[tasks.full-test]
dependencies = [
"db-up-test",
"run-server-test",
"wait-for-server",
"run-tests",
"kill-server",
]
[tasks.full-clean]
script = ["docker rmi ratings-postgres --force", "cargo clean"]