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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 19 additions & 4 deletions xtask/src/commands/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
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.
Expand All @@ -8,12 +12,23 @@ 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")]));
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",
Expand All @@ -22,10 +37,10 @@ pub(crate) fn handle_command(
"t4a-cubek-std",
"t4a-cubek-test-utils",
],
vec!["--features", backend],
None,
test_args,
envs.clone(),
None,
&format!("Test on backend {backend:?}"),
&group_msg,
)?;
}
Ok(())
Expand Down
Loading