Skip to content

Commit

Permalink
Merge pull request #1125 from scrtlabs/faster-go-tests-startup
Browse files Browse the repository at this point in the history
more perf adjustments to go tests
  • Loading branch information
reuvenpo authored Sep 5, 2022
2 parents bf85115 + ab9f17b commit 9a341b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,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 90m -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

0 comments on commit 9a341b7

Please sign in to comment.