Commit graph

509 commits

Author SHA1 Message Date
Nikita Mathur
628d1561f9 Unnecessary white spaces removed from git fetcher testing files
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-03-23 16:42:52 +05:30
Nikita Mathur
d9bb2649e6 Code refactoring changes for fix #5233
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-03-23 16:20:47 +05:30
Nikita Mathur
d673e840a3 Fix for executing git profiles with default branch not just master
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-03-23 16:20:47 +05:30
Clinton Wolfe
f1e118cbaa
Merge pull request #5430 from issue-3181-json-reporter-passthrough-data 2021-03-19 10:24:22 -04:00
Vasu1105
513c7be801 Added specific regex as for describe block we genrate random control with some random hex which might contain the number that I have used in the rgex due to which test is failing
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:57:46 +05:30
Vasu1105
b180914889 Updated test for --controls option
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:10:12 +05:30
Vasu1105
a5932b7da7 Fixes 5215: While using --controls options the control block was also getting evaluated as filtering of the control was happening after evaluating so added the filter logic in the control_eval_context. Also when we have describe block outside control block we are we
generating a control for them automatically and then execute due that also becomes a control and has to add same logic to filter the control in that mehtod

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:10:12 +05:30
Vasu1105
b4d319610a Fixing test cases
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:10:11 +05:30
Vasu1105
b984bbe960 Fixes #5215 : When we are using --controls option it was also evaluating the control block of not included controls in the controls option as it was filtering the controls from the list after evaluating updated the logic so that it gets evaluated after filtering. Removed filter_controls methods as no more using that
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:10:11 +05:30
Vasu1105
89e994c4b3 Fixed test file for syntax issues
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:10:11 +05:30
Vasu1105
e1e10732ae Revert "Updated test to match the exact string"
This reverts commit 2048c4dff6689342cd7ef42ea9ba98a4c6715723.
2021-03-19 16:10:11 +05:30
Vasu1105
75ca22c3ce Updated test to match the exact string
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:10:11 +05:30
Vasu1105
6853f6450e Added test to catch the control execution issue while using controls option
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-19 16:10:11 +05:30
Nick Schwaderer
cbe105bbe0 Handles edge cases for parallelization
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2021-03-16 15:41:55 -04:00
Nick Schwaderer
4c03ad4c55 Support 'clear_cache'
Helps with Customer Bug 236 (see there for repro)

Currently, when we run `inspec compliance upload my_profile` it is
cached locally in inspec when run. If we update the version in the core
code and run another upload, `inspec compliance upload my_profile` again
it will run the old cached version instead of running a new copy
from automate.

The current workaround is to specify the desired version with
`inspec exec compliance://my_profile/admin#0.1.1`.

The caching happens before we have forward sight into the profile's
contents and only the target name. So the text used to generate the
cache would be `compliance://my_profile/admin` which does not change
version to version.

A fix here could simply identify when we are doing a local `inspec exec
compliance://` (hitting local profiles does not generate a cache) and
skips the cache if there's no version specified. That would eliminate
the unexpected behavior. However, it is a breaking change for customers
as some current caching taking place would no longer take place.

Instead, we have included a `clear_cache` cli method for InSpec,
which should assist the core team and other developers in the future
when debugging edge case issues in InSpec.

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2021-03-16 15:41:55 -04:00
Alexander Stein
351a943b35 Put back passthrough automate reporter output.
Signed-off-by: Alexander Stein <astein@flexion.us>
2021-03-15 13:17:54 -04:00
Alexander Stein
6748c1d704 Clean up whitespace issues. 2021-03-15 11:54:23 -04:00
Alexander Stein
dbda2b8694 Merge branch 'master' of https://github.com/inspec/inspec into issue-3181-json-reporter-passthrough-data 2021-03-11 22:04:13 -05:00
Alexander Stein
827ce32eec Add passthrough tests to json reporter. 2021-03-11 22:03:50 -05:00
Alexander Stein
a75241fe1d More test cleanup. 2021-03-09 23:37:10 -05:00
Alexander Stein
8a017d5fd4 Remove passthrough test from json-automate. 2021-03-09 23:29:12 -05:00
Vasu1105
216306a219 removed unwanted README files from test fixtures and fixed some minor copy paste test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-05 16:29:30 +05:30
Vasu1105
7dba4fa641 Fixes #5373 : Add option to filter empty profiles from report
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-04 22:09:48 +05:30
Clinton Wolfe
b07b85f582 Failing test case for deep skip_control issue 5300
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-02-16 17:59:14 -05:00
Clinton Wolfe
0cad164371
Truncate code_desc when truncating reports (5372) 2021-01-06 11:06:49 -05:00
Clinton Wolfe
8c62c5ea69 Add failing tests to truncate code_desc when reporter message truncation is used
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-01-05 18:09:51 -05:00
David Marshall
874ee77791 add test for when run is not specified in waiver
The existing documentation explicitly claims that not specifying “run” in a waiver is equivalent to specifying “run: false.” It turns out to be the case that the claim is completely false. This commit includes a test for a new control 18_waivered_no_expiry_default_run that behaves exactly like the control 04_waivered_no_expiry_ran_fails. That is, not specifying run in a waiver is the same as specifying “run: true.”

Signed-off-by: David Marshall <dmarshall@gmail.com>
2020-12-28 16:26:19 -08:00
Clinton Wolfe
cdfb325ca3 Apply chefstyle -a, and manually remove duplicate requires
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-12-21 13:25:04 -05:00
Clinton Wolfe
fcadb9792f Update functional tests to work with rspec 3.10+
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-12-21 12:24:24 -05:00
Nick Schwaderer
345a832eb1 Supply resource name, params to code_desc
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-11-19 09:59:53 +00:00
Nick Schwaderer
1f0bcd988f
Merge pull request #5278 from inspec/ns/waiver_message
Ensure that we populate information about waiver expiration regardless of `run: true/false`
2020-10-19 10:41:05 +01:00
Nick Schwaderer
4c4bfe0426 Update tests to handle waiver expiration message
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-10-14 12:55:39 +01:00
James Stocks
db5f6a1615 Tidy --help output slightly
Give `exec` a short description in the main help output. Hide the option to disable core plugins.

Signed-off-by: James Stocks <jstocks@chef.io>
2020-09-25 13:02:16 +01:00
James Stocks
7576ad8ff5 Add Chef patent URL to --help
Fixes #5248

Signed-off-by: James Stocks <jstocks@chef.io>
2020-09-25 13:02:16 +01:00
Clinton Wolfe
6e7e05e6b6 Adjust expected error count
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-09-22 11:40:01 +01:00
Clinton Wolfe
b3f72f5854 Implement a corrected junit2 reporter that can be validated
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-09-22 11:40:01 +01:00
Clinton Wolfe
c602e53910 Update test to remove some skips due to outdated fixture
The tests depended on an old fixture profile that skipped a test,
which no longer happens. It also was targeting a test that does not exist.

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-09-22 11:40:01 +01:00
Clinton Wolfe
955ab36922 Update junit tests to use nokogiri
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-09-22 11:40:01 +01:00
IanMadd
c1da4f64c4 Updating links to inspec docs in ruby scripts
Signed-off-by: IanMadd <imaddaus@chef.io>
2020-09-14 14:09:30 -07:00
Nick Schwaderer
1a1205c729 Fixes many of the old skip_windows instances
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-09-14 15:55:10 +01:00
Clinton Wolfe
a839d4602c Add ability to sort results in reporting phase
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-08-10 14:32:08 -04:00
Clinton Wolfe
3aca12d622 Add option to suppress diff output
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-08-10 14:31:28 -04:00
Clinton Wolfe
ceca77e118 Mark inputs as sensitive
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-08-10 14:30:11 -04:00
Nick Schwaderer
d8b06560a1 Ensure truncate message only returns on truncated values
At the moment we return the "Truncate" text whenever the setting is
utilized. This PR ensures that we only advise truncation when it's been
executed.

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-07-29 09:50:25 +01:00
Nick Schwaderer
2744ff43e5
Merge pull request #5128 from james-stocks/js/report_bad_profiles
Report faulty profiles instead of crashing
2020-07-15 13:28:17 +01:00
James Stocks
833aac3ef1 Add profile load failure message to CLI reporter
Signed-off-by: James Stocks <jstocks@chef.io>
2020-07-09 14:02:42 +01:00
Nick Schwaderer
6d340b323c Allow ‘=‘ character in CLI inputs
Fixes #5131

Due to the use of `#split(‘=‘)` against inputs supplied via the CLI we had an edge case where inputs with `’=‘` in the value would cause a breakage.

This PR supplies a test for the regression and fixes the bug with a regex solution.

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-07-09 12:50:21 +01:00
James Stocks
08398cc3c1 Address linting mistakes.
Signed-off-by: James Stocks <jstocks@chef.io>
2020-07-03 15:53:09 +01:00
James Stocks
fd4c501c70 Change profile skip_message to status_message
Keep a duplicate of the message in skip_message for the JSON reporters, for backwards compaibility.

Signed-off-by: James Stocks <jstocks@chef.io>
2020-07-03 15:53:09 +01:00
James Stocks
41087c5ec6 Set profiles that fail to load as failed
Signed-off-by: James Stocks <jstocks@chef.io>
2020-07-02 13:33:07 +01:00