From d365c44bdd2fe82762eb4d9a572338ab2a1a1c2f Mon Sep 17 00:00:00 2001 From: Emre Sahin Date: Sat, 28 Oct 2023 18:12:43 +0300 Subject: [PATCH] Added CI checks to remove readme from tests in CI --- workflow_tests/tests/z_test_docs.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/workflow_tests/tests/z_test_docs.rs b/workflow_tests/tests/z_test_docs.rs index cc5eb3e87..c21e8efcf 100644 --- a/workflow_tests/tests/z_test_docs.rs +++ b/workflow_tests/tests/z_test_docs.rs @@ -18,12 +18,17 @@ const DOC_TEST_DIR: &str = "docs/"; fn link_to_docs() -> Result<()> { test_logging(log::LevelFilter::Trace); let book_base = Path::new("../book/src/"); - let book_dirs_and_filters = vec![ - ("intro", r".*"), - ("ref", r".*"), - ("start", r".*"), - ("how-to", r".*"), - ]; + let in_ci = option_env!("CI").is_some(); + let book_dirs_and_filters = if in_ci { + vec![("ref", r".*"), ("start", r".*"), ("how-to", r".*")] + } else { + vec![ + ("intro", r".*"), + ("ref", r".*"), + ("start", r".*"), + ("how-to", r".*"), + ] + }; let template_dir_root = Path::new("templates"); // This is a directory that we create to keep testing artifacts outside the code