mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-01 20:07:39 +03:00
Fix tests runner (#413)
This commit is contained in:
parent
a1d260cd82
commit
3edb54ffdf
14 changed files with 39 additions and 44 deletions
13
.github/workflows/cov.yml
vendored
13
.github/workflows/cov.yml
vendored
|
@ -27,16 +27,17 @@ jobs:
|
|||
run: cargo llvm-cov clean --workspace
|
||||
|
||||
- name: Code coverage (glommio)
|
||||
run: cargo +nightly llvm-cov --no-report --all --no-default-features --features="glommio,cookie,url,compress,openssl,rustls,ws,brotli"
|
||||
continue-on-error: true
|
||||
run: cargo llvm-cov --no-report --all --no-default-features --features="ntex/glommio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli" -- --skip test_unhandled_data
|
||||
|
||||
- name: Code coverage (tokio)
|
||||
run: cargo llvm-cov --no-report --all --no-default-features --features="ntex/tokio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli"
|
||||
|
||||
- name: Code coverage (compio)
|
||||
run: cargo +nightly llvm-cov --no-report --all --no-default-features --features="compio,cookie,url,compress,openssl,rustls,ws,brotli"
|
||||
|
||||
- name: Code coverage
|
||||
run: RUST_LOG=trace cargo +nightly llvm-cov --no-report --all --doctests --no-default-features --features="tokio,cookie,url,compress,openssl,rustls,ws,brotli"
|
||||
run: cargo llvm-cov --no-report --all --no-default-features --features="ntex/compio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli"
|
||||
|
||||
- name: Generate coverage report
|
||||
run: cargo +nightly llvm-cov report --lcov --output-path lcov.info --ignore-filename-regex="ntex-tokio|ntex-glommio|ntex-async-std|ntex-compio"
|
||||
run: cargo llvm-cov report --lcov --output-path lcov.info --ignore-filename-regex="ntex-compio|ntex-tokio|ntex-glommio|ntex-async-std"
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
|
|
19
.github/workflows/linux.yml
vendored
19
.github/workflows/linux.yml
vendored
|
@ -44,22 +44,21 @@ jobs:
|
|||
path: ~/.cargo/git
|
||||
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Run tests
|
||||
timeout-minutes: 40
|
||||
run: cargo test --all --all-features --no-fail-fast -- --nocapture
|
||||
|
||||
- name: Run compio tests
|
||||
- name: Run tests (tokio)
|
||||
timeout-minutes: 40
|
||||
run: |
|
||||
cd ntex
|
||||
cargo test --no-default-features --no-fail-fast --features="compio,cookie,url,compress,openssl,rustls,ws,brotli"
|
||||
cargo test --all --no-fail-fast --no-default-features --features="ntex/tokio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli"
|
||||
|
||||
- name: Run async-std tests
|
||||
- name: Run tests (compio)
|
||||
timeout-minutes: 40
|
||||
run: |
|
||||
cargo test --all --no-default-features --features="ntex/compio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli"
|
||||
|
||||
- name: Run tests (async-std)
|
||||
timeout-minutes: 40
|
||||
continue-on-error: true
|
||||
run: |
|
||||
cd ntex
|
||||
cargo test --no-default-features --no-fail-fast --features="async-std,cookie,url,compress,openssl,rustls,ws,brotli"
|
||||
cargo test --all --no-default-features --features="ntex/async-std,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli"
|
||||
|
||||
- name: Install cargo-cache
|
||||
continue-on-error: true
|
||||
|
|
16
.github/workflows/osx.yml
vendored
16
.github/workflows/osx.yml
vendored
|
@ -37,21 +37,17 @@ jobs:
|
|||
path: ~/.cargo/git
|
||||
key: ${{ matrix.version }}-aarch64-apple-darwin-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Run tests
|
||||
run: cargo test --all --all-features --no-fail-fast -- --nocapture
|
||||
- name: Run tests (tokio)
|
||||
run: cargo test --all --no-default-features --no-fail-fast --features="ntex/tokio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli"
|
||||
|
||||
- name: Run compio tests
|
||||
- name: Run tests (compio)
|
||||
timeout-minutes: 40
|
||||
run: |
|
||||
cd ntex
|
||||
cargo test --no-default-features --no-fail-fast --features="compio,cookie,url,compress,openssl,rustls,ws,brotli"
|
||||
run: cargo test --all --no-default-features --no-fail-fast --features="ntex/compio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli"
|
||||
|
||||
- name: Install cargo-cache
|
||||
continue-on-error: true
|
||||
run: |
|
||||
cargo install cargo-cache --no-default-features --features ci-autoclean
|
||||
run: cargo install cargo-cache --no-default-features --features ci-autoclean
|
||||
|
||||
- name: Clear the cargo caches
|
||||
continue-on-error: true
|
||||
run: |
|
||||
cargo-cache
|
||||
run: cargo-cache
|
||||
|
|
11
.github/workflows/windows.yml
vendored
11
.github/workflows/windows.yml
vendored
|
@ -61,13 +61,10 @@ jobs:
|
|||
Get-ChildItem C:\vcpkg\installed\x64-windows\bin
|
||||
Get-ChildItem C:\vcpkg\installed\x64-windows\lib
|
||||
|
||||
- name: Run tests
|
||||
- name: Run tests (tokio)
|
||||
run: |
|
||||
cargo test --lib --all-features --no-fail-fast -- --nocapture --skip test_timer
|
||||
cargo test --all --lib --no-default-features --no-fail-fast --features="ntex/tokio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli" -- --skip test_timer
|
||||
|
||||
- name: Run compio tests
|
||||
timeout-minutes: 40
|
||||
continue-on-error: true
|
||||
- name: Run tests (compio)
|
||||
run: |
|
||||
cd ntex
|
||||
cargo test --no-default-features --no-fail-fast --features="compio,cookie,url,compress,openssl,rustls,ws,brotli"
|
||||
cargo test --all --lib --no-default-features --no-fail-fast --features="ntex/compio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli" -- --skip test_timer
|
||||
|
|
|
@ -29,5 +29,5 @@ simdutf8 = { version = "0.1.4", optional = true }
|
|||
[dev-dependencies]
|
||||
serde_test = "1"
|
||||
serde_json = "1"
|
||||
ntex = { version = "2", features = ["tokio"] }
|
||||
ntex = "2"
|
||||
ntex-bytes = { path = ".", features = ["mpool"] }
|
||||
|
|
|
@ -26,7 +26,6 @@ log = "0.4"
|
|||
pin-project-lite = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
ntex = "2"
|
||||
rand = "0.8"
|
||||
env_logger = "0.11"
|
||||
|
||||
ntex = { version = "2", features = ["tokio"] }
|
||||
|
|
|
@ -605,7 +605,6 @@ where
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use rand::Rng;
|
||||
use std::sync::{atomic::AtomicBool, atomic::Ordering::Relaxed, Arc, Mutex};
|
||||
use std::{cell::RefCell, io};
|
||||
|
||||
|
@ -613,6 +612,7 @@ mod tests {
|
|||
use ntex_codec::BytesCodec;
|
||||
use ntex_service::ServiceCtx;
|
||||
use ntex_util::{time::sleep, time::Millis};
|
||||
use rand::Rng;
|
||||
|
||||
use super::*;
|
||||
use crate::{testing::IoTest, Flags, Io, IoRef, IoStream};
|
||||
|
@ -823,6 +823,7 @@ mod tests {
|
|||
assert_eq!(buf, Bytes::from_static(b"GET /test HTTP/1\r\n\r\n"));
|
||||
|
||||
// write side must be closed, dispatcher waiting for read side to close
|
||||
sleep(Millis(250)).await;
|
||||
assert!(client.is_closed());
|
||||
|
||||
// close read side
|
||||
|
@ -875,6 +876,7 @@ mod tests {
|
|||
assert_eq!(buf, Bytes::from_static(b"GET /test HTTP/1\r\n\r\n"));
|
||||
|
||||
// write side must be closed, dispatcher waiting for read side to close
|
||||
sleep(Millis(250)).await;
|
||||
assert!(client.is_closed());
|
||||
|
||||
// close read side
|
||||
|
|
|
@ -16,6 +16,6 @@ syn = { version = "^1", features = ["full", "parsing"] }
|
|||
proc-macro2 = "^1"
|
||||
|
||||
[dev-dependencies]
|
||||
ntex = { version = "2", features = ["tokio"] }
|
||||
ntex = "2"
|
||||
futures = "0.3"
|
||||
env_logger = "0.11"
|
||||
env_logger = "0.11"
|
||||
|
|
|
@ -47,5 +47,5 @@ log = "0.4"
|
|||
thiserror = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
ntex = "2"
|
||||
env_logger = "0.11"
|
||||
ntex = { version = "2", features = ["tokio"] }
|
||||
|
|
|
@ -48,6 +48,7 @@ pub unsafe fn spawn_cbs<FBefore, FEnter, FExit, FAfter>(
|
|||
});
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[cfg(feature = "tokio")]
|
||||
mod tokio {
|
||||
use std::future::{poll_fn, Future};
|
||||
|
|
|
@ -30,7 +30,7 @@ socket2 = "0.5"
|
|||
oneshot = { version = "0.1", default-features = false, features = ["async"] }
|
||||
|
||||
[dev-dependencies]
|
||||
ntex = { version = "2", features = ["tokio"] }
|
||||
ntex = "2"
|
||||
ntex-macros = "0.1.3"
|
||||
|
||||
[target.'cfg(target_family = "unix")'.dependencies]
|
||||
|
|
|
@ -19,5 +19,5 @@ path = "src/lib.rs"
|
|||
slab = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
ntex = { version = "2", features = ["tokio"] }
|
||||
ntex = "2"
|
||||
ntex-util = "2"
|
||||
|
|
|
@ -40,7 +40,7 @@ tls_openssl = { version = "0.10", package = "openssl", optional = true }
|
|||
tls_rust = { version = "0.23", package = "rustls", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
ntex = { version = "2", features = ["openssl", "rustls", "tokio"] }
|
||||
ntex = { version = "2", features = ["openssl", "rustls"] }
|
||||
env_logger = "0.11"
|
||||
rustls-pemfile = "2"
|
||||
webpki-roots = "0.26"
|
||||
|
|
|
@ -18,7 +18,7 @@ edition = "2021"
|
|||
rust-version = "1.75"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["tokio", "openssl", "rustls", "compress", "cookie", "ws", "brotli"]
|
||||
features = ["compio", "tokio", "openssl", "rustls", "compress", "cookie", "ws", "brotli"]
|
||||
|
||||
[lib]
|
||||
name = "ntex"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue