diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e14fc87..1593235 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,5 @@ +# Overview + * If you have found a discrepancy in documented and observed behaviour, that is a bug. Feel free to [report it as an issue](https://github.com/mpalmer/action-validator/issues), providing @@ -9,8 +11,83 @@ * At all times, abide by the Code of Conduct (CODE_OF_CONDUCT.md). +--- + # Environment Setup +## Install Rust +Firstly, you'll need make any changes to the core functionality of this project. We recommend use `rustup`, on the recommendation of the rust team. You can find the installation instructions [here](https://www.rust-lang.org/tools/install). + +To confirm that rust is installed, run the `cargo` command. If you don't receive the help docs output, you may need to add rust to your shell rc file. + +## Git Submodule Setup +This repository uses [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules). Specifically for the use of [schemastore](https://github.com/SchemaStore/schemastore). + +To setup the git submodule after cloning this repo to your local, you'll want to run the following commands: +1. `git submodule init` +2. `git submodule update` + +It should look similar to the output below. + +```bash +❯ git submodule init +Submodule 'src/schemastore' (https://github.com/SchemaStore/schemastore) registered for path 'src +/schemastore' +❯ git submodule update +Cloning into '/Users/someuser/action-validator/src/schemastore'... +Submodule path 'src/schemastore': checked out 'd3e6ab7727380b214acbab05570fb09a3e5d2dfc' +``` + +At this point, you should be all set to `cargo run`! If you run into any issues here, please [create an issue](https://github.com/mpalmer/action-validator/issues/new/choose). + # Running the Validator Locally +## `cargo run [FILE] -- [OPTIONS]` +`cargo run` will create a _debug_ executable and run the project. If this is your first time running the command, cargo will compile the development binary with `cargo build`. This will install all of the dependencies and create the debug binary `action-validator` in the `/target/debug/` directory. `cargo run` will then invoke this binary after creation. + +One caveat if you're running with `cargo run`: if you want to supply the program with options, you need to use the `--` operator between `cargo run` and your provided options. This let's cargo know which flags are meant for cargo, and which are meant for the executable. + +## `cargo build` && `./target/debug/action-validator [OPTIONS]` +As discussed in the prior section, `cargo build` install dependencies (if they're not cached) and build the development binary. This binary can then be invoked directly by running `./target/debug/action-validator`. This does **not** require the use of the `--` operator in between the binary and any provided options. + +## Try It Yourself! + +Run the command `cargo run -- --help`. You should see an output similar to the following. +```bash +❯ cargo run -- --help + Finished dev [unoptimized + debuginfo] target(s) in 0.05s + Running `target/debug/action-validator --help` +A validator for GitHub Action and Workflow YAML files + +Usage: action-validator [OPTIONS] [path_to_action_yaml]... + +Arguments: + [path_to_action_yaml]... Input file + +Options: + -v, --verbose Be more verbose + -h, --help Print help information + -V, --version Print version information +``` + # Writing Tests +All tests live in the `tests` directory. Currently, this project implements snapshot testing, +but that's not to say you couldn't write unit or integration tests with the current structure. +To run the tests, simply run `cargo test` from the root directory. If you want to test a specific +feature, you can add the `-F {feature}` flag (e.g. `cargo test -F remote-checks`). + +## Unit/Integration Tests +As of this writing, there are no unit or integration tests. If you are looking to write some, please +follow the directions in [this guide](https://doc.rust-lang.org/book/ch11-01-writing-tests.html). + +## Snapshot Tests +A snapshot test is performed when we execute the cli and capture `stdout`, `stderr`, and/or an exit code. +When the tests is run, the results of the test must exactly match those of the previous run. For this project, +the snapshot tests are named in the format `{next_id}_{whats_being_tested}` (e.g. `011_remote_checks_failure`). + +If you have made changes which will change the output of the program and cause snapshots to fail, you can run +`cargo test -F save-snapshots`. This feature causes the executed command to save the `stdout`, `stderr`, and/or +exit code to the specified testing directory. + +If you are writing a net new test, you will need to create the test directory with your workflow or action file. +Once you're done, you can save the results to that directy by running `cargo test -F save-snapshots`. diff --git a/Cargo.toml b/Cargo.toml index 8ad7c11..cdf264b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,11 @@ include = [ "/src/schemastore/src/schemas/json/github-action.json" ] version = "0.0.0-git" -authors = ["Matt Palmer "] +authors = [ + "Matt Palmer ", + "Ben Heidemann ", + "Austin Ward " +] edition = "2021" # If this is changed, .github/workflows/qa.yml build matrix needs updating as well rust-version = "1.60.0" @@ -20,7 +24,8 @@ rust-version = "1.60.0" crate-type = ["cdylib", "rlib"] [features] -js = ["console_error_panic_hook", "wee_alloc", "valico/js"] +js = ["console_error_panic_hook", "valico/js"] +save-snapshots = [] [dependencies] clap = { version = "4.0", features = ["derive"] } @@ -39,14 +44,12 @@ wasm-bindgen = "0.2.63" # code size when deploying. console_error_panic_hook = { version = "0.1.6", optional = true } -# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size -# compared to the default allocator's ~10K. It is slower than the default -# allocator, however. -wee_alloc = { version = "0.4.5", optional = true } serde-wasm-bindgen = "0.4.5" [dev-dependencies] wasm-bindgen-test = "0.3.13" +rstest = "0.16.0" +assert_cmd = "2.0.8" [profile.release] # Tell `rustc` to optimize for small code size. diff --git a/README.md b/README.md index e600dcc..933f0f0 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Update your .pre-commit-config.yaml: ``` repos: - repo: https://github.com/mpalmer/action-validator - rev: v0.4.0 + rev: v0.5.1 hooks: - id: action-validator ``` diff --git a/bin/run-action-validator b/bin/run-action-validator old mode 100644 new mode 100755 diff --git a/test/004_failing_globs/stdout b/test/004_failing_globs/stdout deleted file mode 100644 index 4179a2f..0000000 --- a/test/004_failing_globs/stdout +++ /dev/null @@ -1 +0,0 @@ -Fatal error validating 004_failing_globs/glob.yml diff --git a/test/007_funky_syntax/stdout b/test/007_funky_syntax/stdout deleted file mode 100644 index f57da30..0000000 --- a/test/007_funky_syntax/stdout +++ /dev/null @@ -1 +0,0 @@ -Fatal error validating 007_funky_syntax/rust-check.yml diff --git a/test/008_job_dependencies/stdout b/test/008_job_dependencies/stdout deleted file mode 100644 index 73dc3ee..0000000 --- a/test/008_job_dependencies/stdout +++ /dev/null @@ -1 +0,0 @@ -Fatal error validating 008_job_dependencies/test.yml diff --git a/test/009_multi_file/stdout b/test/009_multi_file/stdout deleted file mode 100644 index ec1a3fd..0000000 --- a/test/009_multi_file/stdout +++ /dev/null @@ -1 +0,0 @@ -Fatal error validating 009_multi_file/xinvalid.yml diff --git a/test/001_basic_workflow/test.yml b/tests/001_basic_workflow/test.yml similarity index 100% rename from test/001_basic_workflow/test.yml rename to tests/001_basic_workflow/test.yml diff --git a/test/001_basic_workflow/validation_state.snap.json b/tests/001_basic_workflow/validation_state.snap.json similarity index 100% rename from test/001_basic_workflow/validation_state.snap.json rename to tests/001_basic_workflow/validation_state.snap.json diff --git a/test/002_basic_action/action.yml b/tests/002_basic_action/action.yml similarity index 100% rename from test/002_basic_action/action.yml rename to tests/002_basic_action/action.yml diff --git a/test/002_basic_action/validation_state.snap.json b/tests/002_basic_action/validation_state.snap.json similarity index 100% rename from test/002_basic_action/validation_state.snap.json rename to tests/002_basic_action/validation_state.snap.json diff --git a/test/003_successful_globs/glob.yml b/tests/003_successful_globs/glob.yml similarity index 88% rename from test/003_successful_globs/glob.yml rename to tests/003_successful_globs/glob.yml index 6608e8b..2981f5b 100644 --- a/test/003_successful_globs/glob.yml +++ b/tests/003_successful_globs/glob.yml @@ -3,7 +3,7 @@ name: Test on: push: paths: - - 003_successful_globs/* + - ./tests/003_successful_globs/* defaults: run: diff --git a/test/003_successful_globs/validation_state.snap.json b/tests/003_successful_globs/validation_state.snap.json similarity index 100% rename from test/003_successful_globs/validation_state.snap.json rename to tests/003_successful_globs/validation_state.snap.json diff --git a/test/004_failing_globs/exitcode b/tests/004_failing_globs/exitcode similarity index 100% rename from test/004_failing_globs/exitcode rename to tests/004_failing_globs/exitcode diff --git a/test/004_failing_globs/glob.yml b/tests/004_failing_globs/glob.yml similarity index 89% rename from test/004_failing_globs/glob.yml rename to tests/004_failing_globs/glob.yml index 7c4d27e..fa2a7c8 100644 --- a/test/004_failing_globs/glob.yml +++ b/tests/004_failing_globs/glob.yml @@ -3,7 +3,7 @@ name: Bad globs, no biscuit on: push: paths: - - 004_bad_globs/*.txt + - ./tests/004_bad_globs/*.txt defaults: run: diff --git a/test/004_failing_globs/stderr b/tests/004_failing_globs/stderr similarity index 70% rename from test/004_failing_globs/stderr rename to tests/004_failing_globs/stderr index 2171874..f7e987a 100644 --- a/test/004_failing_globs/stderr +++ b/tests/004_failing_globs/stderr @@ -3,13 +3,13 @@ Validation failed: ValidationState { Workflow, ), file_path: Some( - "004_failing_globs/glob.yml", + "./tests/004_failing_globs/glob.yml", ), errors: [ NoFilesMatchingGlob { code: "glob_not_matched", detail: Some( - "Glob \"004_bad_globs/*.txt\" in /on/push/paths does not match any files", + "Glob \"./tests/004_bad_globs/*.txt\" in /on/push/paths does not match any files", ), path: "/on/push/paths", title: "Glob does not match any files", diff --git a/tests/004_failing_globs/stdout b/tests/004_failing_globs/stdout new file mode 100644 index 0000000..2455d96 --- /dev/null +++ b/tests/004_failing_globs/stdout @@ -0,0 +1 @@ +Fatal error validating ./tests/004_failing_globs/glob.yml diff --git a/test/004_failing_globs/validation_state.snap.json b/tests/004_failing_globs/validation_state.snap.json similarity index 100% rename from test/004_failing_globs/validation_state.snap.json rename to tests/004_failing_globs/validation_state.snap.json diff --git a/test/005_conditional_step_in_action/action.yml b/tests/005_conditional_step_in_action/action.yml similarity index 100% rename from test/005_conditional_step_in_action/action.yml rename to tests/005_conditional_step_in_action/action.yml diff --git a/test/005_conditional_step_in_action/validation_state.snap.json b/tests/005_conditional_step_in_action/validation_state.snap.json similarity index 100% rename from test/005_conditional_step_in_action/validation_state.snap.json rename to tests/005_conditional_step_in_action/validation_state.snap.json diff --git a/test/006_workflow_dispatch_inputs_options/test.yml b/tests/006_workflow_dispatch_inputs_options/test.yml similarity index 100% rename from test/006_workflow_dispatch_inputs_options/test.yml rename to tests/006_workflow_dispatch_inputs_options/test.yml diff --git a/test/006_workflow_dispatch_inputs_options/validation_state.snap.json b/tests/006_workflow_dispatch_inputs_options/validation_state.snap.json similarity index 100% rename from test/006_workflow_dispatch_inputs_options/validation_state.snap.json rename to tests/006_workflow_dispatch_inputs_options/validation_state.snap.json diff --git a/test/007_funky_syntax/exitcode b/tests/007_funky_syntax/exitcode similarity index 100% rename from test/007_funky_syntax/exitcode rename to tests/007_funky_syntax/exitcode diff --git a/test/007_funky_syntax/rust-check.yml b/tests/007_funky_syntax/rust-check.yml similarity index 100% rename from test/007_funky_syntax/rust-check.yml rename to tests/007_funky_syntax/rust-check.yml diff --git a/test/007_funky_syntax/stderr b/tests/007_funky_syntax/stderr similarity index 91% rename from test/007_funky_syntax/stderr rename to tests/007_funky_syntax/stderr index 17c1d62..fbafbf5 100644 --- a/test/007_funky_syntax/stderr +++ b/tests/007_funky_syntax/stderr @@ -3,7 +3,7 @@ Validation failed: ValidationState { Workflow, ), file_path: Some( - "007_funky_syntax/rust-check.yml", + "./tests/007_funky_syntax/rust-check.yml", ), errors: [ Parse { diff --git a/tests/007_funky_syntax/stdout b/tests/007_funky_syntax/stdout new file mode 100644 index 0000000..a8b577f --- /dev/null +++ b/tests/007_funky_syntax/stdout @@ -0,0 +1 @@ +Fatal error validating ./tests/007_funky_syntax/rust-check.yml diff --git a/test/007_funky_syntax/validation_state.snap.json b/tests/007_funky_syntax/validation_state.snap.json similarity index 100% rename from test/007_funky_syntax/validation_state.snap.json rename to tests/007_funky_syntax/validation_state.snap.json diff --git a/test/008_job_dependencies/exitcode b/tests/008_job_dependencies/exitcode similarity index 100% rename from test/008_job_dependencies/exitcode rename to tests/008_job_dependencies/exitcode diff --git a/test/008_job_dependencies/stderr b/tests/008_job_dependencies/stderr similarity index 88% rename from test/008_job_dependencies/stderr rename to tests/008_job_dependencies/stderr index a8d64bf..d859143 100644 --- a/test/008_job_dependencies/stderr +++ b/tests/008_job_dependencies/stderr @@ -3,7 +3,7 @@ Validation failed: ValidationState { Workflow, ), file_path: Some( - "008_job_dependencies/test.yml", + "./tests/008_job_dependencies/test.yml", ), errors: [ UnresolvedJob { diff --git a/tests/008_job_dependencies/stdout b/tests/008_job_dependencies/stdout new file mode 100644 index 0000000..3576abf --- /dev/null +++ b/tests/008_job_dependencies/stdout @@ -0,0 +1 @@ +Fatal error validating ./tests/008_job_dependencies/test.yml diff --git a/test/008_job_dependencies/test.yml b/tests/008_job_dependencies/test.yml similarity index 100% rename from test/008_job_dependencies/test.yml rename to tests/008_job_dependencies/test.yml diff --git a/test/008_job_dependencies/validation_state.snap.json b/tests/008_job_dependencies/validation_state.snap.json similarity index 100% rename from test/008_job_dependencies/validation_state.snap.json rename to tests/008_job_dependencies/validation_state.snap.json diff --git a/test/009_multi_file/exitcode b/tests/009_multi_file/exitcode similarity index 100% rename from test/009_multi_file/exitcode rename to tests/009_multi_file/exitcode diff --git a/test/009_multi_file/stderr b/tests/009_multi_file/stderr similarity index 92% rename from test/009_multi_file/stderr rename to tests/009_multi_file/stderr index b4fe130..6e52470 100644 --- a/test/009_multi_file/stderr +++ b/tests/009_multi_file/stderr @@ -3,7 +3,7 @@ Validation failed: ValidationState { Workflow, ), file_path: Some( - "009_multi_file/xinvalid.yml", + "./tests/009_multi_file/xinvalid.yml", ), errors: [ Parse { diff --git a/tests/009_multi_file/stdout b/tests/009_multi_file/stdout new file mode 100644 index 0000000..8e003c7 --- /dev/null +++ b/tests/009_multi_file/stdout @@ -0,0 +1 @@ +Fatal error validating ./tests/009_multi_file/xinvalid.yml diff --git a/test/009_multi_file/valid.yml b/tests/009_multi_file/valid.yml similarity index 100% rename from test/009_multi_file/valid.yml rename to tests/009_multi_file/valid.yml diff --git a/test/009_multi_file/validation_state.snap.json b/tests/009_multi_file/validation_state.snap.json similarity index 100% rename from test/009_multi_file/validation_state.snap.json rename to tests/009_multi_file/validation_state.snap.json diff --git a/test/009_multi_file/xinvalid.yml b/tests/009_multi_file/xinvalid.yml similarity index 100% rename from test/009_multi_file/xinvalid.yml rename to tests/009_multi_file/xinvalid.yml diff --git a/tests/010_remote_checks_ok/test.yml b/tests/010_remote_checks_ok/test.yml new file mode 100644 index 0000000..88adf73 --- /dev/null +++ b/tests/010_remote_checks_ok/test.yml @@ -0,0 +1,78 @@ +name: Test + +on: + push: + pull_request: + branches: + - main + +defaults: + run: + shell: bash + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + default: true + + - name: Check Formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + + - name: Check with Clippy + uses: actions-rs/clippy-check@v1 + with: + args: -- -Dwarnings + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Shellcheck + uses: ludeeus/action-shellcheck@master + + - name: Install shfmt + uses: mfinelli/setup-shfmt@master + + - name: Run shfmt + run: shfmt -d bin/* + + + build: + strategy: + matrix: + rust-toolchain: + - stable + - nightly + os: + - ubuntu-latest + - macos-latest + - windows-latest + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust-toolchain }} + override: true + default: true + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features diff --git a/tests/011_remote_checks_failure/exitcode b/tests/011_remote_checks_failure/exitcode new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/011_remote_checks_failure/exitcode @@ -0,0 +1 @@ +1 diff --git a/tests/011_remote_checks_failure/stderr b/tests/011_remote_checks_failure/stderr new file mode 100644 index 0000000..c9bc9dc --- /dev/null +++ b/tests/011_remote_checks_failure/stderr @@ -0,0 +1,18 @@ +Validation failed: ValidationState { + action_type: Some( + Workflow, + ), + file_path: Some( + "./tests/011_remote_checks_failure/test.yml", + ), + errors: [ + Unknown { + code: "action_not_found", + detail: Some( + "Could not find action: actions/checkouts@v2", + ), + path: "jobs/build/steps/uses/actions/checkouts@v2", + title: "Action Not Found", + }, + ], +} diff --git a/tests/011_remote_checks_failure/stdout b/tests/011_remote_checks_failure/stdout new file mode 100644 index 0000000..79ef8c0 --- /dev/null +++ b/tests/011_remote_checks_failure/stdout @@ -0,0 +1 @@ +Fatal error validating ./tests/011_remote_checks_failure/test.yml diff --git a/tests/011_remote_checks_failure/test.yml b/tests/011_remote_checks_failure/test.yml new file mode 100644 index 0000000..6a5105e --- /dev/null +++ b/tests/011_remote_checks_failure/test.yml @@ -0,0 +1,78 @@ +name: Test + +on: + push: + pull_request: + branches: + - main + +defaults: + run: + shell: bash + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + default: true + + - name: Check Formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + + - name: Check with Clippy + uses: actions-rs/clippy-check@v1 + with: + args: -- -Dwarnings + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Shellcheck + uses: ludeeus/action-shellcheck@master + + - name: Install shfmt + uses: mfinelli/setup-shfmt@master + + - name: Run shfmt + run: shfmt -d bin/* + + + build: + strategy: + matrix: + rust-toolchain: + - stable + - nightly + os: + - ubuntu-latest + - macos-latest + - windows-latest + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkouts@v2 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust-toolchain }} + override: true + default: true + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features diff --git a/test/run b/tests/run similarity index 100% rename from test/run rename to tests/run diff --git a/test/run.mjs b/tests/run.mjs similarity index 100% rename from test/run.mjs rename to tests/run.mjs diff --git a/tests/snapshot_tests.rs b/tests/snapshot_tests.rs new file mode 100644 index 0000000..9f56ff0 --- /dev/null +++ b/tests/snapshot_tests.rs @@ -0,0 +1,140 @@ +use std::{fs::{self, File}, ffi::{OsString, OsStr}}; +use std::io::prelude::*; + +use rstest::rstest; +use assert_cmd::Command; + + +#[derive(Debug)] +struct SnapshotTest { + test_dir: String, + exitcode: i32, + stderr: String, + stdout: String, + test_files: Vec, +} + +impl SnapshotTest { + fn new(test_dir: String) -> Self { + let stderr = fs::read_to_string( + format!("./tests/{test_dir}/stderr"), + ).unwrap_or(String::from("")); + + let stdout = fs::read_to_string( + format!("./tests/{test_dir}/stdout"), + ).unwrap_or(String::from("")); + + let exitcode: i32 = fs::read_to_string( + format!("./tests/{test_dir}/exitcode"), + ).map(|s| { + s + .strip_suffix("\n") + .unwrap_or(s.as_str()) + .parse::() + .unwrap_or(0) + }).unwrap_or(0); + + let test_files = Self::_get_files(&test_dir); + + SnapshotTest { + test_dir, + exitcode, + stderr, + stdout, + test_files, + } + } + + #[cfg(not(feature = "save-snapshots"))] + fn execute(self) { + Command::cargo_bin( + env!("CARGO_PKG_NAME"), + ) + .expect("binary to execute") + .args(self.test_files) + .assert() + .stdout(self.stdout) + .stderr(self.stderr) + .code(self.exitcode); + } + + #[cfg(feature = "save-snapshots")] + fn execute(&self) { + let test_dir = self.test_dir.to_owned(); + let test_files = self.test_files.to_owned(); + let result = Command::cargo_bin( + env!("CARGO_PKG_NAME"), + ) + .expect("binary to execute") + .args(test_files).ok().unwrap_or_else(|e| e.as_output().unwrap().to_owned()); + + if !result.stdout.is_empty() { + self._save_contents( + format!("./tests/{test_dir}/stdout"), + result.stdout, + ); + } + if !result.stderr.is_empty() { + self._save_contents( + format!("./tests/{test_dir}/stderr"), + result.stderr, + ); + } + if let Some(exitcode) = result.status.code() { + if exitcode > 0 { + self._save_contents( + format!("./tests/{test_dir}/exitcode"), + format!("{exitcode}\n").into(), + ); + } + } + } + + fn _save_contents( + &self, + file_name: String, + contents: Vec, + ) { + println!("Saving {}", file_name); + let res = File::create(file_name).unwrap().write_all( + &contents, + ); + assert!(res.is_ok(), "{:?}", res); + } + + fn _get_files(test_dir: &String) -> Vec { + let yml = Some(OsStr::new("yml")); + fs::read_dir( + format!("./tests/{test_dir}"), + ) + .unwrap() + .filter_map(Result::ok) + .filter(|f| f.path().extension() == yml) + .map(|f| f.path().into_os_string()) + .collect::>() + } +} + + +#[rstest] +#[case("001_basic_workflow")] +#[case("002_basic_action")] +#[case("003_successful_globs")] +#[case("004_failing_globs")] +#[case("005_conditional_step_in_action")] +#[case("006_workflow_dispatch_inputs_options")] +#[case("007_funky_syntax")] +#[case("008_job_dependencies")] +#[case("009_multi_file")] +#[cfg(not(feature = "remote-checks"))] +fn snapshot(#[case] dir_name: String) { + SnapshotTest::new(dir_name).execute(); +} + +#[rstest] +#[case("010_remote_checks_ok")] +#[case("011_remote_checks_failure")] +#[cfg(feature = "remote-checks")] +fn snapshot_remote_checks(#[case] dir_name: String) { + SnapshotTest::new(dir_name).execute(); +}