Commit graph

294 commits

Author SHA1 Message Date
Miah Johnson
9a580407e6 brittle tests
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-31 11:43:44 -07:00
Miah Johnson
2a1b1d8e88 Remove all leading newlines.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-31 11:43:44 -07:00
Ryan Davis
d10591dc19 Some of our license tests fail if we have CHEF_LICENSE set, so wrap them up.
This still doesn't fix our parallelization issues. I think

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-30 11:17:19 -07:00
Ryan Davis
4790e288a0
Merge pull request #4142 from inspec/zenspider/clean_unnecessary_requires
Clean unnecessary requires
2019-05-29 18:33:06 -07:00
Ryan Davis
dfadc393b9 Even more removals and moves!
Turns out we don't even use CMD in any units... so why make it?

Lots of other stuff got ripped out. Tests basically shouldn't need to
require anything but 1 implementation file and a test framework.
Anything more than that is a smell.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
a8bcba780f Got the rest of the functionals to pass.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
56924dbee1 Fix some of our functional failures on windows.
+ Add CHEF_LICENSE env variable.
+ Switch to using powershell to invoke inspec.

I still think we should look into using `spawn`, but this is a good
start.

This probably doesn't fix the rest of the tests, but they're SO slow
locally that I'm gonna start this PR.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 15:48:37 -07:00
Miah Johnson
6c19e81a06 Remove authors tags from source files.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-28 12:47:39 -07:00
Clinton Wolfe
c8f0de05af
inspec check: Send log to STDERR when running with --format json (#4001)
inspec check: Send log to STDERR when running with --format json
2019-05-28 14:44:44 -04:00
Ryan Davis
9e9cc42bf8 Another typo fixed.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-24 15:53:03 -07:00
Ryan Davis
4e5ddc051e Fixed typo in filename
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-24 15:51:57 -07:00
Ryan Davis
9b7c292d4c Use IO globals instead of IO constants.
Helps testing and lots of other things if we only use $stdout/$stderr.

STDOUT/STDERR should only be used to restore the globals.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-18 12:48:18 -07:00
Ryan Davis
06ead63972 Minor cleanup and a todo test.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-17 02:26:06 -07:00
Ryan Davis
1ed4128942 Functional helper let changes.
Moved exec_inspec to inspec_path.
Added new exec_inspec that invokes ruby w/ -Ilib (expanded).

Decouples from bundler and/or needing inspec-bin to be installed.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-17 02:26:06 -07:00
Ryan Davis
6adf1d2560 Remove all byebug requires in code.
Please don't leave debugging remnants in the code.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-14 23:24:14 -07:00
Miah Johnson
d5e19ae900
Merge pull request #4046 from inspec/mj/ftf
Fix broken tests after removing magic comments.
2019-05-09 10:56:37 -07:00
Miah Johnson
bf28482350
Merge pull request #4043 from inspec/ap/no-resource-capitalize
Wrap resources in backticks and remove resource name capitalizing
2019-05-08 23:49:25 -07:00
Miah Johnson
81c9a27b37 Fix broken tests after removing magic comments.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-08 16:17:25 -07:00
Miah Johnson
11b8da3283
Merge branch 'master' into mj/encoding 2019-05-08 12:59:55 -07:00
Miah Johnson
9eeb8274cb
Merge pull request #3954 from cc-build/distro-identity
First step to get inspec names changeable
2019-05-08 12:37:12 -07:00
Alex Pop
d7f06f98f1 Wrap resources in backticks and remove resource name capitalizing
Signed-off-by: Alex Pop <alexpop@users.noreply.github.com>
2019-05-08 20:17:51 +01:00
Miah Johnson
659b4b373a Remove # encoding: utf8 magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 16:06:23 -07:00
Clinton Wolfe
80b847ae83
Improve testing on inputs that do not have values (#4007)
Improve testing on inputs that do not have values
2019-05-07 15:01:09 -04:00
Clinton Wolfe
ce16120b18 Failing functional test for running inspec check with a deprecation
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-05-06 14:58:10 -04:00
Artem Sidorenko
96353a708a First step to get inspec names changeable
for community distributions

Signed-off-by: Artem Sidorenko <artem.sidorenko@t-systems.com>
2019-05-06 18:40:35 +02:00
Clinton Wolfe
e280990e76 Test fixtures and failing functional tests for DSL
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-30 23:54:29 -04:00
Clinton Wolfe
4773023ef5 Add functional test to verify no-halt for undeclared inputs
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-30 22:51:56 -04:00
Clinton Wolfe
a282204b41 Update exe location in functional test helpers
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-29 13:27:10 -06:00
Clinton Wolfe
7d2028287c Get unit and functional tests passing
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-26 13:14:32 -04:00
Clinton Wolfe
502cf1d7b9 Add test helper to detect all-passing exec run
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-26 13:14:32 -04:00
Clinton Wolfe
aae54d2cb6 Checkpoint commit after Input rename; precedence is broken
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-26 13:14:31 -04:00
Clinton Wolfe
65123b47c0 Don't use a profile with old-style attributes in vendor test
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-25 17:37:13 -04:00
Clinton Wolfe
5383ca2040 Merge branch 'cw/apply-v4-deprecations' of github.com:inspec/inspec into cw/apply-v4-deprecations 2019-04-25 14:58:35 -04:00
Clinton Wolfe
ab0282f156 Revert "Skip legacy --json-config test until CLI setup is refectored"
This reverts commit 81c28d5b56.
2019-04-25 14:51:33 -04:00
Clinton Wolfe
81c28d5b56 Skip legacy --json-config test until CLI setup is refectored
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-25 14:49:47 -04:00
Clinton Wolfe
23fdecd9c3 Make sure trailing newline is preserved when ignoring deprecations in functional tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-25 14:48:35 -04:00
Miah Johnson
12c94e1e97 Revert "Use ignore_deprecations helper to silence warnings for cli.ui"
This reverts commit 144c482a24.
2019-04-24 13:17:52 -07:00
Clinton Wolfe
91c0f1e83b Rewrite fltertable functional tests to DRY up and avoid --json-config
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-24 11:37:43 -04:00
Miah Johnson
144c482a24 Use ignore_deprecations helper to silence warnings for cli.ui
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-24 02:28:28 -07:00
Clinton Wolfe
f7b01093a4 Warn on using default with attributes
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-23 11:46:13 -04:00
Clinton Wolfe
aa19b6e99d Add helper to filter out deprecations on stderr
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-23 11:46:13 -04:00
Clinton Wolfe
8d3e704532 Update CLI option for accepting license; licensing tests pass
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 14:20:41 -04:00
Clinton Wolfe
d94addf54a Update functional test to remove interactive testing; impossible now with tty detection
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 13:11:11 -04:00
Clinton Wolfe
1c13bcc35e Change exit code to 172 when license is not accepted
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
f7c4f56670 Ensure that an empty invocation does not trigger the license check
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
e0fe3f1876 Add version to list of exempt commands
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
30e5c39e74 tmpdir and mktmpdir are two verry different things
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
023bfefc67 Add ungated invocations
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
7d81f93496 Add test for interactively answering no
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
fb73b39976 Add tests for interactively answering yes
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00