Skip to content

Commit

Permalink
Workaround ci (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinNeo authored Sep 8, 2022
1 parent 8034235 commit e7ded43
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 33 deletions.
78 changes: 45 additions & 33 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,38 +47,50 @@ jobs:
- name: format check
run: |
cd ${{github.workspace}}
make gen_proxy_ffi
GIT_STATUS=$(git status -s) && if [[ ${GIT_STATUS} ]]; then echo "Error: found illegal git status"; echo ${GIT_STATUS}; [[ -z ${GIT_STATUS} ]]; fi
cargo fmt -- --check >/dev/null
make ci_fmt_check
- name: test
run: |
# export RUSTC_WRAPPER=~/.cargo/bin/sccache
# make test
# make debug
export ENGINE_LABEL_VALUE=tiflash
export RUST_BACKTRACE=full
cargo check
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_normal
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_bootstrap
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_compact_log
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_early_apply
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_encryption
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_pd_client
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_pending_peers
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_transaction
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_cmd_epoch_checker
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_disk_full
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_snap
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_merge
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_import_service
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_proxy_replica_read
# tests based on new-mock-engine-store, with compat for new proxy
cargo test --package tests --test proxy normal::store
cargo test --package tests --test proxy normal::region
cargo test --package tests --test proxy normal::config
cargo test --package tests --test proxy normal::write
cargo test --package tests --test proxy normal::ingest
cargo test --package tests --test proxy normal::snapshot
cargo test --package tests --test proxy normal::restart
# tests based on new-mock-engine-store, for some tests not available for new proxy
cargo test --package tests --test proxy proxy
M="testold" ./ci_check.sh
build-check-new:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: cache cargo env
id: cache-cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/
~/.cargo/git/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: install rust
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain none -y
export PATH=~/.cargo/bin/:$PATH
rustup self update && rustup set profile minimal && rustup default $(cat "rust-toolchain")
# cargo install sccache
# - name: cache build target
# uses: actions/cache@v2
# env:
# cache-name: cargo-target
# with:
# path: |
# target/
# # ~/.cache/sccache/
# key: ${{ runner.os }}-${{ env.cache-name }}-v1-${{ hashFiles('**/rust-toolchain') }}-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ runner.os }}-${{ env.cache-name }}-v1-${{ hashFiles('**/rust-toolchain') }}-
- name: format check
run: |
cd ${{github.workspace}}
make ci_fmt_check
- name: test
run: |
M="testnew" ./ci_check.sh
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ pre-format: unset-override
@rustup component add rustfmt
@cargo install --force -q cargo-sort

ci_fmt_check:
M="fmt" ./ci_check.sh

ci_test:
M="testold" ./ci_check.sh
M="testnew" ./ci_check.sh

gen_proxy_ffi: pre-format
./gen-proxy-ffi.sh

Expand Down
37 changes: 37 additions & 0 deletions ci_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
if [[ $M == "fmt" ]]; then
make gen_proxy_ffi
GIT_STATUS=$(git status -s) && if [[ ${GIT_STATUS} ]]; then echo "Error: found illegal git status"; echo ${GIT_STATUS}; [[ -z ${GIT_STATUS} ]]; fi
cargo fmt -- --check >/dev/null
elif [[ $M == "testold" ]]; then
export ENGINE_LABEL_VALUE=tiflash
export RUST_BACKTRACE=full
cargo check
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_normal
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_bootstrap
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_compact_log
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_early_apply
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_encryption
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_pd_client
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_pending_peers
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_transaction
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_cmd_epoch_checker
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_disk_full
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_snap
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_merge
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_import_service
cargo test --features compat_old_proxy --package tests --test failpoints cases::test_proxy_replica_read
elif [[ $M == "testnew" ]]; then
# tests based on new-mock-engine-store, with compat for new proxy
cargo test --package tests --test proxy normal::store
cargo test --package tests --test proxy normal::region
cargo test --package tests --test proxy normal::config
cargo test --package tests --test proxy normal::write
cargo test --package tests --test proxy normal::ingest
cargo test --package tests --test proxy normal::snapshot
cargo test --package tests --test proxy normal::restart
# tests based on new-mock-engine-store, for some tests not available for new proxy
cargo test --package tests --test proxy proxy
elif [[ $M == "debug" ]]; then
# export RUSTC_WRAPPER=~/.cargo/bin/sccache
make debug
fi

0 comments on commit e7ded43

Please sign in to comment.