Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downsampling_by_keyexpr_test investigation #1172

Draft
wants to merge 12 commits into
base: dev/1.0.0
Choose a base branch
from
Draft
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
9 changes: 9 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[test-groups]
sequential = { max-threads = 1 }

# By default, retry a few times until pass the test within the specified timeout
[profile.default]
retries = 1
Expand All @@ -20,3 +23,9 @@ test(=header_link_failure_concurrent)
"""
threads-required = 'num-cpus'
slow-timeout = { period = "60s", terminate-after = 6 }

[[profile.default.overrides]]
filter = """
test(=downsampling_by_keyexpr)
"""
test-group = "sequential"
173 changes: 88 additions & 85 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,69 +25,70 @@ env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_PROFILE_DEV_DEBUG: false
RUSTUP_WINDOWS_PATH_ADD_BIN: 1
RUST_BACKTRACE: full

jobs:
check:
name: Lints and doc tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
# check:
# name: Lints and doc tests on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# # os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- name: Clone this repository
uses: actions/checkout@v4
# steps:
# - name: Clone this repository
# uses: actions/checkout@v4

- name: Setup rust-cache
uses: Swatinem/rust-cache@v2
# - name: Setup rust-cache
# uses: Swatinem/rust-cache@v2

- name: Update Stable Rust toolchain
run: rustup update stable
# - name: Update Stable Rust toolchain
# run: rustup update stable

- name: Install latest cargo-deny
uses: taiki-e/install-action@cargo-deny
# - name: Install latest cargo-deny
# uses: taiki-e/install-action@cargo-deny

- name: Code format check
run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
# - name: Code format check
# run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"

- name: Clippy zenoh no-default-features
run: cargo +stable clippy -p zenoh --all-targets --no-default-features -- --deny warnings
# - name: Clippy zenoh no-default-features
# run: cargo +stable clippy -p zenoh --all-targets --no-default-features -- --deny warnings

- name: Clippy zenoh
run: cargo +stable clippy -p zenoh --all-targets -- --deny warnings
# - name: Clippy zenoh
# run: cargo +stable clippy -p zenoh --all-targets -- --deny warnings

- name: Clippy zenoh unstable
run: cargo +stable clippy -p zenoh --all-targets --features unstable -- --deny warnings
# - name: Clippy zenoh unstable
# run: cargo +stable clippy -p zenoh --all-targets --features unstable -- --deny warnings

- name: Clippy zenoh internal
run: cargo +stable clippy -p zenoh --all-targets --features unstable,internal -- --deny warnings
# - name: Clippy zenoh internal
# run: cargo +stable clippy -p zenoh --all-targets --features unstable,internal -- --deny warnings

- name: Clippy zenoh shared-memory
run: cargo +stable clippy -p zenoh --all-targets --features unstable,shared-memory -- --deny warnings
# - name: Clippy zenoh shared-memory
# run: cargo +stable clippy -p zenoh --all-targets --features unstable,shared-memory -- --deny warnings

- name: Clippy workspace
run: cargo +stable clippy --all-targets -- --deny warnings
# - name: Clippy workspace
# run: cargo +stable clippy --all-targets -- --deny warnings

- name: Clippy workspace unstable
run: cargo +stable clippy --all-targets --features unstable -- --deny warnings
# - name: Clippy workspace unstable
# run: cargo +stable clippy --all-targets --features unstable -- --deny warnings

- name: Clippy all features
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest' }}
run: cargo +stable clippy --all-targets --all-features -- --deny warnings
# - name: Clippy all features
# if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest' }}
# run: cargo +stable clippy --all-targets --all-features -- --deny warnings

- name: Install generic no_std target
# Generic no_std target architecture is x86_64-unknown-none
run: rustup target add x86_64-unknown-none
# - name: Install generic no_std target
# # Generic no_std target architecture is x86_64-unknown-none
# run: rustup target add x86_64-unknown-none

- name: Perform no_std checks
run: cargo check --bin nostd_check --target x86_64-unknown-none --manifest-path ci/nostd-check/Cargo.toml
# - name: Perform no_std checks
# run: cargo check --bin nostd_check --target x86_64-unknown-none --manifest-path ci/nostd-check/Cargo.toml

- name: Run doctests
run: cargo test --doc
# - name: Run doctests
# run: cargo test --doc

- name: Check licenses
run: cargo deny check licenses
# - name: Check licenses
# run: cargo deny check licenses

test:
name: Unit tests on ${{ matrix.os }}
Expand Down Expand Up @@ -118,60 +119,62 @@ jobs:
uses: taiki-e/install-action@nextest

- name: Run tests
run: cargo nextest run --exclude zenoh-examples --exclude zenoh-plugin-example --workspace
# run: cargo nextest run --exclude zenoh-examples --exclude zenoh-plugin-example --workspace
# run: cargo nextest run downsampling_by_keyexpr
run: cargo nextest run -F shared-memory -F unstable transport_tcp_concurrent --nocapture

- name: Run tests with SHM
if: ${{ matrix.os == 'macOS-latest' || matrix.os == 'windows-latest' }}
run: cargo nextest run -F shared-memory -F unstable -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace
# - name: Run tests with SHM
# if: ${{ matrix.os == 'macOS-latest' || matrix.os == 'windows-latest' }}
# run: cargo nextest run -F shared-memory -F unstable -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace

- name: Run tests with SHM + unixpipe
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo nextest run -F shared-memory -F unstable -F transport_unixpipe -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace
# - name: Run tests with SHM + unixpipe
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: cargo nextest run -F shared-memory -F unstable -F transport_unixpipe -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace

- name: Check for feature leaks
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo nextest run -p zenohd --no-default-features
# - name: Check for feature leaks
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: cargo nextest run -p zenohd --no-default-features

valgrind:
name: Memory leak checks
runs-on: ubuntu-latest
needs: check
steps:
- name: Clone this repository
uses: actions/checkout@v4
# valgrind:
# name: Memory leak checks
# runs-on: ubuntu-latest
# needs: check
# steps:
# - name: Clone this repository
# uses: actions/checkout@v4

- name: Install latest Rust toolchain
run: rustup show
# - name: Install latest Rust toolchain
# run: rustup show

- name: Install valgrind
uses: taiki-e/install-action@valgrind
# - name: Install valgrind
# uses: taiki-e/install-action@valgrind

- uses: Swatinem/rust-cache@v2
# - uses: Swatinem/rust-cache@v2

- name: Run memory leaks check
run: ci/valgrind-check/run.sh
shell: bash
# - name: Run memory leaks check
# run: ci/valgrind-check/run.sh
# shell: bash

typos:
name: Typos Check
runs-on: ubuntu-latest
steps:
- name: Clone this repository
uses: actions/checkout@v4
# typos:
# name: Typos Check
# runs-on: ubuntu-latest
# steps:
# - name: Clone this repository
# uses: actions/checkout@v4

- name: Check spelling
uses: crate-ci/typos@master
# - name: Check spelling
# uses: crate-ci/typos@master

# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
# from branches where specific status checks have passed. These checks are
# specified manually as a list of workflow job names. Thus we use this extra
# job to signal whether all CI checks have passed.
ci:
name: CI status checks
runs-on: ubuntu-latest
needs: [check, test, valgrind, typos]
if: always()
steps:
- name: Check whether all jobs pass
run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'
# ci:
# name: CI status checks
# runs-on: ubuntu-latest
# needs: [check, test, valgrind, typos]
# if: always()
# steps:
# - name: Check whether all jobs pass
# run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'
1 change: 0 additions & 1 deletion zenoh/tests/interceptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ fn downsampling_by_keyexpr_impl(flow: InterceptorFlow) {
downsampling_test(pub_config, sub_config, ke_prefix, ke_of_rates, rate_check);
}

#[cfg(unix)]
#[test]
fn downsampling_by_keyexpr() {
zenoh::try_init_log_from_env();
Expand Down