Deflaking tests to remove chance of false positives causing tests to … #227
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
VALKEY_REPO_URL: https://github.com/valkey-io/valkey.git | |
jobs: | |
build-ubuntu-latest: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
server_version: ['unstable', '8.0.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set the server verison for python integeration tests | |
run: echo "SERVER_VERSION=${{ matrix.server_version }}" >> $GITHUB_ENV | |
- name: Run cargo and clippy format check | |
run: | | |
cargo fmt --check | |
cargo clippy --profile release --all-targets -- -D clippy::all | |
- name: Release Build | |
run: cargo build --all --all-targets --release | |
- name: Run unit tests | |
run: cargo test --features enable-system-alloc | |
- name: Make valkey-server binary | |
run: | | |
mkdir -p "tests/.build/binaries/${{ matrix.server_version }}" | |
cd tests/.build | |
git clone "${{ env.VALKEY_REPO_URL }}" | |
cd valkey | |
git checkout ${{ matrix.server_version }} | |
make -j | |
cp src/valkey-server ../binaries/${{ matrix.server_version }}/ | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Update module path | |
run: echo "MODULE_PATH=$(realpath target/release/libvalkey_bloom.so)" >> $GITHUB_ENV | |
- name: Run integration tests | |
run: python -m pytest --cache-clear -v "tests/" | |
build-macos-latest: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run cargo and clippy format check | |
run: | | |
cargo fmt --check | |
cargo clippy --profile release --all-targets -- -D clippy::all | |
- name: Release Build | |
run: cargo build --all --all-targets --release | |
- name: Run unit tests | |
run: cargo test --features enable-system-alloc | |
asan-build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
server_version: ['unstable', '8.0.0'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set the server verison for python integeration tests | |
run: echo "SERVER_VERSION=${{ matrix.server_version }}" >> $GITHUB_ENV | |
- name: Run cargo and clippy format check | |
run: | | |
cargo fmt --check | |
cargo clippy --profile release --all-targets -- -D clippy::all | |
- name: Release Build | |
run: cargo build --all --all-targets --release | |
- name: Run unit tests | |
run: cargo test --features enable-system-alloc | |
- name: Make Valkey-server binary with asan | |
run: | | |
mkdir -p "tests/.build/binaries/${{ matrix.server_version }}" | |
cd tests/.build | |
git clone "${{ env.VALKEY_REPO_URL }}" | |
cd valkey | |
git checkout ${{ matrix.server_version }} | |
make -j SANITIZER=address SERVER_CFLAGS='-Werror' BUILD_TLS=module | |
cp src/valkey-server ../binaries/${{ matrix.server_version }}/ | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Update module path | |
run: echo "MODULE_PATH=$(realpath target/release/libvalkey_bloom.so)" >> $GITHUB_ENV | |
- name: Run integration tests | |
run: python -m pytest --cache-clear -v "tests/" -m "not skip_for_asan" |