From 8ce30cede024107567b42a172d11f68483daf931 Mon Sep 17 00:00:00 2001 From: TrueNine Date: Wed, 22 Apr 2026 11:14:54 +0800 Subject: [PATCH 1/2] fix: cache packaged cli artifacts per test binary --- cli/integrate-tests/src/lib.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cli/integrate-tests/src/lib.rs b/cli/integrate-tests/src/lib.rs index d9943045..cb63ab53 100644 --- a/cli/integrate-tests/src/lib.rs +++ b/cli/integrate-tests/src/lib.rs @@ -19,6 +19,7 @@ pub const PACKAGED_PLATFORM_PACKAGE: &str = "@truenine/memory-sync-cli-linux-x64 static RELEASE_BINARY_BUILT: OnceLock<()> = OnceLock::new(); static RELEASE_TEST_API_BINARY_BUILT: OnceLock<()> = OnceLock::new(); +static PACKED_CLI_ARTIFACTS: OnceLock = OnceLock::new(); pub struct CommandResult { pub status: i32, @@ -575,7 +576,11 @@ pub fn create_staged_package_root() -> StagedPackageRoot { } } -pub fn pack_cli_artifacts() -> Option { +pub fn pack_cli_artifacts() -> Option<&'static PackedArtifacts> { + Some(PACKED_CLI_ARTIFACTS.get_or_init(pack_cli_artifacts_once)) +} + +fn pack_cli_artifacts_once() -> PackedArtifacts { eprintln!("[tnmsc-integrate-tests] packing CLI artifacts..."); let total_start = std::time::Instant::now(); @@ -680,17 +685,17 @@ pub fn pack_cli_artifacts() -> Option { total_start.elapsed().as_secs_f64() ); - Some(PackedArtifacts { + PackedArtifacts { _temp_dir: temp_dir, cli_tarball, linux_tarball, test_api_binary: staged.test_api_binary, - }) + } } pub fn install_packaged_cli_container() -> Option { let artifacts = pack_cli_artifacts()?; - let container = TestContainer::start(&artifacts); + let container = TestContainer::start(artifacts); let install_command = format!( "npm install -g {} {}", quote_shell("/artifacts/cli.tgz"), From 70f394ca3fbe1049ce57eecfc08fce83dc15bf3c Mon Sep 17 00:00:00 2001 From: TrueNine Date: Wed, 22 Apr 2026 11:41:07 +0800 Subject: [PATCH 2/2] ci: run unit tests only in CI --- .github/workflows/ci.yml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf9a38cb..b264c045 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,27 +73,8 @@ jobs: - name: Build run: cargo run -p xtask -- build - - name: Rust tests - run: cargo test --workspace --exclude tnmsg --exclude tnmsc-integrate-tests --exclude tnmsc-local-tests --exclude tnmsm-integrate-tests --lib --bins --tests - - rust-real-env-integration: - if: github.event_name != 'pull_request' || github.event.pull_request.draft == false - runs-on: ubuntu-24.04 - timeout-minutes: 60 - steps: - - uses: actions/checkout@v6 - - - uses: ./.github/actions/setup-node-pnpm - - - uses: ./.github/actions/setup-rust - with: - cache-key: ci-real-env-integration - - - name: Run CLI real-env integration tests - run: cargo test -p tnmsc-integrate-tests -- --nocapture - - - name: Run MCP real-env integration tests - run: cargo test -p tnmsm-integrate-tests -- --nocapture + - name: Rust unit tests + run: cargo test --workspace --exclude tnmsg --exclude tnmsc-integrate-tests --exclude tnmsc-local-tests --exclude tnmsm-integrate-tests --lib --bins gui-smoke: needs: changes