-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (38 loc) · 1.93 KB
/
Makefile
File metadata and controls
50 lines (38 loc) · 1.93 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
OBSERVER = cargo run -q --manifest-path ../../../Cargo.toml -p frogfish-observer --
APP = ./src/ledger_app.py
TARGET ?= ledger/rejects-overdraft
.PHONY: build app-run list inventory hash run report verify host-run clean chmod
build: chmod
app-run: build
$(APP)
list: build clean
@mkdir -p .observer
$(APP) observe list | tee .observer/provider-list.json
inventory: build
$(OBSERVER) derive-inventory --config observer.toml --provider python > tests.inv
@printf 'wrote %s\n' tests.inv
hash: inventory
@mkdir -p .observer
$(OBSERVER) hash-inventory --inventory tests.inv > .observer/inventory.sha256
$(OBSERVER) hash-suite --suite tests.obs --surface simple > .observer/suite.sha256
@printf 'inventory %s\n' "$$(cat .observer/inventory.sha256)"
@printf 'suite %s\n' "$$(cat .observer/suite.sha256)"
host-run: build
$(APP) observe --target "$(TARGET)" --timeout-ms 1000
run: inventory clean
$(OBSERVER) run --inventory tests.inv --suite tests.obs --config observer.toml --surface simple --ui rich --report none --color never --show-output all
report: inventory clean
@mkdir -p .observer
$(OBSERVER) run --inventory tests.inv --suite tests.obs --config observer.toml --surface simple --mode default --ui off --report jsonl > .observer/report.default.jsonl
@printf 'wrote %s\n' .observer/report.default.jsonl
verify: report
$(OBSERVER) hash-inventory --inventory tests.inv > .observer/inventory.sha256
$(OBSERVER) hash-suite --suite tests.obs --surface simple > .observer/suite.sha256
cmp -s expected.inventory.sha256 .observer/inventory.sha256 || diff -u expected.inventory.sha256 .observer/inventory.sha256
cmp -s expected.suite.sha256 .observer/suite.sha256 || diff -u expected.suite.sha256 .observer/suite.sha256
cmp -s expected.default.jsonl .observer/report.default.jsonl || diff -u expected.default.jsonl .observer/report.default.jsonl
@printf 'verified %s\n' expected.default.jsonl
clean:
rm -rf .observer
chmod:
chmod +x src/ledger_app.py