Skip to content

Commit

Permalink
add explicit memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Jun 26, 2024
1 parent ac4faa7 commit 1432623
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ repository = "https://github.com/blockchyp/blockchyp-rust"
license-file = "LICENSE"
keywords = ["payments", "blockchain"]

[lib]
name = "blockchyp"
path = "src/lib.rs"

[dependencies]
reqwest = { version = "0.11", features = ["blocking", "json", "rustls-tls"] }
chrono = { version = "0.4", features = ["serde"] }
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endif

# Integration test config
export BC_TEST_DELAY := 5
IMAGE := rust:1.79.0-buster
IMAGE := rust:1.79-bookworm
SCMROOT := $(shell git rev-parse --show-toplevel)
PWD := $(shell pwd)
CACHE := $(HOME)/.local/share/blockchyp/itest-cache
Expand Down Expand Up @@ -71,17 +71,19 @@ stage:

# Runs integration tests
.PHONY: integration
integration: build
integration: clean
$(if $(LOCALBUILD), \
$(CARGO) test $(if $(TEST),--test (TEST),--no-fail-fast), \
$(CARGO) build && $(CARGO) test $(if $(TEST),--test (TEST),--no-fail-fast), \
$(foreach path,$(CACHEPATHS),mkdir -p $(CACHE)/$(path) ; ) \
sed 's/localhost/$(HOSTIP)/' $(CONFIGFILE) >$(CACHE)/$(CONFIGFILE) ; \
$(DOCKER) run \
-v $(SCMROOT):$(SCMROOT):Z \
$(foreach path,$(CACHEPATHS),-v $(CACHE)/$(path):$(path):Z) \
--memory 2G \
--memory-swap -1 \
$(foreach path,$(CACHEPATHS),-v $(CACHE)$(path):$(path):Z) \
-e BC_TEST_DELAY=$(BC_TEST_DELAY) \
-e HOME=$(HOME) \
-w $(PWD) \
--init \
--rm -it $(IMAGE) \
/bin/sh -c "apt-get update && apt-get -y install build-essential && $(CARGO) test $(if $(TEST),--test (TEST),--no-fail-fast)")
/bin/sh -c "$(CARGO) build && $(CARGO) test --release $(if $(TEST),--test $(TEST),--tests --no-fail-fast)")

0 comments on commit 1432623

Please sign in to comment.