From 4e145e747e05c061acb2a5ee092820b251708458 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Thu, 7 Mar 2024 09:41:09 -0300 Subject: [PATCH] Ignore ts-rs tests by default --- .github/workflows/test.yml | 18 +++++++++--------- macros/src/lib.rs | 5 +++-- ts-rs/src/lib.rs | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 133d37be6..4903045a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,12 +12,12 @@ jobs: - name: dependencies e2e test working-directory: e2e/dependencies/consumer run: | - cargo t + cargo t -- --ignored tsc bindings/* --noEmit --noUnusedLocals --strict - name: dependencies e2e test with default export env working-directory: e2e/dependencies/consumer run: | - TS_RS_EXPORT_DIR=custom-bindings cargo t + TS_RS_EXPORT_DIR=custom-bindings cargo t -- --ignored shopt -s globstar tsc custom-bindings/**/*.ts --noEmit --noUnusedLocals --strict e2e-workspace: @@ -31,12 +31,12 @@ jobs: - name: workspace e2e test working-directory: e2e/workspace run: | - cargo t + cargo t -- --ignored tsc parent/bindings/* --noEmit --noUnusedLocals --strict - name: workspace e2e with default export env working-directory: e2e/workspace run: | - TS_RS_EXPORT_DIR=custom-bindings cargo t + TS_RS_EXPORT_DIR=custom-bindings cargo t -- --ignored shopt -s globstar tsc parent/custom-bindings/**/*.ts --noEmit --noUnusedLocals --strict e2e-example: @@ -50,12 +50,12 @@ jobs: - name: example e2e test working-directory: example run: | - cargo t + cargo t -- --ignored tsc bindings/* --noEmit - name: example e2e with default export env working-directory: example run: | - TS_RS_EXPORT_DIR=custom-bindings cargo t + TS_RS_EXPORT_DIR=custom-bindings cargo t -- --ignored shopt -s globstar tsc custom-bindings/**/*.ts --noEmit --noUnusedLocals --strict @@ -83,16 +83,16 @@ jobs: toolchain: stable - name: Test with export env run: | - TS_RS_EXPORT_DIR=output cargo test --no-default-features + TS_RS_EXPORT_DIR=output cargo test --no-default-features -- --ignored shopt -s globstar tsc ts-rs/output/tests-out/**/*.ts --noEmit --noUnusedLocals --strict - name: No features run: | - cargo test --no-default-features + cargo test --no-default-features -- --ignored shopt -s globstar tsc ts-rs/tests-out/**/*.ts --noEmit --noUnusedLocals - name: All features run: | - cargo test --all-features + cargo test --all-features -- --ignored shopt -s globstar tsc ts-rs/tests-out/**/*.ts --noEmit --noUnusedLocals --strict diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 09cd71d23..ed99bf8cb 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -110,11 +110,11 @@ impl DerivedTS { /// Generate a dummy unit struct for every generic type parameter of this type. /// Example: - /// ```ignore + /// ```no_run /// struct Generic { /* ... */ } /// ``` /// has two generic type parameters, `A` and `B`. This function will therefor generate - /// ```ignore + /// ```no_run /// struct A; /// impl ts_rs::TS for A { /* .. */ } /// @@ -152,6 +152,7 @@ impl DerivedTS { quote! { #[cfg(test)] #[test] + #[ignore = "To export your ts-rs bindings, run `cargo test export_bindings_ -- --ignored`"] fn #test_fn() { #ty::export().expect("could not export type"); } diff --git a/ts-rs/src/lib.rs b/ts-rs/src/lib.rs index 4db38eedc..4f682377b 100644 --- a/ts-rs/src/lib.rs +++ b/ts-rs/src/lib.rs @@ -278,7 +278,7 @@ pub trait TS { /// a dummy type, e.g `ts_rs::Dummy` or `()`. /// The only requirement for these dummy types is that `EXPORT_TO` must be `None`. /// Example: - /// ```ignore + /// ```no_run /// struct GenericType(A, B); /// impl TS for GenericType { /// type WithoutGenerics = GenericType;