Skip to content

Commit

Permalink
fix stable ci
Browse files Browse the repository at this point in the history
Signed-off-by: tabokie <[email protected]>
  • Loading branch information
tabokie committed Aug 2, 2022
1 parent 47ce01b commit ce4a20a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
- name: Clippy
run: make clippy
- name: Run tests
run: make test_nightly
run: make test
env:
RUST_BACKTRACE: 1
EXTRA_CARGO_ARGS: '--verbose'
- name: Run asan tests
if: ${{ matrix.os == 'ubuntu-latest' }}
run: make test_nightly
run: make test
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '-Zsanitizer=address'
Expand All @@ -68,11 +68,14 @@ jobs:
sharedKey: ${{ matrix.os }}-stable
- name: Clippy
run: make clippy
env:
WITH_STABLE_TOOLCHAIN: 'true'
- name: Run tests
run: make test
env:
RUST_BACKTRACE: 1
EXTRA_CARGO_ARGS: '--verbose'
WITH_STABLE_TOOLCHAIN: 'true'
coverage:
runs-on: ubuntu-latest
needs: nightly
Expand All @@ -95,7 +98,7 @@ jobs:
- name: Run tests
run: |
make test
make test_nightly
env WITH_STABLE_TOOLCHAIN=true make test
env:
RUSTFLAGS: '-Zinstrument-coverage'
LLVM_PROFILE_FILE: '%p-%m.profraw'
Expand Down
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# Makefile

EXTRA_CARGO_ARGS ?=
WITH_STABLE_TOOLCHAIN ?=

.PHONY: format clippy test test_nightly

all: format clippy test test_nightly

# Format code in-place using rustfmt.
all: format clippy test

## Format code in-place using rustfmt.
format:
cargo fmt --all

# Run clippy.
## Run clippy.
ifeq ($(WITH_STABLE_TOOLCHAIN), true)
clippy:
cargo clippy --all --features all_stable --all-targets -- -D clippy::all
else
clippy:
cargo clippy --all --all-features --all-targets -- -D clippy::all
endif

# Run test available on stable toolchain.
## Run test.
ifeq ($(WITH_STABLE_TOOLCHAIN), true)
test:
cargo test --all --features all_stable_except_failpoints ${EXTRA_CARGO_ARGS} -- --nocapture
cargo test --test failpoints --features all_stable ${EXTRA_CARGO_ARGS} -- --test-threads 1 --nocapture

# Run test available on nightly toolchain. Assumes the default toolchain is nightly.
test_nightly:
else
test:
cargo test --all --features all_except_failpoints ${EXTRA_CARGO_ARGS} -- --nocapture
cargo test --test failpoints --all-features ${EXTRA_CARGO_ARGS} -- --test-threads 1 --nocapture
endif
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ Contributions are always welcome! Here are a few tips for making a PR:
```
# rustup default nightly
make
# rustup default stable
env WITH_STABLE_TOOLCHAIN=true make
# filter a specific test case
env EXTRA_CARGO_ARGS=<testname> make test_nightly
env EXTRA_CARGO_ARGS=<testname> make test
```

- For changes that might induce performance effects, please quote the targeted benchmark results in the PR description. In addition to micro-benchmarks, there is a standalone [stress test tool](https://github.com/tikv/raft-engine/tree/master/stress) which you can use to demonstrate the system performance.
Expand Down

0 comments on commit ce4a20a

Please sign in to comment.