Skip to content

Commit

Permalink
chore: clean up all the auxiliary files
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed May 6, 2024
1 parent 899f65e commit 1072be1
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 65 deletions.
26 changes: 13 additions & 13 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# By default, retry a few times until pass the test within the specified timeout
[profile.default]
# retries = 1
slow-timeout = { period = "60s", terminate-after = 1 }
retries = 1
slow-timeout = { period = "60s", terminate-after = 2 }

# # Run the following tests exclusively with longer timeout
# [[profile.default.overrides]]
# filter = """
# test(=zenoh_session_unicast) |
# test(=zenoh_session_multicast) |
# test(=transport_tcp_intermittent) |
# test(=transport_tcp_intermittent_for_lowlatency_transport) |
# test(=three_node_combination)
# """
# threads-required = 'num-cpus'
# slow-timeout = { period = "60s", terminate-after = 6 }
# Run the following tests exclusively with longer timeout
[[profile.default.overrides]]
filter = """
test(=zenoh_session_unicast) |
test(=zenoh_session_multicast) |
test(=transport_tcp_intermittent) |
test(=transport_tcp_intermittent_for_lowlatency_transport) |
test(=three_node_combination)
"""
threads-required = 'num-cpus'
slow-timeout = { period = "60s", terminate-after = 6 }
135 changes: 87 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,57 @@ env:
CARGO_PROFILE_DEV_DEBUG: false

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]

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

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

- name: Install dependencies
run: cargo +stable install cargo-deny --locked

- name: Code format check
run: cargo fmt --check

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

- name: Clippy unstable targets
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: 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: Run doctests
run: cargo test --doc

- name: Check licenses
run: cargo deny check licenses

test:
name: Unit tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# - windows-latest
- macos-13
- macos-14
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- name: Clone this repository
Expand All @@ -60,46 +99,46 @@ jobs:
uses: taiki-e/install-action@nextest

- name: Run tests
run: cargo nextest run -p zenoh --test session -E "test(=zenoh_session_multicast)" -F unstable

# - name: Run tests with SHM
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: cargo nextest run -F shared-memory -F transport_unixpipe -p zenoh-transport
#
# - 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
#
# - name: Install latest Rust toolchain
# run: rustup show
#
# - name: Install valgrind
# uses: taiki-e/install-action@valgrind
#
# - uses: Swatinem/rust-cache@v2
#
# - name: Run memory leaks check
# run: ci/valgrind-check/run.sh
# shell: bash
#
# # 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]
# if: always()
# steps:
# - name: Check whether all jobs pass
# run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'
run: cargo nextest run --exclude zenoh-examples --exclude zenoh-plugin-example --workspace

- name: Run tests with SHM
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo nextest run -F shared-memory -F transport_unixpipe -p zenoh-transport

- 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

- name: Install latest Rust toolchain
run: rustup show

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

- uses: Swatinem/rust-cache@v2

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

# 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]
if: always()
steps:
- name: Check whether all jobs pass
run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")'
5 changes: 1 addition & 4 deletions zenoh/tests/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use zenoh::prelude::r#async::*;
use zenoh::runtime::{Runtime, RuntimeBuilder};
use zenoh_core::ztimeout;

const TIMEOUT: Duration = Duration::from_secs(20);
const TIMEOUT: Duration = Duration::from_secs(60);
const SLEEP: Duration = Duration::from_secs(1);

const MSG_COUNT: usize = 1_000;
Expand Down Expand Up @@ -69,7 +69,6 @@ async fn close_session(peer01: Session, peer02: Session) {
ztimeout!(peer01.close().res_async()).unwrap();
println!("[ ][02d] Closing peer02 session");
ztimeout!(peer02.close().res_async()).unwrap();
println!(">>> close session done");
}

async fn test_session_pubsub(peer01: &Session, peer02: &Session, reliability: Reliability) {
Expand Down Expand Up @@ -129,8 +128,6 @@ async fn test_session_pubsub(peer01: &Session, peer02: &Session, reliability: Re
// Wait for the declaration to propagate
tokio::time::sleep(SLEEP).await;
}

println!(">>> test_session_pubsub done");
}

async fn test_session_qryrep(peer01: &Session, peer02: &Session, reliability: Reliability) {
Expand Down

0 comments on commit 1072be1

Please sign in to comment.