Commit graph

95 commits

Author SHA1 Message Date
Miah Johnson
11b8da3283
Merge branch 'master' into mj/encoding 2019-05-08 12:59:55 -07: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
Ryan Davis
476c6878b3 Modernize use of Minitest.
+ Turn off verbosity in Rakefile by default. Use `rake V=1` to turn back on.
+ MiniTest -> Minitest everywhere.
+ MiniTest::Unit::TestCase -> Minitest::Test everywhere.
+ Updated minitest doco urls to official and up-to-date site.
+ Normalize requires. Only needs "minitest/autorun" and "minitest/pride".

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-03 15:01:57 -07:00
Clinton Wolfe
8bed893da2 An unportable and slow approach to installing
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-29 13:27:10 -06:00
Clinton Wolfe
735e7b060b Oh parens
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 16:14:45 -04:00
Clinton Wolfe
c6940be8d4 Make license touching for functional and int testing portable to windows
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 15:30:30 -04:00
Clinton Wolfe
8915ad049f Correct pre-integration task name
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 15:06:09 -04:00
Clinton Wolfe
3478ac3897 Add user messaging when writing a license file
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
d41dc48afa If the license was accepted only for testing, delete it at exit
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
71c13f38a4 Make functional and integration tests assume the license has been accepted
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-11 10:30:46 -04:00
Clinton Wolfe
71cc147c58 Disable warnings for functional tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-09 15:25:14 -04:00
Jared Quick
d33d189d93
Create appvayor workers for Windows functional tests. (#3397)
* Add more windows functional tests and create some appvayor workers.
* Fix uuid test for automate

Signed-off-by: Jared Quick <jquick@chef.io>
2018-11-08 12:00:14 -05:00
Jared Quick
cb12ada2fe
Move compliance to v2 plugin (#3423)
* Move compliance pluging to v2 system.
* Update kitchen-inspec to test.
* Add legacy require patsh.
* Fix unit test

Signed-off-by: Jared Quick <jquick@chef.io>
2018-10-04 14:31:39 -04:00
Jared Quick
39b3b7135e
Add audit-cookbook integration testing (#3431)
* Add audit integration testing.
* Add some docs and feedback changes.
* Updated integration task to use paramaters and clean it up.
* Fix unit test

Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-25 15:53:26 -04:00
Clinton Wolfe
50ff9f6a24
Plugins: Add support for 'bundles' migration (#3384)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-18 00:00:54 -04:00
Jerry Aldrich
bbc4002b53 Fix profile vendoring on Windows (#3378)
* Fix profile vendoring on Windows

This fixes vendoring on Windows by doing the following:
  - Expanding relative paths (handles `\\`)
  - Ensuring archives after closed after reading (prevents locking)

This also does the following:
  - Removes extra file from testing tar archive
  - Ensures fetching dirs/archives in the local fetcher behaves the same

* Fix profile vendoring on Windows

This fixes vendoring on Windows by doing the following:
  - Expanding relative paths (handles `\\`)
  - Ensuring archives after closed after reading (prevents locking)

This also does the following:
  - Removes extra file from testing tar archive
  - Ensures fetching dirs/archives in the local fetcher behaves the same

* Add vendoring to fuctional testing and fix the tmp path for windows

* Add tests for relative paths and backslashes

* Remove backslashes support in filenames on Linux

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-09-13 20:19:02 -04:00
Jared Quick
6445e2c6d5
Add windows functional tests (#3385)
* Add windows functional tests.
* Fix tests for 2012 server.
* Fix windows build script
* Add more functional tests for windows.
* Update comment with TODO.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-12 18:04:16 -04:00
Clinton Wolfe
fa0a6c9794 Ability to render contrib resource pack docs on main website (#3184)
* Sketch out contrib doc fetcher
* Read contrib config file
* Fetch contrib resource packs from git
* Copy in resource pack docs from contrib
* Task to cleanup copied-in files
* Attach contrib resource pack docs fetching to main website doc generation
* Refactor - rename vars in resource overview task for clarity
* Generate resource overview page using info from contrib
* Fix issue in which AWS and Azure resources were ending up under OS
* Trigger contrib doc cleanup after doc build
* Comment out the contrib.yaml for now
* Disable contrib tasks if git is not available
* Rubocop issues
* Allow .md as doc file ending
* Fix for files ending in md having a relative link
* Omit 'resources' from section labels to save width
* Rubocoooooooooooppppp

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-08-02 11:43:46 -04:00
Miah Johnson
67bbbb6ecf Split inspec into a core gem. (#3008)
* Split inspec into a core gem.
* Include inspec-core.gemspec, not inspec.gemspec.
* Only load aws and azure when the gems are installed.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-05-03 10:30:01 -04:00
David McCown
23967a2849 Refactors Terraform plan to break out steps (#2996)
This change should make it easier to work with a running environment.
You may now apply changes without doing a full teardown/rebuild any time
you make a change to the terraform plan.

Adds some documenation on how to use the Terraform tooling.

Adds AZURE_LOCATION to override the default region.

Signed-off-by: David McCown <dmccown@chef.io>
2018-04-29 14:00:12 -04:00
Clinton Wolfe
340b6eb4b4 Upgrade Terraform version pins for integration testing (#2968)
* Update terrform to 0.11.7 (latest) and aws plugin to 1.14; upgrade plugins on test startup
* TF route table resource doesn't export associations or routes attributes.  Which we weren't using anyway.
* Downgrade to aws plugin 1.13 to avoid TF panic; suppress deprecation warning for aws_region
* Fix incoherent attribute combination on cloudtrail
* Add -auto-approve to suppress interactive confirmation
* Update version pinning for AWS minimal account
* Use a plan file in AWS runs
* Pin azure TF run to 0.11 and 1.3; also an autoformatter pass on the TF code.

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-19 13:01:27 -04:00
David McCown
3c2ab6593a Fixes configuration for Azure integrationt tests (#2941)
Updates some calls in train so we can access the configuration options
for some integration tests.

Signed-off-by: David McCown <dmccown@chef.io>
2018-04-11 15:13:23 -04:00
Clinton Wolfe
118b8a9fc5 Various small fixes/adjustments to the integration tests for AWS and Azure (#2745)
* Fix formatting of iam user integration tests by placing them in controls
* Fix subnet AZ test by making it an attribute; can't hardcode it
* Fix VPC ID fixture export for subnet testing
* Rename Azure integration tasks to match AWS and allow on-demand attribute dump

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-02-26 16:37:36 -05:00
Jerry Aldrich
d356cfc6dc Move AWS/Azure tests to integration directory (#2675)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-02-26 11:10:04 -05:00
Clinton Wolfe
dfc73a52f0 Merge branch 'release-2.0' into aws-merge-release-merge-try
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-02-08 10:44:11 -05:00
Clinton Wolfe
6aaab8691c Merge branch 'aws-merge-prep' into aws-merge
Includes train aws:// targeting and some new resources

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-02-08 10:09:57 -05:00
Clinton Wolfe
a0b6bac87b
Use train for AWS connection (#219)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-02-07 23:26:37 -05:00
Jared Quick
42779e91a7 Setup azure resources into inspec.
Signed-off-by: Jared Quick <jquick@chef.io>
2018-02-07 16:05:58 -05:00
Clinton Wolfe
f7a11ee2df Merge branch 'aws-merge-prep' into aws-merge
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-02-07 09:53:21 -05:00
Adam Leff
ff5dbb79cb
Fixing Travis tests due to rvm/bundle issues (#2421)
Signed-off-by: Adam Leff <adam@leff.co>
2017-12-21 22:36:22 -05:00
Clinton Wolfe
c75252ae1c
Rework Integration Testing to Support Multiple Accounts (#128)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-12-15 01:37:36 -05:00
Adam Leff
01b65db6c7 Habitat build works for all versions, eliminates rake (#2301)
The Habitat plan has been modified to support building from the repo
rather than relying on a gem being pushed to RubyGems. This allows
us to build current packages at every merge rather than only pushing to
Habitat Builder when we promote to stable.

This change also enables Expeditor to perform builds for us and removes
the dependency on the rake task as it is no longer needed.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-14 05:01:51 +01:00
Clinton Wolfe
2f9317265b Update Terraform commands for v0.10 (#93)
* Terraform now requires init to fetch providers

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rename env terraform command to workspace

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Pin Terraform version to reflect CLI updates

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-10-11 01:21:56 +01:00
Adam Leff
1ee22a7c4e Remove changelog generator stuff (#2048)
Version bumping and changelog generation has been moved to
Chef's expeditor tool. The github_changelog_generator bits
and the Rake tasks that use them are no longer necessary.

Also, the old historical changelog has been merged back into
the main CHANGELOG.md file since Expeditor does not alter
any existing changelog content like github_changelog_generator
does, so it's safe to bring this stuff back.

Signed-off-by: Adam Leff <adam@leff.co>
2017-08-03 22:53:24 +02:00
Adam Leff
fb5e5c54e3 Promote artifact to stable during Habitat upload (#1999)
`pkg` commands in Habitat 0.25 now use channels and prefer the `stable` channel by
default. However, artifacts uploaded with `hab pkg upload` go to `unstable` by
default (as it should).

This change ensures that `chef/inspec` artifacts land in `stable` during our
release process.

Signed-off-by: Adam Leff <adam@leff.co>
2017-07-11 21:30:06 +02:00
Miles Tjandrawidjaja
798776cf50 Ensure resources are cleaned when running test:integration even if integration tests fail (#56)
Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-07-05 22:30:27 +02:00
Miles Tjandrawidjaja
1a360cff8b Prompt for namespace if not set in environment variable instead of providing a random namespace (#57)
Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-06-28 05:55:01 -07:00
Adam Leff
bb66bb2193
Fix release_habitat rake task
A change made to how we generate the Gemfile during the Habitat build process
means we cannot have the PLAN_CONTEXT be the "habitat" directory but instead
need it to be the repo root itself.

Also changed to the preferred `hab pkg build` command instead of the original
`hab studio build` command.

Signed-off-by: Adam Leff <adam@leff.co>
2017-05-31 17:50:19 -04:00
Christoph Hartmann
a6ef98c896 verifies that inspec.yml uses licenses in SPDX format
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-05-31 00:21:05 -05:00
Adam Leff
02a023b2ff Update changelog generator to work from PRs only
To clean up our Changelog, this change modifies the use of
github-changelog-generator to only use PRs. This ensures
that our Changelog only reflects actual changes and makes
it easier for our users to see the actual changes made to
the codebase.

docs and www changes will be excluded from the Changelog as well.

The CHANGELOG.md will start from v1.21.0. All release prior to
v1.21.0 have been moved to HISTORICAL_CHANGELOG.md which will
remain static. Should we be able to bend github-changelog-generator
to our ways, I'll merge them back together at a future date.

Signed-off-by: Adam Leff <adam@leff.co>
2017-05-09 12:41:27 +02:00
Miles
69434fec48 Use terraform environments to avoid integration test collisions
* When running integration tests with Rakefile use terraform environment based on environment variable INSPEC_TERRAFORM_ENV
** If INSPEC_TERRAFORM_ENV is not provided, a random string will be used
* Use terraform environment as a namespace for AWS artifacts
* Use attribute file for inspec to be aware of the terraform environment used

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-05-06 14:14:53 -04:00
Dominik Richter
b9ac13dd40 rake: lint before test
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-05-03 22:18:33 +02:00
Adam Leff
3d272d280b
Rakefile updates to support appbundle-updater
InSpec is "appbundled" into the ChefDK which means users can't
simply run `chef gem install inspec` and get an updated InSpec.
`appbundle-updater` exists to combat this and, when run, will
pull the source and install the gem using `rake install`.

In the appbundle-updater config, we'll want to exclude unnecessary
gems from getting installed, such as the "tests" group. Our Rakefile
doesn't work without the "tests" group being installed.

This change makes the Rakefile usuable when the "tests" gems aren't
available.

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-27 14:15:42 -04:00
Adam Leff
5a2a20dc3e
Releasing v1.19.0
Signed-off-by: Adam Leff <adam@leff.co>
2017-04-04 11:06:16 -04:00
Adam Leff
65c95d243e Fixing www/docs rake tasks
This is a follow-up to #1585. The website-related Rake tasks have been
moved to a www-specific Rakefile which can be found in the www/
directory. Any web-release-related gems have been moved to the www
Gemfile as well.

This also included modifying the docs rake tasks to be path-
independent as they currently expect that Rake is being run from the
root of the repo.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-22 12:21:03 -04:00
Chris Redekop
33d4b196cc Cleanup the cleanup task
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-02-23 17:41:36 +00:00
Chris Redekop
040d5cbffc Rename integration tasks
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-02-22 14:15:12 +00:00
Viktor Yakovlyev
5d6900fb86 add cleanup by default on integration tests
Signed-off-by: Viktor Yakovlyev <Viktor.Y@D2L.com>
2017-02-16 15:25:27 -05:00
Chris Redekop
5d00aac059 Add unit test skeleton with Minitest dependency
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-02-14 18:38:06 +01:00
Christoph Hartmann
a55b341b32 use terraform + inspec for integration testing 2017-01-24 21:51:10 +01:00