Commit graph

7968 commits

Author SHA1 Message Date
Ryan Davis
cea752a01d Tweak for aws resources to determine if they're still under test.
Everyone now has an `inspec` method, but the AWS ones still return
nil as their backend hasn't been set up.

This seems wrong...

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 14:41:37 -08:00
Ryan Davis
ae0dead7be This is all dead. Removed.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 14:41:37 -08:00
Ryan Davis
950c79319e Moved __register down to bookkeeping section.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 14:41:37 -08:00
Ryan Davis
b38a3b05f9 Reworked Resource.__register's metaprogramming to be as small as possible.
Mostly involved pushing up all the regular initialize code to a
regular method, calling that, THEN doing super up to the resource
initialize.

This brings __register's Class.new to 5 lines.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 14:41:37 -08:00
Ryan Davis
43f520b4a8 Merged Inspec::Plugins::Resource to Inspec::Resource.
This also removes Inspec::ResourceBehaviors and Inspec::ResourceDSL.

All class methods look like class methods.
All instance methods look like instance methods.

There is still too much clever going on with __register creating
another anonymous subclass, but I think I can work that out/down too.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 14:41:37 -08:00
Ryan Davis
44a006a05a Rename Inspec::Resource.supports to support_registry.
To fix an already existing name collision between Inspec::Resource and
Inspec::Plugins::Resource.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:19:32 -08:00
Ryan Davis
f0a5ddd4df Simple refactoring + assign __resource_registry to the current if needed.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:19:32 -08:00
Ryan Davis
81dfe21a98 First pass reworking LibraryEvalContext.
This takes 3 anonymous Class.new w/ no superclasses, no documentation,
and no obvious clue as to what anything is and drops it down to 2
Class.new w/ superclasses, documents what it can, and makes it much
more clear what is going on. (yet, still not clear)

It also actually uses LibraryEvalContext. Having names is important.
Probably more important than any of the rest of this diff.

One extra thing this adds is Module.find_class_instance_variable and
hooks it up to Resource.__resource_registry. This allows it to find a
class-level registry regardless of whether it was hidden in an
anonymous superclass or not.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:19:32 -08:00
Ryan Davis
07631a53e7 Added extra doco on our require method.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:19:32 -08:00
Ryan Davis
d7bae9de30 Mostly minor cleanup, clarification, and comments.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:19:32 -08:00
Ryan Davis
fdc281d19c Clean up the end of our custom require.
There are only 2 options. Shortcutting one of them with a `require` just
makes it messy. Use `if`. It's really basic. Basic is good. Maybe we
should try to push towards basic and good. It would be work but make
us happier in the long run.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
99f86c8a0b These tests don't pass on a network cafe and just hang forever.
Changing to localhost resolves immediately but assumes you're NOT
running a git server on http locally.

This seems more valid to me than assuming you know how DNS is going to
resolve everywhere.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
51b65f6c2e Overhaul Platform#supported?
+ State normal path first.
+ Use Enumerable to state your logic up front, don't build it into
  loops with breaks/returns.
+ Remove nonsensical duplication of key formats. (should push up or remove)
+ Had to add an extra test case that wasn't covered here but was in
  metadata_test.rb (why?!?)

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
10cb92da48 Clean up Platform#params.
State your normal case first, then deal with edge cases, not the other
way around.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
aef285a1f6 Don't meta-program if you don't need to.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
2490a88b9c Minor test improvements
We need to track down `x.must_equal true`.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
99ded5a132 Improve test expressiveness by using more direct assertions.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
06ceba3f3d Add test for LEC to expose second-level libraries require.
Not the best test in the world, but it is better than nothing.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Ryan Davis
ddb0db12ef Completely refactored profile_resource_exceptions_test.rb
Half... half.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 13:18:56 -08:00
Chef Expeditor
3cfd35f98f Bump version to 4.18.82 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-02-01 02:04:23 +00:00
Ryan Davis
d789c13e74
Merge pull request #4882 from inspec/zenspider/rubocop-hates-me
Fix minor style issues.
2020-01-31 18:04:03 -08:00
Ryan Davis
2c7101df26 Fix minor style issues.
I swear... rubocop hates me.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-31 18:01:01 -08:00
Chef Expeditor
4ab4b04bed Bump version to 4.18.81 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-02-01 01:51:56 +00:00
Ryan Davis
a3060c4ca8
Merge pull request #4860 from inspec/cw/win-func-input-tests
Remove skips from windows testing in 'inputs' and 'archive' functional tests
2020-01-31 17:51:36 -08:00
Chef Expeditor
d09656cdff Bump version to 4.18.80 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-02-01 01:38:34 +00:00
Ryan Davis
c79245cde3
Merge pull request #4869 from inspec/zenspider/crontab
Refactored crontab resource
2020-01-31 17:38:12 -08:00
Chef Expeditor
c3a37ee126 Bump version to 4.18.79 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-02-01 00:42:32 +00:00
Ryan Davis
c70f73dc96
Merge pull request #4864 from inspec/zenspider/resource/inspect
Added --inspect option to inspect shell command.
2020-01-31 16:42:00 -08:00
Chef Expeditor
01b9bacaa1 Bump version to 4.18.78 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-02-01 00:41:46 +00:00
Ryan Davis
cc1393bb9a
Merge pull request #4822 from PiQuer/master
make command.exist? POSIX conform
2020-01-31 16:41:27 -08:00
Chef Expeditor
09e0bc63da Bump version to 4.18.77 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-01-31 22:29:39 +00:00
Ryan Davis
4d566ccaa1
Merge pull request #4880 from inspec/zenspider/omnibus
I _think_ this should fix omnibus.
2020-01-31 14:29:19 -08:00
Ryan Davis
46207b4082 I _think_ this should fix omnibus.
Debugging via CI is fun!

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-31 13:34:32 -08:00
Chef Expeditor
d83ead45f9 Bump version to 4.18.76 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-01-31 01:21:42 +00:00
Ryan Davis
bdcff44eb1
Merge pull request #4877 from inspec/zenspider/hab
Fixing habitat
2020-01-30 17:21:24 -08:00
Ryan Davis
87b39d1f7f Removed Remove-StudioPathFrom from habitat/plan.ps1.
We don't have backslashes in our Gemfile so I'm not sure what it was
doing in the first place... AND, apparently the file wasn't there.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-30 17:19:11 -08:00
Ryan Davis
cf286daa43 While we're in here... let's trigger artifact/habitat on PRs
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-30 16:53:10 -08:00
Ryan Davis
beda815524 I *think* this will fix habitat.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-30 16:19:05 -08:00
Chef Expeditor
7e258f8944 Bump version to 4.18.75 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-01-30 16:04:33 +00:00
Clinton Wolfe
5738e3026f
Remove the references to the core/cacerts so customers can spec… (#4848)
Remove the references to the core/cacerts so customers can specify it
2020-01-30 11:04:13 -05:00
Chef Expeditor
f69d76e4a0 Bump version to 4.18.74 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-01-30 00:36:49 +00:00
Ryan Davis
b2131e61ed
Merge pull request #4872 from inspec/zenspider/syntax
the correct, un-panicked fix.
2020-01-29 16:36:27 -08:00
Ryan Davis
a79eb417a0 the correct, un-panicked fix.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-29 16:35:11 -08:00
Chef Expeditor
fb81c806b5 Bump version to 4.18.73 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-01-30 00:25:39 +00:00
Ryan Davis
69bb10ab71
Merge pull request #4871 from inspec/zenspider/syntax
bad master merge... rushing this through
2020-01-29 16:25:20 -08:00
Ryan Davis
622ae78d9a bad master merge... rushing this through
Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-01-29 16:24:35 -08:00
Chef Expeditor
5c6be7b936 Bump version to 4.18.72 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-01-30 00:19:44 +00:00
Ryan Davis
f2155a64ed
Merge pull request #4843 from michaellihs/master
Add support for yocto linux in service resource
2020-01-29 16:19:27 -08:00
Ryan Davis
19ce5df589
Merge pull request #4827 from inspec/mj/namespaces
Move parsers under Utils
2020-01-29 16:18:43 -08:00
Chef Expeditor
bb70c50961 Bump version to 4.18.71 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2020-01-30 00:08:10 +00:00