mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-04 21:37:58 +03:00
parent
15019a2a43
commit
9bf0908f41
2 changed files with 25 additions and 6 deletions
16
.github/workflows/cov.yml
vendored
16
.github/workflows/cov.yml
vendored
|
@ -9,10 +9,8 @@ jobs:
|
|||
CARGO_TERM_COLOR: always
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install Rust
|
||||
run: rustup toolchain install stable --component llvm-tools-preview
|
||||
|
||||
run: rustup update nightly
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@cargo-llvm-cov
|
||||
|
||||
|
@ -24,14 +22,20 @@ jobs:
|
|||
- name: Cache Dependencies
|
||||
uses: Swatinem/rust-cache@v1.0.1
|
||||
|
||||
- name: Code coverage
|
||||
run: cargo llvm-cov --no-report --all --no-default-features --features="tokio,cookie,url,compress,openssl,rustls"
|
||||
- name: Clean coverage results
|
||||
run: cargo llvm-cov clean --workspace
|
||||
|
||||
- name: Code coverage (glommio)
|
||||
run: cargo llvm-cov --no-report --all --no-default-features --features="glommio,cookie,url,compress,openssl,rustls"
|
||||
|
||||
- name: Code coverage (async-std)
|
||||
run: cargo llvm-cov --no-report --all --no-default-features --features="async-std,cookie,url,compress,openssl,rustls"
|
||||
|
||||
- name: Code coverage
|
||||
run: cargo +nightly llvm-cov --no-report --all --doctests --no-default-features --features="tokio,cookie,url,compress,openssl,rustls"
|
||||
|
||||
- name: Generate coverage report
|
||||
run: cargo llvm-cov report --lcov --output-path lcov.info --ignore-filename-regex="ntex-tokio|ntex-glommio|ntex-async-std"
|
||||
run: cargo +nightly llvm-cov report --lcov --output-path lcov.info --ignore-filename-regex="ntex-tokio|ntex-glommio|ntex-async-std"
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
|
|
|
@ -648,6 +648,7 @@ pub(super) fn flush_io(
|
|||
#[allow(clippy::redundant_clone)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ntex_util::future::lazy;
|
||||
|
||||
#[ntex::test]
|
||||
async fn basic() {
|
||||
|
@ -656,6 +657,17 @@ mod tests {
|
|||
assert_eq!(client.clone().tp, Type::ClientClone);
|
||||
assert_eq!(server.tp, Type::Server);
|
||||
assert_eq!(server.clone().tp, Type::ServerClone);
|
||||
assert!(format!("{:?}", server).contains("IoTest"));
|
||||
assert!(format!("{:?}", AtomicWaker::default()).contains("AtomicWaker"));
|
||||
|
||||
server.read_pending();
|
||||
let mut buf = BytesVec::new();
|
||||
let res = lazy(|cx| client.poll_read_buf(cx, &mut buf)).await;
|
||||
assert!(res.is_pending());
|
||||
|
||||
server.read_pending();
|
||||
let res = lazy(|cx| server.poll_write_buf(cx, b"123")).await;
|
||||
assert!(res.is_pending());
|
||||
|
||||
assert!(!server.is_client_dropped());
|
||||
drop(client);
|
||||
|
@ -665,5 +677,8 @@ mod tests {
|
|||
assert!(!server2.is_server_dropped());
|
||||
drop(server);
|
||||
assert!(server2.is_server_dropped());
|
||||
|
||||
let res = lazy(|cx| server2.poll_write_buf(cx, b"123")).await;
|
||||
assert!(res.is_pending());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue