Skip to content

Commit

Permalink
Update collection-runner.md (#235)
Browse files Browse the repository at this point in the history
* Update collection-runner.md

add run with CLI and link to CLI docs

* chore: add inso run collection docs

* add nix shell

* wip

* working dir change

* docs!

* add aarch64

* nix instructions

---------

Co-authored-by: Filipe Freire <[email protected]>
  • Loading branch information
jackkav and filfreire authored Oct 3, 2024
1 parent 98c837b commit 11a9211
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 11 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://localhost:4000>.

## 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`
12 changes: 11 additions & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -65,15 +73,17 @@ 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)
webrick (1.8.1)

PLATFORMS
aarch64-linux
arm64-darwin-23
universal-darwin-20
universal-darwin-21

Expand Down
2 changes: 2 additions & 0 deletions docs/_data/main-nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions docs/inso-cli/cli-command-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ 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.

## Global Flags

{:.table .table-striped}

Option | Alias | Description
----- | ------ | -------
`--output <path>` | -o | Save the specification to a file in the working directory.
`--workingDir <path>` || Specify a working directory.
`--src <path>` || 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 <path>` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml
3 changes: 1 addition & 2 deletions docs/inso-cli/cli-command-reference/inso-export-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ inso export spec [identifier]
Option | Alias | Description
----- | ------ | -------
`--output <path>` | -o | Save the specification to a file in the working directory.
`--workingDir <path>` || Specify a working directory. This is the directory that the exported file will reside in.
`--src <path>` || 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 <path>` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml

## Examples

Expand Down
3 changes: 1 addition & 2 deletions docs/inso-cli/cli-command-reference/inso-lint-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ At the moment Inso CLI uses Spectral's default `oas` Ruleset Definition. For mor
Option | Alias | Description
----- | ------ | -------
`--output <path>` | -o | Save the specification to a file in the working directory.
`--workingDir <path>` || Specify a working directory.
`--src <path>` || 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 <path>` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml

## Examples

Expand Down
57 changes: 57 additions & 0 deletions docs/inso-cli/cli-command-reference/inso-run-collection.md
Original file line number Diff line number Diff line change
@@ -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 <identifier>` | -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 <value>` | -r | reporter to use, options are dot, list, spec, min and progress (default: spec ) |
| `--requestNamePattern <regex>` | -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 <path>` | | 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
```
3 changes: 1 addition & 2 deletions docs/inso-cli/cli-command-reference/inso-run-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Option | Alias | Description
{:.table .table-striped}
Option | Alias | Description
----- | ------ | -------
`--workingDir <path>` || Specify a working directory.
`--src <path>` || 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 <path>` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml

## Examples

Expand Down
3 changes: 1 addition & 2 deletions docs/inso-cli/cli-command-reference/inso-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ inso script <name>
Option | Alias | Description
----- | ------ | -------
`--output <path>` | -o | Save the specification to a file in the working directory.
`--workingDir <path>` || Specify a working directory.
`--src <path>` || 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 <path>` | -w | Specify a working directory/file, to find .insomnia folder, *.db.json, export.yaml

## Examples

Expand Down
5 changes: 5 additions & 0 deletions docs/insomnia/collection-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 11 additions & 0 deletions docs/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
with import <nixpkgs> { };
stdenv.mkDerivation {
name = "env";
buildInputs = [
ruby
];
}
# to install
# bundle install
# to run
# bundle exec jekyll serve -H 0.0.0.0 -P 4000 --watch

0 comments on commit 11a9211

Please sign in to comment.