forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 1.22 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
# Copyright (c) Aptos
# SPDX-License-Identifier: Apache-2.0
test: clean lint test-code-gen test-api-spec clean
lint:
npx @redocly/openapi-cli lint doc/openapi.yaml --skip-rule no-empty-servers
test-code-gen:
echo '{"generator-cli": {"version": "5.2.1"}}' > openapitools.json # v5.3 has bug, ping the version to 5.2.1
npx @openapitools/openapi-generator-cli generate -g rust -i doc/openapi.yaml -o /tmp/aptos_api_client --package-name aptos_api_client
cd /tmp/aptos_api_client && cargo build
clean:
- pkill aptos-node
- rm -rf /tmp/aptos_api_client
- rm -f openapitools.json
- rm -rf .hypothesis
test-api-spec:
- pkill aptos-node
cargo build -p aptos-node
./../target/debug/aptos-node --test --lazy &
curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /tmp/wait-for-it.sh
chmod +x /tmp/wait-for-it.sh
/tmp/wait-for-it.sh -t 300 localhost:8080
schemathesis run --method GET \
--show-errors-tracebacks \
--code-sample-style=curl \
--store-network-log=./../target/schemathesis-network-log.yaml \
--checks all \
--base-url http://localhost:8080 \
http://localhost:8080/openapi.yaml
serve:
cd doc && python -m http.server 8888
.PHONY: test lint test-code-gen test-api-spec clean serve