Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions cli/integrate-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PackedArtifacts> = OnceLock::new();

pub struct CommandResult {
pub status: i32,
Expand Down Expand Up @@ -575,7 +576,11 @@ pub fn create_staged_package_root() -> StagedPackageRoot {
}
}

pub fn pack_cli_artifacts() -> Option<PackedArtifacts> {
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();

Expand Down Expand Up @@ -680,17 +685,17 @@ pub fn pack_cli_artifacts() -> Option<PackedArtifacts> {
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<TestContainer> {
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"),
Expand Down
Loading