Path: blob/main/tools/ci/src/commands/integration_test_check.rs
6598 views
use std::path::Path;12use crate::{args::Args, Prepare, PreparedCommand};3use argh::FromArgs;4use xshell::cmd;56pub fn get_integration_tests(sh: &xshell::Shell) -> Vec<String> {7let integration_test_paths = sh.read_dir(Path::new("./tests-integration")).unwrap();89// Filter out non-directories10integration_test_paths11.into_iter()12.filter(|path| path.is_dir())13.map(|path| path.to_string_lossy().to_string())14.collect()15}1617/// Checks that all integration tests compile.18#[derive(FromArgs, Default)]19#[argh(subcommand, name = "integration-test-check")]20pub struct IntegrationTestCheckCommand {}2122impl Prepare for IntegrationTestCheckCommand {23fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec<PreparedCommand<'a>> {24let jobs = args.build_jobs();25let jobs_ref = jobs.as_ref();2627get_integration_tests(sh)28.into_iter()29.map(|path| {30PreparedCommand::new::<Self>(31cmd!(32sh,33"cargo check --manifest-path {path}/Cargo.toml --tests {jobs_ref...}"34),35"Please fix compiler errors for tests in output above.",36)37})38.collect()39}40}414243