Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
108 lines (85 loc) · 2.98 KB
/
Copy pathmakefile
File metadata and controls
108 lines (85 loc) · 2.98 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
# .PHONY: test lint fmt build
# fmt:
# go fmt ./...
# ruff format python/
# lint:
# golangci-lint run ./...
# ruff python/
# test:
# go test ./...
# pytest -q
# build:
# go build -o bin/sfm ./go/cmd/sfm
# Otherwise make thinks these are files and not commands
.PHONY: python python_test go_test
go:
go run ./golang/main.go
go_proto_gen:
mkdir -p golang/client
protoc -I. \
--go_out=golang/client \
--go_opt=paths=source_relative \
--go_opt=Mprotos/message_structure.proto=github.com/COS301-SE-2025/Smart-File-Manager/golang/client \
--go-grpc_out=golang/client \
--go-grpc_opt=paths=source_relative \
--go-grpc_opt=Mprotos/message_structure.proto=github.com/COS301-SE-2025/Smart-File-Manager/golang/client \
protos/message_structure.proto
go_grpc_server:
cd golang && \
go run grpc/server/grpcServer.go
go_grpc_client:
cd golang && \
go run grpc/client/grpcClient.go
go_test:
@echo "Running all filesystem tests..."
cd golang && go test -tags=test ./filesystem/... -v
go_coverage:
@cd golang && \
go test -tags=test -coverpkg=./filesystem/... -coverprofile=coverage.out -covermode=atomic ./filesystem/... || true; \
if [ -f coverage.out ]; then \
echo "Coverage details:"; \
go tool cover -func=coverage.out | sed -n '$p'; \
echo -n "TOTAL COVERAGE: " ; go tool cover -func=coverage.out | awk '/^total:/ {print $$3}'; \
else \
echo "coverage.out not generated"; \
fi
go_coverage_funcs:
cd golang && \
go test -tags=test -coverpkg=./filesystem/... -coverprofile=coverage.out -covermode=atomic ./filesystem/... && \
echo "Coverage per function:" && \
go tool cover -func=coverage.out
go_api:
cd golang && \
go run .
python:
python3 python/src/main.py
python_test:
pytest -vv -s --color=yes --tb=short python/testing/
python_test_pyinstrument:
pyinstrument -r html -o profiling/profile_report.html -m pytest -v -s --color=yes --tb=short python/testing/
python_test_clustering_request_pyinstrument:
pyinstrument --renderer html -o profile.html -m pytest -v -s --color=yes --tb=short python/testing/test_clustering_request.py
proto_gen:
python3 -m grpc_tools.protoc \
-Iprotos \
--python_out=python/src \
--pyi_out=python/src \
--grpc_python_out=python/src \
protos/message_structure.proto
mkdir -p golang/client
protoc -I. \
--go_out=golang/client \
--go_opt=paths=source_relative \
--go_opt=Mprotos/message_structure.proto=github.com/COS301-SE-2025/Smart-File-Manager/golang/client \
--go-grpc_out=golang/client \
--go-grpc_opt=paths=source_relative \
--go-grpc_opt=Mprotos/message_structure.proto=github.com/COS301-SE-2025/Smart-File-Manager/golang/client \
protos/message_structure.proto
python_client:
python3 python/src/greeter_client.py
python_master_temp:
pytest -v -s --color=yes --tb=short python/testing/test_clustering_request.py
python_locked_temp:
pytest -v -s --color=yes --tb=short python/testing/test_locked_request.py
python_non_functional:
pytest -v -s --color=yes --tb=short python/non_functional_tests/