Skip to content

Commit

Permalink
🧹 fix cli tests (#1309)
Browse files Browse the repository at this point in the history
* 🧹 fix cli tests

Signed-off-by: Ivan Milchev <ivan@mondoo.com>

* run tests if ct files change

Signed-off-by: Ivan Milchev <ivan@mondoo.com>

* fix vuln ct test

Signed-off-by: Ivan Milchev <ivan@mondoo.com>

---------

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
  • Loading branch information
imilchev authored May 30, 2024
1 parent 240d9d5 commit 2950e14
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.go'
- '**.mod'
- '**.ct'
- 'go.sum'
- '.github/workflows/pr-test-lint.yml'

Expand Down
4 changes: 1 addition & 3 deletions test/cli/testdata/cnspec.ct
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Available Commands:
status Verify access to Mondoo Platform
vault Manage vault environments
version Display the cnspec version
vuln Scans a target for vulnerabilities

Flags:
--api-proxy string Set proxy for communications with Mondoo API
Expand All @@ -34,7 +35,4 @@ Flags:
--log-level string Set log level: error, warn, info, debug, trace (default "info")
-v, --verbose Enable verbose output

Additional help topics:
cnspec vuln Scans a target for vulnerabilities

Use "cnspec [command] --help" for more information about a command.
26 changes: 26 additions & 0 deletions test/cli/testdata/cnspec_vuln.ct
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
$ cnspec vuln --help
Scans a target for vulnerabilities

Usage:
cnspec vuln [command]

Available Commands:
sbom Check for vulnerabilities read SBOM file on disk

Flags:
--asset-name string User-override for the asset name
-h, --help help for vuln
--inventory-ansible Set the inventory format to Ansible.
--inventory-domainlist Set the inventory format to domain list.
--inventory-file string Set the path to the inventory file.
-j, --json Run the query and return the object in a JSON structure.
-o, --output string Set output format: compact, csv, full, json, json-v1, json-v2, junit, report, summary, yaml, yaml-v1, yaml-v2 (default "full")
--platform-id string Select a specific target asset by providing its platform ID.
--props stringToString Custom values for properties (default [])

Global Flags:
--api-proxy string Set proxy for communications with Mondoo API
--auto-update Enable automatic provider installation and update (default true)
--config string Set config file path (default $HOME/.config/mondoo/mondoo.yml)
--log-level string Set log level: error, warn, info, debug, trace (default "info")
-v, --verbose Enable verbose output

Use "cnspec vuln [command] --help" for more information about a command.

0 comments on commit 2950e14

Please sign in to comment.