diff --git a/README.md b/README.md index 757aa7f..b66d7c7 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,12 @@ Please refer to our [Contributing Guidelines](/CONTRIBUTING.md). 3. Run `make build` or `docker build --tag insomnia-docs:latest .`. 4. Run `make run` or `docker run --rm -it -p 4000:4000 -v ${PWD}/docs:/docs insomnia-docs:latest`. 5. Browse to . + +## Run with nix + +1. Clone the repository. +2. Install [Nix](https://nixos.org/). +3. `cd docs` +4. `nix-shell` +5. `bundle install` +6. `bundle exec jekyll serve -H 0.0.0.0 -P 4000 --watch` diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index acda35b..8e1a7bf 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -11,10 +11,18 @@ GEM http_parser.rb (~> 0) eventmachine (1.2.7) ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-arm64-darwin) + ffi (1.17.0-x86_64-darwin) forwardable-extended (2.6.0) google-protobuf (4.28.1-aarch64-linux) bigdecimal rake (>= 13) + google-protobuf (4.28.1-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.28.1-x86_64-darwin) + bigdecimal + rake (>= 13) http_parser.rb (0.8.0) i18n (1.14.6) concurrent-ruby (~> 1.0) @@ -65,8 +73,9 @@ GEM rexml (3.3.7) rouge (4.4.0) safe_yaml (1.0.5) - sass-embedded (1.79.1-aarch64-linux-gnu) + sass-embedded (1.79.1) google-protobuf (~> 4.27) + rake (>= 13) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) unicode-display_width (2.6.0) @@ -74,6 +83,7 @@ GEM PLATFORMS aarch64-linux + arm64-darwin-23 universal-darwin-20 universal-darwin-21 diff --git a/docs/_data/main-nav.yaml b/docs/_data/main-nav.yaml index ea66449..da5dccf 100644 --- a/docs/_data/main-nav.yaml +++ b/docs/_data/main-nav.yaml @@ -196,6 +196,8 @@ toc: subfolderitems: - title: inso run test url: /inso-cli/cli-command-reference/inso-run-test + - title: inso run collection + url: /inso-cli/cli-command-reference/inso-run-collection - title: inso lint spec url: /inso-cli/cli-command-reference/inso-lint-spec - title: inso export spec diff --git a/docs/inso-cli/cli-command-reference.md b/docs/inso-cli/cli-command-reference.md index 7a0fc6c..a9ed71f 100644 --- a/docs/inso-cli/cli-command-reference.md +++ b/docs/inso-cli/cli-command-reference.md @@ -10,9 +10,11 @@ This reference guide provides in-depth information about the Inso CLI commands. ## Command Overview {:.table .table-striped} + Command | Description ------- | ----------- [inso run test](/inso-cli/cli-command-reference/inso-run-test) | Execute unit tests written in Insomnia via a CLI. +[inso run collection](/inso-cli/cli-command-reference/inso-run-collection) | Run Insomnia request collection via a CLI. [inso lint spec](/inso-cli/cli-command-reference/inso-lint-spec) | Lint an OpenAPI specification (the latest version supports OpenAPI 3.1) via a CLI. (Custom Lint Ruleset support is in progress). [inso export spec](/inso-cli/cli-command-reference/inso-export-spec) | Export the raw OpenAPI specification from the Insomnia data store. [inso script](/inso-cli/cli-command-reference/inso-script) | Execute any scripts defined in the Inso CLI configuration file. @@ -20,8 +22,8 @@ Command | Description ## Global Flags {:.table .table-striped} + Option | Alias | Description ----- | ------ | ------- `--output ` | -o | Save the specification to a file in the working directory. -`--workingDir ` || Specify a working directory. -`--src ` || Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, `inso-cli` looks for an `.insomnia` folder in the working directory by default. +`--workingDir ` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml diff --git a/docs/inso-cli/cli-command-reference/inso-export-spec.md b/docs/inso-cli/cli-command-reference/inso-export-spec.md index e2f1841..289f852 100644 --- a/docs/inso-cli/cli-command-reference/inso-export-spec.md +++ b/docs/inso-cli/cli-command-reference/inso-export-spec.md @@ -21,8 +21,7 @@ inso export spec [identifier] Option | Alias | Description ----- | ------ | ------- `--output ` | -o | Save the specification to a file in the working directory. -`--workingDir ` || Specify a working directory. This is the directory that the exported file will reside in. -`--src ` || Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, `inso-cli` looks for an `.insomnia` folder in the working directory by default. +`--workingDir ` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml ## Examples diff --git a/docs/inso-cli/cli-command-reference/inso-lint-spec.md b/docs/inso-cli/cli-command-reference/inso-lint-spec.md index 1c0b232..025f374 100644 --- a/docs/inso-cli/cli-command-reference/inso-lint-spec.md +++ b/docs/inso-cli/cli-command-reference/inso-lint-spec.md @@ -29,8 +29,7 @@ At the moment Inso CLI uses Spectral's default `oas` Ruleset Definition. For mor Option | Alias | Description ----- | ------ | ------- `--output ` | -o | Save the specification to a file in the working directory. -`--workingDir ` || Specify a working directory. -`--src ` || Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, `inso-cli` looks for an `.insomnia` folder in the working directory by default. +`--workingDir ` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml ## Examples diff --git a/docs/inso-cli/cli-command-reference/inso-run-collection.md b/docs/inso-cli/cli-command-reference/inso-run-collection.md new file mode 100644 index 0000000..c68eda2 --- /dev/null +++ b/docs/inso-cli/cli-command-reference/inso-run-collection.md @@ -0,0 +1,57 @@ +--- +layout: article-detail +title: inso run collection +category: "CLI Command Reference" +category-url: inso-cli +--- + +The `inso run collection` command is used to manually run collections to test the functionality of your API. It will execute any requests specified and associated scripts including any after response tests. You can also use this to automate collection runs on CI/CD pipelines. + +## Command + +```bash +inso run collection [identifier] +``` + +This prompts user for collection and environment selection. After selection it will execute the selected collection against the selected environment. You may choose to specify the collection and environment directly as well, see examples below. + +## Options + +The options currently supported are: + +{:.table .table-striped} + +| Option | Alias | Description | +| --------------------------- | ----- | ------------------------------------------------------------------------------- | +| `--env ` | -e | the environment to use - an environment name or id | +| `--env-var` | | specifies environment variables in a key=value format. Multiple CLI environment variables can be added by using --env-var multiple times, for example: --env-var "this=that" --env-var "alpha=beta". | +| `--reporter ` | -r | reporter to use, options are dot, list, spec, min and progress (default: spec ) | +| `--requestNamePattern ` | -t | run requests that match the regex | +| `--bail` | -b | abort ("bail") after the first request failure | +| `--item` | -i | runs only the specified folder UID or request UID from the collection. Multiple items can be run in order by specifying -i/--item multiple times, for example: inso run collection collectionUID -i folder1UID -i folder2UID | +| `--delay-request` | | specifies a delay (in milliseconds) between requests. The default is 0. | +| `--iteration-count` | -n | specifies the number of times the collection will run when used in conjunction with the iteration data file. | +| `--iteration-data` | -d | specifies a data source file (JSON or CSV) to be used for iteration. You can specify a local file path or a URL to the data file. | +| `--disableCertValidation` | | disable certificate validation for requests with SSL | + +## Global Flags + +{:.table .table-striped} + +| Option | Alias | Description | +| --------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--workingDir ` | | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml | + +## Examples + +```bash +inso run collection wrk_5b5ab6 --reporter progress --bail +``` + +```bash +inso run collection -w ~/simple.yaml -e env_2eecf85b7f wrk_0702a5 +``` + +```bash +inso run collection -d ~/files/runner-data.json -w ~/three-requests.yml -n 2 -i req_3fd28aabbb18447abab1f45e6ee4bdc1 -e env_86e135 --verbose +``` diff --git a/docs/inso-cli/cli-command-reference/inso-run-test.md b/docs/inso-cli/cli-command-reference/inso-run-test.md index ce15513..9eadb44 100644 --- a/docs/inso-cli/cli-command-reference/inso-run-test.md +++ b/docs/inso-cli/cli-command-reference/inso-run-test.md @@ -36,8 +36,7 @@ Option | Alias | Description {:.table .table-striped} Option | Alias | Description ----- | ------ | ------- -`--workingDir ` || Specify a working directory. -`--src ` || Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, `inso-cli` looks for an `.insomnia` folder in the working directory by default. +`--workingDir ` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml ## Examples diff --git a/docs/inso-cli/cli-command-reference/inso-script.md b/docs/inso-cli/cli-command-reference/inso-script.md index 1e79e65..217bf33 100644 --- a/docs/inso-cli/cli-command-reference/inso-script.md +++ b/docs/inso-cli/cli-command-reference/inso-script.md @@ -21,8 +21,7 @@ inso script Option | Alias | Description ----- | ------ | ------- `--output ` | -o | Save the specification to a file in the working directory. -`--workingDir ` || Specify a working directory. -`--src ` || Specify the V4 export file or the Insomnia app data directory. You can use this option to set a Git data directory. If not specified, `inso-cli` looks for an `.insomnia` folder in the working directory by default. +`--workingDir ` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml ## Examples diff --git a/docs/insomnia/collection-runner.md b/docs/insomnia/collection-runner.md index 711e4b2..7304c28 100644 --- a/docs/insomnia/collection-runner.md +++ b/docs/insomnia/collection-runner.md @@ -37,3 +37,8 @@ The **Test Results** section is also available when you run tests for an individ {:.alert .alert-primary} **Note**: The test results shown in the Requests and in the Collection Runner are not to be confused with [Insomnia's Unit Testing feature](/insomnia/unit-testing). + + +## Run with CLI + +The Run button dropdown includes an option to generate the CLI command which can be used to run the same collection using inso CLI. This command can be used in combination with [setup-inso](https://github.com/kong/setup-inso) to run this collection in a GitHub action. More information about the CLI options can be found in the [CLI docs section](/inso-cli/cli-command-reference) diff --git a/docs/shell.nix b/docs/shell.nix new file mode 100644 index 0000000..5545d68 --- /dev/null +++ b/docs/shell.nix @@ -0,0 +1,11 @@ +with import { }; +stdenv.mkDerivation { + name = "env"; + buildInputs = [ + ruby + ]; +} +# to install +# bundle install +# to run +# bundle exec jekyll serve -H 0.0.0.0 -P 4000 --watch