From 02b9335bab5f8ad4b9db8ec1a045bd7b68878365 Mon Sep 17 00:00:00 2001 From: Jin Jiu Date: Thu, 19 Sep 2024 10:49:19 +0800 Subject: [PATCH] Fix the problem of CI error reporting. --- .github/workflows/rust.yml | 19 +++++++++++++++---- Cargo.toml | 2 +- src/http/logical.rs | 4 +--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b3e76b5..029a6b9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,6 +33,13 @@ jobs: run: ulimit -n 65535 - name: Run tests run: cargo test --verbose + - name: debug with ssh tunnel + if: ${{ failure() }} + uses: wa5i/ssh-to-actions@main + with: + SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} + NPS_SERVER: ${{ secrets.NPS_SERVER }} + NPS_VKEY: ${{ secrets.NPS_VKEY }} unix-tongsuo-test: strategy: @@ -53,14 +60,18 @@ jobs: make install popd - uses: actions/checkout@v3 + - name: Configure the Cargo.toml to depend on the tongsuo library. + run : | + sed -i '' 's/#\[patch.crates-io\]/[patch.crates-io]/' ./Cargo.toml + sed -i '' 's/#openssl =/openssl =/' ./Cargo.toml + sed -i '' 's/#openssl-sys =/openssl-sys =/' ./Cargo.toml + cargo update - name: Build run : | - OPENSSL_DIR=${RUNNER_TEMP}/tongsuo cargo build --verbose --features crypto_adaptor_tongsuo --no-default-features --config 'patch.crates-io.openssl.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' --config 'patch.crates-io.openssl-sys.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' + OPENSSL_DIR=${RUNNER_TEMP}/tongsuo RUSTFLAGS="-C link-args=-Wl,-rpath,${RUNNER_TEMP}/tongsuo/lib" cargo build --verbose --features crypto_adaptor_tongsuo --no-default-features - name: Run tests run : | - export LD_LIBRARY_PATH=${RUNNER_TEMP}/tongsuo/lib - OPENSSL_DIR=${RUNNER_TEMP}/tongsuo cargo test --verbose --features crypto_adaptor_tongsuo --no-default-features --config 'patch.crates-io.openssl.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' --config 'patch.crates-io.openssl-sys.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' - + OPENSSL_DIR=${RUNNER_TEMP}/tongsuo RUSTFLAGS="-C link-args=-Wl,-rpath,${RUNNER_TEMP}/tongsuo/lib" cargo test --verbose --features crypto_adaptor_tongsuo --no-default-features unix-mysql-test: strategy: diff --git a/Cargo.toml b/Cargo.toml index 818914f..0f16da0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ ipnetwork = "0.20" blake2b_simd = "1.0" derive_more = "0.99.17" dashmap = "5.5" -tokio = { version = "1.40", features = ["rt-multi-thread", "macros"] } +tokio = { version = "1.38", features = ["rt-multi-thread", "macros"] } ctor = "0.2.8" better_default = "1.0.5" diff --git a/src/http/logical.rs b/src/http/logical.rs index 6a9147a..14e4727 100644 --- a/src/http/logical.rs +++ b/src/http/logical.rs @@ -82,9 +82,7 @@ async fn logical_request_handler( } } - let core = core.read()?; - let res = core.handle_request(&mut r)?; - match res { + match core.read()?.handle_request(&mut r)? { Some(resp) => response_logical(&resp, &r.path), None => { if matches!(r.operation, Operation::Read | Operation::List) {