Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more perf adjustments to go tests #1125

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,15 @@ build-test-contract:
$(MAKE) -C ./x/compute/internal/keeper/testdata/v1-sanity-contract
$(MAKE) -C ./x/compute/internal/keeper/testdata/ibc


prep-go-tests: build-test-contract
# empty BUILD_PROFILE means debug mode which compiles faster
SGX_MODE=SW $(MAKE) build-linux
cp ./cosmwasm/enclaves/execute/librust_cosmwasm_enclave.signed.so ./x/compute/internal/keeper

go-tests: build-test-contract
# empty BUILD_PROFILE means debug mode which compiles faster
SGX_MODE=SW $(MAKE) build-linux
SGX_MODE=SW $(MAKE) build-linux-with-query
cp ./cosmwasm/enclaves/execute/librust_cosmwasm_enclave.signed.so ./x/compute/internal/keeper
cp ./cosmwasm/enclaves/query/librust_cosmwasm_query_enclave.signed.so ./x/compute/internal/keeper
rm -rf ./x/compute/internal/keeper/.sgx_secrets
mkdir -p ./x/compute/internal/keeper/.sgx_secrets
GOMAXPROCS=8 SGX_MODE=SW SCRT_SGX_STORAGE='./' go test -failfast -timeout 40m -v ./x/compute/internal/... $(GO_TEST_ARGS)
Expand Down
8 changes: 3 additions & 5 deletions x/compute/internal/keeper/testdata/test-contract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ Rust_Crate_Source := $(shell find -type f | grep -P '(\.rs|\.toml|\.lock)$$' | g
.PHONY: all
all: contract.wasm contract_with_floats.wasm too-high-initial-memory.wasm static-too-high-initial-memory.wasm

.PHONY: add-wasm
add-wasm:
contract.wasm: $(Rust_Crate_Source)
rustup target add wasm32-unknown-unknown

contract.wasm: add-wasm $(Rust_Crate_Source)
RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown
cp ./target/wasm32-unknown-unknown/release/test_contract.wasm ./contract.wasm

# Compile with floats
contract_with_floats.wasm: add-wasm $(Rust_Crate_Source)
contract_with_floats.wasm: $(Rust_Crate_Source)
rustup target add wasm32-unknown-unknown
RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --features with_floats
cp ./target/wasm32-unknown-unknown/release/test_contract.wasm ./contract_with_floats.wasm

Expand Down