Skip to content

Commit

Permalink
Remove schemathesis and clean up api Makefile (#15696)
Browse files Browse the repository at this point in the history
* Clean up `Makefile`

* Remove `schemathesis`
  • Loading branch information
aluon authored Jan 14, 2025
1 parent 74d6333 commit 2712cc7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 57 deletions.
42 changes: 6 additions & 36 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,24 @@
# Parts of the project are originally copyright © Meta Platforms, Inc.
# SPDX-License-Identifier: Apache-2.0

test: clean lint-v0 lint-v1 test-code-gen-v0 test-code-gen-v1 test-api-spec-v0 test-api-spec-v1 clean
test: clean lint test-code-gen clean

lint-v0:
$(call lint,doc/v0/openapi.yaml)

lint-v1:
$(call lint,doc/v1/spec.yaml)

test-code-gen-v0:
$(call test_code_gen,doc/v0/openapi.yaml)
lint:
$(call lint,doc/spec.yaml)

# This doesn't work right now: https://github.com/OpenAPITools/openapi-generator/issues/13038.
test-code-gen-v1:
$(call test_code_gen,doc/v1/spec.yaml)
test-code-gen:
$(call test_code_gen,doc/spec.yaml)

clean:
- pkill aptos-node
- rm -rf /tmp/aptos_api_client
- rm -f openapitools.json
- rm -rf .hypothesis

test-api-spec-v0:
$(call test_api_spec,openapi.yaml)

test-api-spec-v1:
$(call test_api_spec,spec.yaml)

serve:
cd doc && python3 -m http.server 8888

define 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/$(1)
endef

define lint
npx @redocly/openapi-cli lint $(1) --skip-rule no-empty-servers
endef
Expand All @@ -60,4 +30,4 @@ define test_code_gen
cd /tmp/aptos_api_client && cargo build
endef

.PHONY: test lint-v0 lint-v1 test-code-gen-v0 test-code-gen-v1 test-api-spec-v0 test-api-spec-v1 clean serve
.PHONY: test lint test-code-gen test-api-spec clean serve
19 changes: 0 additions & 19 deletions scripts/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function usage {
echo "-o install operations tooling as well: helm, terraform, yamllint, vault, docker, kubectl, python3"
echo "-y install or update Move Prover tools: z3, cvc5, dotnet, boogie"
echo "-d install tools for the Move documentation generator: graphviz"
echo "-a install tools for build and test api"
echo "-P install PostgreSQL"
echo "-J install js/ts tools"
echo "-v verbose mode"
Expand Down Expand Up @@ -801,13 +800,6 @@ protoc and related plugins (since -r was provided):
EOF
fi

if [[ "$INSTALL_API_BUILD_TOOLS" == "true" ]]; then
cat <<EOF
API build and testing tools (since -a was provided):
* Python3 (schemathesis)
EOF
fi

if [[ "$INSTALL_POSTGRES" == "true" ]]; then
cat <<EOF
PostgreSQL database (since -P was provided):
Expand Down Expand Up @@ -848,7 +840,6 @@ INSTALL_PROFILE=false
INSTALL_PROVER=false
INSTALL_DOC=false
INSTALL_PROTOC=false
INSTALL_API_BUILD_TOOLS=false
INSTALL_POSTGRES=false
INSTALL_JSTS=false
INSTALL_INDIVIDUAL=false
Expand Down Expand Up @@ -884,9 +875,6 @@ while getopts "btoprvydaPJh:i:nk" arg; do
d)
INSTALL_DOC="true"
;;
a)
INSTALL_API_BUILD_TOOLS="true"
;;
P)
INSTALL_POSTGRES="true"
;;
Expand Down Expand Up @@ -920,7 +908,6 @@ if [[ "$INSTALL_BUILD_TOOLS" == "false" ]] &&
[[ "$INSTALL_PROFILE" == "false" ]] &&
[[ "$INSTALL_PROVER" == "false" ]] &&
[[ "$INSTALL_DOC" == "false" ]] &&
[[ "$INSTALL_API_BUILD_TOOLS" == "false" ]] &&
[[ "$INSTALL_POSTGRES" == "false" ]] &&
[[ "$INSTALL_JSTS" == "false" ]] &&
[[ "$INSTALL_INDIVIDUAL" == "false" ]]; then
Expand Down Expand Up @@ -1083,12 +1070,6 @@ if [[ "$INSTALL_DOC" == "true" ]]; then
install_pkg graphviz "$PACKAGE_MANAGER"
fi

if [[ "$INSTALL_API_BUILD_TOOLS" == "true" ]]; then
# python and tools
install_python3
"${PRE_COMMAND[@]}" python3 -m pip install schemathesis
fi

if [[ "$INSTALL_POSTGRES" == "true" ]]; then
install_postgres
fi
Expand Down
2 changes: 0 additions & 2 deletions scripts/windows_dev_setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ function build_tools_message {
* protoc-gen-prost-crate
* Python (and necessary components)
* pip
* schemathesis
* LLVM
* CMake
* OpenSSL
Expand Down Expand Up @@ -364,7 +363,6 @@ function install_python {
winget upgrade --id Python.Python.3.11 --silent --accept-source-agreements
}
python -m pip install --upgrade pip
python -m pip install schemathesis
}

function install_pnpm {
Expand Down

0 comments on commit 2712cc7

Please sign in to comment.