diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fdeabfaa5e..94b7ff2447 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -83,7 +83,6 @@ jobs: git clone --depth=1 https://github.com/nss-dev/nss "$NSS_DIR" echo "NSS_DIR=$NSS_DIR" >> "$GITHUB_ENV" echo "NSPR_DIR=$NSPR_DIR" >> "$GITHUB_ENV" - echo "NSS_JOBS=$NUMBER_OF_PROCESSORS" >> "$GITHUB_ENV" env: NSS_DIR: ${{ github.workspace }}/nss NSPR_DIR: ${{ github.workspace }}/nspr @@ -107,7 +106,7 @@ jobs: RUST_BACKTRACE: 1 - name: Run tests and determine coverage - run: cargo +${{ matrix.rust-toolchain }} llvm-cov test --all-targets --no-fail-fast --lcov --output-path lcov.info + run: cargo +${{ matrix.rust-toolchain }} llvm-cov test --features ci --all-targets --no-fail-fast --lcov --output-path lcov.info env: RUST_BACKTRACE: 1 RUST_LOG: neqo=debug diff --git a/neqo-common/Cargo.toml b/neqo-common/Cargo.toml index b3486e7220..68583e21dc 100644 --- a/neqo-common/Cargo.toml +++ b/neqo-common/Cargo.toml @@ -16,6 +16,7 @@ time = {version = "=0.3.23", features = ["formatting"]} [features] deny-warnings = [] +ci = [] [target."cfg(windows)".dependencies.winapi] version = "0.3" diff --git a/neqo-common/src/hrtime.rs b/neqo-common/src/hrtime.rs index d1f42d41c5..682c097035 100644 --- a/neqo-common/src/hrtime.rs +++ b/neqo-common/src/hrtime.rs @@ -372,7 +372,12 @@ impl Drop for Time { } } -#[cfg(test)] +// Only run these tests in CI on platforms other than MacOS and Windows, where the timer +// inaccuracies are too high to pass the tests. +#[cfg(all( + test, + not(all(any(target_os = "macos", target_os = "windows"), feature = "ci")) +))] mod test { use super::Time; use std::{ diff --git a/neqo-crypto/src/ech.rs b/neqo-crypto/src/ech.rs index 5425e1a64c..c4b33b0bee 100644 --- a/neqo-crypto/src/ech.rs +++ b/neqo-crypto/src/ech.rs @@ -109,6 +109,7 @@ pub fn generate_keys() -> Res<(PrivateKey, PublicKey)> { // If we have tracing on, try to ensure that key data can be read. let insensitive_secret_ptr = if log::log_enabled!(log::Level::Trace) { + #[allow(clippy::useless_conversion)] // TODO: Remove when we bump the MSRV to 1.74.0. unsafe { p11::PK11_GenerateKeyPairWithOpFlags( *slot, @@ -126,6 +127,7 @@ pub fn generate_keys() -> Res<(PrivateKey, PublicKey)> { }; assert_eq!(insensitive_secret_ptr.is_null(), public_ptr.is_null()); let secret_ptr = if insensitive_secret_ptr.is_null() { + #[allow(clippy::useless_conversion)] // TODO: Remove when we bump the MSRV to 1.74.0. unsafe { p11::PK11_GenerateKeyPairWithOpFlags( *slot, diff --git a/neqo-crypto/src/hkdf.rs b/neqo-crypto/src/hkdf.rs index 3745d646d5..44df30ecfd 100644 --- a/neqo-crypto/src/hkdf.rs +++ b/neqo-crypto/src/hkdf.rs @@ -68,6 +68,7 @@ pub fn import_key(version: Version, buf: &[u8]) -> Res { return Err(Error::UnsupportedVersion); } let slot = Slot::internal()?; + #[allow(clippy::useless_conversion)] // TODO: Remove when we bump the MSRV to 1.74.0. let key_ptr = unsafe { PK11_ImportDataKey( *slot, diff --git a/neqo-crypto/src/hp.rs b/neqo-crypto/src/hp.rs index fea67e9953..2409521903 100644 --- a/neqo-crypto/src/hp.rs +++ b/neqo-crypto/src/hp.rs @@ -72,6 +72,7 @@ impl HpKey { let l = label.as_bytes(); let mut secret: *mut PK11SymKey = null_mut(); + #[allow(clippy::useless_conversion)] // TODO: Remove when we bump the MSRV to 1.74.0. let (mech, key_size) = match cipher { TLS_AES_128_GCM_SHA256 => (CK_MECHANISM_TYPE::from(CKM_AES_ECB), 16), TLS_AES_256_GCM_SHA384 => (CK_MECHANISM_TYPE::from(CKM_AES_ECB), 32), @@ -99,6 +100,8 @@ impl HpKey { let res = match cipher { TLS_AES_128_GCM_SHA256 | TLS_AES_256_GCM_SHA384 => { + // TODO: Remove when we bump the MSRV to 1.74.0. + #[allow(clippy::useless_conversion)] let context_ptr = unsafe { PK11_CreateContextBySymKey( mech, @@ -171,6 +174,8 @@ impl HpKey { }; let mut output_len: c_uint = 0; let mut param_item = Item::wrap_struct(¶ms); + // TODO: Remove when we bump the MSRV to 1.74.0. + #[allow(clippy::useless_conversion)] secstatus_to_res(unsafe { PK11_Encrypt( **key, diff --git a/neqo-crypto/src/p11.rs b/neqo-crypto/src/p11.rs index c7e47cbf15..ebd641c17e 100644 --- a/neqo-crypto/src/p11.rs +++ b/neqo-crypto/src/p11.rs @@ -130,6 +130,7 @@ impl PrivateKey { /// When the values are too large to fit. So never. pub fn key_data(&self) -> Res> { let mut key_item = Item::make_empty(); + #[allow(clippy::useless_conversion)] // TODO: Remove when we bump the MSRV to 1.74.0. secstatus_to_res(unsafe { PK11_ReadRawAttribute( PK11ObjectType::PK11_TypePrivKey,