Skip to content
Open
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
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CLIPPY_OPTS := -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use
CKB_TEST_ARGS := ${CKB_TEST_ARGS} -c 4
INTEGRATION_RUST_LOG := info,ckb_test=debug,ckb_sync=debug,ckb_relay=debug,ckb_network=debug
CARGO_TARGET_DIR ?= $(shell pwd)/target
BINARY_NAME ?= "ckb"
COV_PROFRAW_DIR = ${CARGO_TARGET_DIR}/cov
GRCOV_OUTPUT ?= lcov.info
GRCOV_EXCL_START = ^\s*(((log|ckg_logger)::)?(trace|debug|info|warn|error)|(debug_)?assert(_eq|_ne|_error_eq))!\($$
Expand Down Expand Up @@ -60,17 +61,15 @@ wasm-build-test: ## Build core packages for wasm target
.PHONY: setup-ckb-test
setup-ckb-test:
cp -f Cargo.lock test/Cargo.lock
[ -x "${CARGO_TARGET_DIR}" ] || mkdir -p "${CARGO_TARGET_DIR}"
rm -rf test/target && ln -snf ${CARGO_TARGET_DIR} test/target

.PHONY: submodule-init
submodule-init:
git submodule update --init

.PHONY: integration
integration: submodule-init setup-ckb-test ## Run integration tests in "test" dir.
cargo build --features "deadlock_detection,with_sentry"
RUST_BACKTRACE=1 RUST_LOG=${INTEGRATION_RUST_LOG} test/run.sh -- --bin ${CARGO_TARGET_DIR}/debug/ckb ${CKB_TEST_ARGS}
cargo build --release --features "deadlock_detection,with_sentry"
RUST_BACKTRACE=1 RUST_LOG=${INTEGRATION_RUST_LOG} test/run.sh -- --bin "${CARGO_TARGET_DIR}/release/${BINARY_NAME}" ${CKB_TEST_ARGS}

.PHONY: integration-release
integration-release: submodule-init setup-ckb-test prod
Expand Down
10 changes: 8 additions & 2 deletions devtools/ci/ci_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ is_self_runner=`echo $RUNNER_LABEL | awk -F '-' '{print $1}'`
clean_threshold=40000
available_space=`df -m "$GITHUB_WORKSPACE" | tail -1 | awk '{print $4}'`
if [[ $is_self_runner == "self" ]];then
CARGO_TARGET_DIR=$GITHUB_WORKSPACE/../target
export CARGO_TARGET_DIR="$GITHUB_WORKSPACE/../target"
export RUSTC_WRAPPER='sccache'
export SCCACHE_CACHE_SIZE='20G'
#clean space when disk full
if [[ $available_space -lt $clean_threshold ]]; then
echo "Run clean command"
cargo clean --target-dir "${CARGO_TARGET_DIR}" || true
fi
fi
CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-"$GITHUB_WORKSPACE/target"}
EXIT_CODE=0
case $GITHUB_WORKFLOW in
ci_linters*)
echo "ci_linters"
Expand All @@ -32,8 +33,13 @@ case $GITHUB_WORKFLOW in
;;
ci_integration_tests*)
echo "ci_integration_test"
github_workflow_os=`echo $GITHUB_WORKFLOW | awk -F '_' '{print $NF}'`
export BUILD_BUILDID=$GITHUB_RUN_ID
export ImageOS=$RUNNER_OS
export BINARY_NAME=${BINARY_NAME:-"ckb"}
if [[ $github_workflow_os == 'windows' ]];then
BINARY_NAME="ckb.exe"
fi
make CKB_TEST_SEC_COEFFICIENT=5 CKB_TEST_ARGS="-c 4 --no-report" integration
;;
ci_quick_checks*)
Expand Down
4 changes: 4 additions & 0 deletions test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ opt-level = 3

[profile.bench.build-override]
opt-level = 3

[features]
default = []
deadlock_detection = ["ckb-util/deadlock_detection"]
2 changes: 1 addition & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -u
cd "$DIR"

if [ -z "${CI:-}" ]; then
exec cargo run "$@"
exec cargo run --release --features "deadlock_detection,with_sentry" "$@"
fi

set +e
Expand Down