Ryan Davis
244c7bbed4
Merge pull request #4677 from inspec/zenspider/bump-chefstyle
...
Bump chefstyle and fix up flagged code.
2019-11-08 16:07:42 -08:00
Ryan Davis
bb49d58cd9
Switched chefstyle back to Layout/AlignArguments=with_first_argument.
...
Fixed the flags mostly with `chefstyle -a` but also refactored/cleaned
some stuff by hand.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-08 12:57:43 -08:00
Clinton Wolfe
c045de4399
Temporarily add functional test for input in describe.one in isolated commit
...
As there is a team desire to move away from functional tests,
this commit is intended to be easily reverted once a facility for
running test fixture policies as unit tests in a clear way.
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-11-01 16:52:21 -04:00
Ryan Davis
d201d1fbc2
Fixed the rest of the minitest deprecations by removing FuncTestRunResult.
...
Folded the json & other payloads into plain ivars on the test.
Found and removed some unused code while I was there.
Fixes #4533 .
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-22 12:15:28 -07:00
Ryan Davis
8d4e8c1d96
Merge pull request #4627 from inspec/zenspider/json-and-resource-cleanup
...
JSON processing and resource cleanup
2019-10-21 14:26:37 -07:00
Ryan Davis
e5e1a745cc
Fixed run_inspec_with_plugin to merge run options properly.
...
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-21 13:30:14 -07:00
Ryan Davis
b626c37386
Improve debugging of json parse failures in functional tests.
...
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-21 13:30:14 -07:00
Ryan Davis
fdaea02427
Clean up testing in inspec exec by stripping ansi color codes from output.
...
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-21 12:46:37 -07:00
Miah Johnson
23f31a0a72
Use a good profile with inspec check test
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-17 14:55:58 -07:00
Miah Johnson
6f460b9c3b
Remove this. It slows things down.
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-16 20:57:31 -07:00
Miah Johnson
4ec9f302b0
example -> example.tmp
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-16 10:15:49 -07:00
Miah Johnson
c3eb686b51
Remove debug
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-16 10:15:49 -07:00
Miah Johnson
301905e8de
b0rk b0rk
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-16 10:15:49 -07:00
Miah Johnson
41bc8fd7a0
Clean up some tests
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-16 10:15:49 -07:00
Miah Johnson
ae3ee6f657
Finish rename of example -> example-tmp.rb
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-16 10:13:24 -07:00
Miah Johnson
df7efefc9d
mostly a search and replace for gordon -> example
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-16 10:13:24 -07:00
Clinton Wolfe
8f4ff8923e
Add functional test to exercise waivers during profile inheritance
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-10-09 19:10:48 -07:00
Clinton Wolfe
3c266655ee
Refactor exec-json functional tests to reduce subprocesses
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-10-08 21:04:58 -07:00
Clinton Wolfe
ba61cd3f45
Update JSON schema to reflect new waiver keys
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-10-08 21:01:19 -07:00
Clinton Wolfe
0f5fde9729
Modify waiver input file to use 'run' subfield instead of 'skip'
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-10-08 01:03:40 -07:00
Clinton Wolfe
7516f959d1
If there is no data, alwaya return an empty hash.
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-10-08 00:31:23 -07:00
Clinton Wolfe
56c2416c57
Move waiver JSON data from per-result to per-control
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-10-08 00:25:06 -07:00
Ryan Davis
07dc5e3192
First pass at cleaning deprecations for old minitest/spec-style tests.
...
3 files left to go, and they're behaving oddly so I'm leaving them out
in this pass. Looks like 21 deprecations left.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-03 13:45:19 -07:00
Ryan Davis
90c4904a55
Merge pull request #4490 from inspec/zenspider/split-long-functional
...
Split and parallelize some tests to make them faster
2019-09-24 17:45:57 -07:00
Ryan Davis
fc1ad67ffc
More parallelization for functionals.
...
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-17 11:50:31 -07:00
Ryan Davis
d3f81f1194
Turn on parallelism for inspec_shell_test.rb
...
Seems safe after several runs.
Takes the time down from ~180s to 22s.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-16 17:19:32 -07:00
Ryan Davis
ba462724db
Turn on parallelism for inspec_exec_test.rb
...
Seems safe after several runs.
Takes the time down from ~275s to 35s.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-16 17:19:32 -07:00
Ryan Davis
1d3c9341ec
Finished up the phase 3 waiver json output tests.
...
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-16 16:39:34 -07:00
Miah Johnson
5d94b0d709
Add waiver_data to json output, update assertion to show where waiver_data lives.
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-09-16 14:49:05 -07:00
Miah Johnson
168c77e472
Refactor tests.
...
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-09-16 14:49:05 -07:00
Clinton Wolfe
5d94440823
Fix logic error for future expiring waivers
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
43bc7e0343
Modify @__skip_rule to distinguish only_if and waiver, and force waiver to win
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
0db0a2bfdc
Don't assume waiver_ prefix in waiver files
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
718e205cf2
Alter expiration_date behavior to match spec
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
ff209b4bae
Refactor control_id lookup in waiver test file
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
eb1ec437d7
Linting and test number corrections
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
5891c9aee9
A failing functional test to skip waivered controls
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
kekaichinose
d33870b635
Merge pull request #4214 from inspec/zenspider/fix_nil_file
...
Fixed file resource raising UndefinedMethod on source_path
2019-08-30 13:19:54 -07:00
Clinton Wolfe
e346b16114
Tighten help listing assertion and adjust chomp
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:03:42 -04:00
Clinton Wolfe
296158c447
Implementation and functional tests for the --input CLI option
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 13:03:42 -04:00
Clinton Wolfe
512189a06b
Add CLI option and check in help
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-28 12:53:27 -04:00
Clinton Wolfe
f90a4c633d
Merge pull request #4419 from inspec/cw/check-enforce-version
...
inspec check: warn if inspec_version is not supported by current inspec
2019-08-27 20:03:19 -04:00
Clinton Wolfe
c6f33b3526
Add functional test for inspec check with runtime constraint
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-26 23:19:18 -04:00
Clinton Wolfe
f59497d982
Don't open a new train connect, and make an issue for improving helper support
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-26 13:12:30 -04:00
Clinton Wolfe
d462ac3de5
Convert runner api script layout ot heredoc
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-22 21:51:50 -04:00
Ryan Davis
1dd1efa03f
test change for bad resource/backend combo.
...
I think this is probably in contention with my other PR on resource
initialization. We definitely need to change that, so this might fall
to the side. Or maybe just the test needs to be redone. We'll discuss
and see.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-08-20 13:25:21 -07:00
Ryan Davis
7273a7380f
Fixed file resource raising UndefinedMethod on source_path
...
This is a first pass at fixing the failure found by @scottvidmar where
file resource was raising undefined_method on nil. The problem was
that the initialize method for file was not being called at all
because Resource#initialize was returning early without reporting
anything.
This fix causes a failure in test/functional/inspec_exec_test.rb where
it is testing a similar scenario but for some reason the unsupported
resources get reported. We need to figure that part out, but in the
meantime this will at least report an error at the root cause rather
than down the road.
Fixes #4208
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-08-20 13:25:21 -07:00
Clinton Wolfe
1f49ae4046
Skip runner API tests on windows
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-19 18:15:50 -04:00
Clinton Wolfe
cc4aa16212
Add test framework to run Runner API input tests
...
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-19 13:51:51 -04:00
Ryan Davis
d295455df6
Fix license functional tests when run on buildkite.
...
BK currently runs our tests on ruby:X.Y-stretch docker images, which
use root. This puts license files it /etc/chef instead of the current
user's home and broke our tests.
This adds cleanup to /etc/chef AND checks both locations, so it should
continue to work even if we switch to docker images with non-root users.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-08-06 15:50:01 -07:00