Commit graph

1558 commits

Author SHA1 Message Date
Clinton Wolfe
53beaff372 Input plugin types work
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-06-06 12:51:22 -04:00
Clinton Wolfe
9e2e569d85 Add input plugin type API
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-06-06 12:51:21 -04:00
Clinton Wolfe
962dfc8d90 Failing tests for input plugin
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-06-06 12:51:21 -04:00
Clinton Wolfe
82f910e320 Plugin type declaration and unit test
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-06-06 12:51:21 -04:00
Ryan Davis
5e71a6b787 oops
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-04 00:19:26 -07:00
Ryan Davis
58fa148773 Stabilize windows functional testing.
Skip most everything.

After some digging, in those tests that didn't have 100% failures, of
the ~10+% passing, those tests weren't checking enough. So I skip them
too in the hopes that we improve testing across the board.

At this point, we need appveyor to be green more than we need these
tests to be fixed. If that means we skip them, so be it.

These tests will time-bomb at the end of July.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-03 23:27:26 -07:00
Ryan Davis
5573957c52 Go back to cmd from powershell.
Apparently it is too much of a shift and I tested too small of a
sample.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-03 23:11:26 -07:00
Ryan Davis
22635157b5
Merge pull request #4177 from inspec/zenspider/thread_safety_is_hard
Turn off parallel testing (for now?)
2019-06-03 23:04:03 -07:00
Ryan Davis
c40f541a54
Merge pull request #4172 from inspec/mj/jsa
Replace jsonschema with json-schema
2019-06-03 23:03:23 -07:00
Ryan Davis
11638d36dd Now that we aren't parallelizing, start bringing back skipped tests.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-03 14:12:06 -07:00
Ryan Davis
45ef0d84d0 Remove minitest/hell in favor of stable (but sloooow) tests.
Added InspecTest (which we should use across the board) and
ParallelTest (which we should use selectively and with metrics) to
helper.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-03 14:12:06 -07:00
Ryan Davis
d2edd3ce68 Move minitest/hell to test/helper.
Probably going to remove this next and focus on opting-in to parallelization.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-03 14:12:06 -07:00
Ryan Davis
bba9434600 Change the way we load rspec so it never exposes globally.
Essentially, the way rspec does stuff is pretty rude. By injecting
singleton methods into main (instead of Kernel, where all top-level
methods go) and "cleaning" them up using undef_method instead of
remove_method makes it pretty hard for anything else in the testing
arena to operate. I've already fixed the case where rspec would
overwrite minitest's `describe` in a way that made it very hard to put
back, but my fix didn't prevent rspec from doing it _AGAIN_.

This fixes the case where after some rspec interactions, mocha's
`any_instance` method would just disappear. I never did figure out
where or why this was happening, but I did address the how.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-03 14:12:06 -07:00
Ryan Davis
a2f2cd5087
Merge pull request #4109 from inspec/zenspider/helper_cleanup
Minor cleanup on test/helper.rb
2019-06-03 13:39:31 -07:00
Miah Johnson
0aea548dd8 Update tests to use json-schema, and test something.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-01 23:17:53 -07:00
Miah Johnson
9a580407e6 brittle tests
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-31 11:43:44 -07:00
Miah Johnson
a5c8021227 don't remove this leading newline =)
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
be125598c8 Additional whitespace cleanup.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
ec248217a7 Extra fix for utils move
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
82c9aa6ed6 Got the rest of the tests to pass.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
9ec91484fc Get all non-resource tests fixed again.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
de8258c9f7 Get yaml_test.rb working
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
761f48e63c Get user_test.rb working
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
69f2927983 Stripping test/helper.rb of all the big inspec requires.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
61585de0f0 Moved out all of the requires for inspec/resources/* from inspec/resource.rb
All requires moved to inspec/resources.rb

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
adaf2bc364 Removed aws resource requiring from test/helper and inspec/resource.
This speeds up parallel unit test runs from a very consistent 2:49 to
a very consistent 1:53, or a 33% reduction.

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
Ryan Davis
23f8a1e30c Explicitly set default_external to UTF-8 for windows testing.
This fixes 4 failures having to do with encoding mismatch.

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
Ryan Davis
ad12e601bf Minor cleanup on test/helper.rb
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-28 12:02:06 -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
Miah Johnson
2215bb0570 Update all requires pointing to util/
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-28 11:30:16 -07:00
Clinton Wolfe
db66eb0ad1
Extracting mock_loader to its own helper file. (#4141)
Extracting mock_loader to its own helper file.
2019-05-28 14:08:21 -04:00
Miah Johnson
5ae79a5b42
Merge pull request #4140 from inspec/zenspider/supermakert
supermakert -> supermarket
2019-05-28 11:01:20 -07:00
Ryan Davis
f36a7c8061 No tabs.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-25 03:40:36 -07:00
Ryan Davis
09e892032b Extracting mock_loader to its own helper file.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-25 02:59:31 -07: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
Miah Johnson
fb0993e0f2
Merge pull request #4089 from mirskiy/github_url_regex_bug
Fix github url regex. Add period for repo
2019-05-21 12:45:18 -07:00
Miah Johnson
27ee7a1a63
Merge pull request #4107 from inspec/zenspider/telemetry_requires
Minor require cleanup for telemetry.
2019-05-20 13:10:30 -07:00
Ryan Davis
9c6965b2ed Minor require cleanup for telemetry.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-20 13:09:38 -07:00
Miah Johnson
c7218a991a
Merge pull request #4108 from inspec/zenspider/remove_test_unit_helper
Delete test/unit/helper.rb
2019-05-20 13:08:07 -07:00
Miah Johnson
36029da0a3
Merge pull request #4116 from inspec/zenspider/clean_more_requires
Clean more requires
2019-05-20 13:07:04 -07:00
Ryan Davis
e1061f41f2 Clean more requires
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-20 13:01:18 -07:00
Ryan Davis
8c56477f02 Fixes a test interaction bug between installer and loader.
Not sure how it was supposed to work in the first place. The plugin in
question depends on ordinal_array and that wasn't in that fixture dir.
Switching to 2 is all it apparently needed.

This does cause yet another double-load warning (VERSION already
defined). I don't know how we're supposed to get around that with the
way we've set up these tests.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-18 15:45:22 -07:00