Skip to content
Open
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
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
working-directory: ./async-nats
name: check feature flags (ubuntu-latest / stable)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand All @@ -72,5 +73,5 @@ jobs:
save-if: false # we only build docs, so we don't have the full build to be cached.
- name: Install cargo hack
run: cargo install cargo-hack
- name: Check lint
run: cargo hack check --feature-powerset --at-least-one-of aws-lc-rs,ring --no-dev-deps -p async-nats
- name: Check feature combinations
run: bash .cargo-hack-check.sh
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,29 @@ jobs:
- name: Run datetime unit tests (chrono backend)
run: cargo test --lib "datetime::" --features chrono

check_features:
defaults:
run:
working-directory: ./async-nats
name: check feature flags (ubuntu-latest / stable)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install stable Rust on ubuntu-latest
id: install-rust
uses: dtolnay/rust-toolchain@stable
- name: Restore cached build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-${{ steps.install-rust.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}
save-if: false # checks only, no full build to cache.
- name: Install cargo hack
run: cargo install cargo-hack
- name: Check feature combinations
run: bash .cargo-hack-check.sh

check_docs:
defaults:
run:
Expand Down
7 changes: 7 additions & 0 deletions async-nats/.cargo-hack-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@ echo ""
echo "=== Strategy 3: Test with aws-lc-rs backend ==="
cargo check --no-default-features --features jetstream,kv,service,nkeys,aws-lc-rs
cargo check --no-default-features --features aws-lc-rs
# FIPS mode (implies aws-lc-rs)
cargo check --no-default-features --features fips

echo ""
echo "=== Strategy 4: Test server version flags ==="
cargo check --features server_2_10
cargo check --features server_2_11
cargo check --features server_2_12
cargo check --features server_2_14

echo ""
echo "=== Strategy 5: Experimental ==="
cargo check --features experimental

echo ""
echo "All checks passed!"
2 changes: 1 addition & 1 deletion nats-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ mod tests {
let jetstream = async_nats::jetstream::new(client);

let retry_strategy = tokio_retry::strategy::ExponentialBackoff::from_millis(500).take(3);
let mut stream = tokio_retry::Retry::spawn(retry_strategy, || {
let mut stream = tokio_retry::Retry::start(retry_strategy, || {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep tokio-retry API within declared version range

This call depends on the just-added Retry::start API, but nats-server/Cargo.toml still declares tokio-retry = "0.3.0", so Cargo may legally resolve 0.3.0 or 0.3.1 from an existing/minimal lockfile. I checked the docs.rs API for those versions and they expose Retry::spawn but not start; start only appears in 0.3.2. In those environments the nats-server test package fails to compile before this retry is ever exercised, so either keep using spawn or raise the dependency lower bound to a version that has start.

Useful? React with 👍 / 👎.

jetstream.create_stream(async_nats::jetstream::stream::Config {
name: "replicated".to_string(),
num_replicas: 3,
Expand Down
Loading