Commit graph

358 commits

Author SHA1 Message Date
Clinton Wolfe
638522f0e0 Working unit tests, holey moley
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-03-10 20:07:32 +05:30
Clinton Wolfe
9d671d3d37 Revert "Remove unused coveralls hooks from test helper"
This reverts commit c61e70b75b.
2022-02-03 11:54:31 -05:00
Clinton Wolfe
c61e70b75b Remove unused coveralls hooks from test helper
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-05-03 20:58:48 -04:00
Clinton Wolfe
3b29eb69ab Remove windows test skip timebomb
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-12-21 15:17:24 -05:00
Nick Schwaderer
71e141e10a Move windows bomb forward pre-emptively
These tests are being worked on, and there has been internal discussion
about the value of this bomb. I am not taking a stance on that at this
point. However, when we do hit a bomb that requires all repo PRs (
including community ) to do a rebase after we do a fixing PR.

To prevent this while our team resource is somewhat limited I am going
to pre-emptively push this out.

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-08-03 10:57:29 +01:00
Nick Schwaderer
480567564b Review skip_windows violations and expiration
We have 72 `skip_windows` that need addressing. This PR removes
confirmed instances where the tests now work on windows. It also marks
tests with a comment where they are confirmed to still break. Unmarked
instances still need review.

It also updates the `skip_windows` expiration date.

72 `skip_windows` needing resolution OR alternative documentation upon investigation

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-07-02 11:53:38 +01:00
James Stocks
e4fd110ff4 Push Windows test skipping for 2 more months
There are open issues for the failng cases and they are in our priority list.

https://github.com/inspec/inspec/issues?q=is%3Aopen+label%3A%22Aspect%3A+Testing%22+label%3A%22Platform%3A+Windows%22

Signed-off-by: James Stocks <jstocks@chef.io>
2020-05-04 14:55:51 +01:00
James Stocks
6b11089789 Add 1 more month to Windows test skipping
Signed-off-by: James Stocks <jstocks@chef.io>
2020-04-02 17:19:16 +01:00
Clinton Wolfe
2409e8fb99 Set test skip bomb date to end of 2020Q1
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-12-31 12:19:27 -05:00
Ryan Davis
e49efa2619 This should fix the mocha deprecations.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-12-16 15:01:38 -08:00
Ryan Davis
c5e38d81c4
Merge pull request #4759 from inspec/zenspider/windows-again-and-again
Bump windows deadline AGAIN.
2019-12-03 18:43:31 -08:00
Ryan Davis
2fdd68c805 Bump windows deadline AGAIN.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-12-03 18:41:48 -08:00
Miah Johnson
7a837e16d1
Merge pull request #4745 from inspec/mj/cc-coverage
Enable Codeclimate Test Coverage
2019-12-02 13:27:00 -08:00
Miah Johnson
fe8f868504 dont set a default simplecov format; we do that elsewhere.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-11-28 00:53:22 -08:00
Miah Johnson
9db7b70e30 remove coveralls; all we need is simplecov
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-11-27 22:12:48 -08:00
Ryan Davis
f2e4fb549c Address and fix all our ruby 2.7 warnings & errors.
This does NOT include fixes for our dependencies that are also having
2.7 warnings (which cause our functional tests to fail because for
some reason we expect stderr to be empty, which is brittle).

I've got upstream PRs to fix all of those. My tests pass locally. I
could push a commit that modifies the Gemfile to use my forks, but I'd
like to see how this fares for now.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-27 15:42:52 -08:00
Clinton Wolfe
6adf7b13be
Merge pull request #4734 from inspec/cw/move-fetchers
Move lib/fetchers to lib/inspec/fetchers and re-namspace
2019-11-25 14:56:06 -05:00
Clinton Wolfe
d9f55bf85c Singularize the fetchers directory name
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-11-22 09:57:28 -05:00
Ryan Davis
89888be944 Removing the osx? guard that has been pushed to minitest and released.
This is mostly to bump a release because our last one blew up.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-14 15:05:13 -08:00
Clinton Wolfe
b39d47bda7 Move fetcher files
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-11-14 15:25:43 -05:00
Bryan McLellan
3670500701 Deprecate inspec/object/* classes
The classes in inspec/object have been moved to the inspec-objects
library. They aren't used directly by Inspec and will be removed in the
next major release.

Signed-off-by: Bryan McLellan <btm@loftninjas.org>
2019-11-08 15:09:09 -05:00
Ryan Davis
74c692c9eb Pushed unmock up to helper.rb
Also switched osx group test to use quick_resource since it is cleaner.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-31 14:09:16 -07:00
Ryan Davis
83a6bd84dd bumped the windows tests again
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-30 01:47:16 -07:00
Ryan Davis
fe34eb7869 Moved quick_resource and Fake helpers to test/helpers/resources.rb
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-16 16:54:07 -07:00
Ryan Davis
201d98fd26 Refactored and added an alternative test mock resource system.
test/unit/resources/json_test.rb had the start of a setup to directly
instantiate resources. I've refactored that up to helper.rb and
extended it with some helper methods so we can directly specify what a
resource command should respond with. For many/most of our tests, this
should be sufficient.

Finally, I switched our yum tests over to use the new setup. This will
allow us to address #4517 and extend the tests for centos8 output
differences with ease. Ease, folks... ease.

Signed-off-by: Ryan Davis <zenspider@chef.io>
Cc: Miah Johnson <miah@chia-pet.org>
2019-10-16 16:54:07 -07:00
Ryan Davis
d1fbbada4d Yet another bump of our skip_windows! due date.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-30 12:23:15 -07:00
Ryan Davis
49330e8a8e Extended skip_windows to the end of September.
This is getting depressing...

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-03 12:08:41 -07:00
Ryan Davis
4b3f11697d Removing ParallelTest so as to not encourage anyone from using it.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-08-09 16:17:13 -07:00
Ryan Davis
1266a65f28 Moved the osx? guard below minitest/autorun.
I didn't hit this because I use `minitest` to run my tests, not `m`.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-08-09 16:16:26 -07:00
Ryan Davis
374e365c02 Modified DarwinGroup to collect all users properly.
I noticed that my profile targeting group "staff" on OSX wasn't
returning *me*. I'm awesome! So that seemed wrong. And it turns out it
is wrong. We were not collecting any users whose primary group was
that group. (almost all regular users are in group staff and they're
all missing).

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-08-07 20:27:13 -07:00
Ryan Davis
99638d8de9 Remove timebomb on skip_until.
It has been valuable and should push up to minitest.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-07-31 12:24:57 -07:00
Ryan Davis
c6837a3915 Moved skip_windows! to top helper and extended date to end of next month.
Fixed up requires in v2/installer_test.rb so it sees the top helper.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-07-24 18:06:25 -07:00
Clinton Wolfe
398e984a14 Push back timebomb by one month
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-12 13:10:38 -04:00
Miah Johnson
a4f4fe5231 chefstyle -a; https://github.com/chef/chefstyle/pull/74
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-07-08 17:22:50 -07:00
Miah Johnson
26e73f4326 Update date on our timebomb.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-21 12:56:53 -07:00
Miah Johnson
b21bcfabc4 Lets discuss this next week when we're all around =)
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-14 15:04:26 -07:00
Ryan Davis
692d6a9ab8 hand applied one that is now marked as unsafe in rubocop
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-11 18:52:38 -07:00
Miah Johnson
c579ed3097 Disable rubocop check on TMP_CACHE
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-11 18:52:38 -07:00
Miah Johnson
649ed9aca5 This cache needs to be writable. Its a problem.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-11 18:52:38 -07:00
Ryan Davis
a5309ea392 blindly applied chefstyle -a
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-11 18:52:03 -07:00
Miah Johnson
390d006311 Fix indent
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-06 13:44:18 -07:00
Miah Johnson
b176012abf Maybe stop coverage from running early.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-06 13:43:19 -07:00
Miah Johnson
6b3d96e8a9 Wrap coverage in environment variable CI_ENABLE_COVERAGE
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-06 13:41:57 -07:00
Ryan Davis
6bed51d69a Fixed up interactions between minitest & simplecov.
Sometime during the 2.x's, `at_exit` changed its ordering. As a result,
a lot of things that were stacking `at_exit`'s broke. This is one of
those since both simplecov and minitest do their thing via `at_exit`.
This switches to simplecov w/ no defaults on, then replicates their
simplecov/defaults.rb with our own.

I'm going to try to get that entire file back upstream but it can live
here for now.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-05 15:16:42 -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
2a1b1d8e88 Remove all leading newlines.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-31 11:43:44 -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