From 5f99a6095dd9bd7b156cf2b263559d207b84e70d Mon Sep 17 00:00:00 2001 From: Hiroshi Shinaoka Date: Mon, 22 Jun 2026 22:05:27 +0900 Subject: [PATCH 1/2] Serialize CI WGPU tests --- xtask/src/commands/test.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xtask/src/commands/test.rs b/xtask/src/commands/test.rs index 369e87c66..63ea6da9b 100644 --- a/xtask/src/commands/test.rs +++ b/xtask/src/commands/test.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; + use tracel_xtask::prelude::*; #[macros::extend_command_args(TestCmdArgs, Target, TestSubCommand)] @@ -8,11 +10,12 @@ pub struct CubeKTestCmdArgs { } pub(crate) fn handle_command( - _args: CubeKTestCmdArgs, + args: CubeKTestCmdArgs, _env: Environment, _context: Context, ) -> anyhow::Result<()> { let backends: &[&str] = &["cubecl/wgpu"]; + let envs = args.ci.then(|| HashMap::from([("RUST_TEST_THREADS", "1")])); for backend in backends { helpers::custom_crates_tests( vec![ @@ -23,7 +26,7 @@ pub(crate) fn handle_command( "t4a-cubek-test-utils", ], vec!["--features", backend], - None, + envs.clone(), None, &format!("Test on backend {backend:?}"), )?; From 5f859dcff14bf8f84da10e235448702a315b0eef Mon Sep 17 00:00:00 2001 From: Hiroshi Shinaoka Date: Mon, 22 Jun 2026 22:21:45 +0900 Subject: [PATCH 2/2] ci: compile cubek wgpu tests on hosted linux --- .github/workflows/ci.yml | 2 ++ xtask/src/commands/test.rs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4daaf29a6..372384389 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,4 +129,6 @@ jobs: mesa-ci-build-version: ${{ env.MESA_CI_BINARY_BUILD }} # -------------------------------------------------------------------------------- - name: Tests + env: + CUBEK_CI_WGPU_NO_RUN: "1" run: cargo xtask test --ci diff --git a/xtask/src/commands/test.rs b/xtask/src/commands/test.rs index 63ea6da9b..cd43487a9 100644 --- a/xtask/src/commands/test.rs +++ b/xtask/src/commands/test.rs @@ -2,6 +2,8 @@ use std::collections::HashMap; use tracel_xtask::prelude::*; +const CI_WGPU_NO_RUN_ENV: &str = "CUBEK_CI_WGPU_NO_RUN"; + #[macros::extend_command_args(TestCmdArgs, Target, TestSubCommand)] pub struct CubeKTestCmdArgs { /// Kept for CI workflow compatibility; tests already target the publish closure. @@ -16,7 +18,17 @@ pub(crate) fn handle_command( ) -> anyhow::Result<()> { let backends: &[&str] = &["cubecl/wgpu"]; let envs = args.ci.then(|| HashMap::from([("RUST_TEST_THREADS", "1")])); + let no_run = std::env::var_os(CI_WGPU_NO_RUN_ENV).is_some(); for backend in backends { + let mut test_args = vec!["--features", *backend]; + if no_run { + test_args.push("--no-run"); + } + let group_msg = if no_run { + format!("Compile tests on backend {backend:?}") + } else { + format!("Test on backend {backend:?}") + }; helpers::custom_crates_tests( vec![ "t4a-cubek-matmul", @@ -25,10 +37,10 @@ pub(crate) fn handle_command( "t4a-cubek-std", "t4a-cubek-test-utils", ], - vec!["--features", backend], + test_args, envs.clone(), None, - &format!("Test on backend {backend:?}"), + &group_msg, )?; } Ok(())