Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to inspec-gcp resources in tests #6

Conversation

brandonjbjelland
Copy link
Contributor

@brandonjbjelland brandonjbjelland commented Sep 5, 2018

This PR addresses issue #5 . It:

  • moves tests to using inspec-gcp resources.
  • upgrades to kitchen-terraform ~> 4.0.0
  • removed tests relying on the Command resource as I ran into the following: Resource Command is not supported on platform gcp/google-api-client-v0.19.8.. I think this can be resolved but I didn't spend enough time with it.
  • plumbs an environment variable through to the test.

Test output is now the following:

  ✔  instance: Instance database
     ✔  Instance database tag_count should eq 2
     ✔  Instance database status should eq "RUNNING"
     ✔  Instance database machine_type should match "n1-standard-2"
     ✔  Instance database first_network_interface_name should eq "external-nat"
     ✔  Instance database disk_count should eq 2


Profile: Google Cloud Platform Resource Pack (inspec-gcp)
Version: 0.5.0
Target:  gcp://[email protected]

     No tests executed.

Profile Summary: 1 successful control, 0 control failures, 0 controls skipped
Test Summary: 5 successful, 0 failures, 0 skipped

@brandonjbjelland brandonjbjelland changed the title [#1] - Add migrate to GCP inspec resources in tests [#5] - Add migrate to GCP inspec resources in tests Sep 5, 2018
@brandonjbjelland brandonjbjelland changed the title [#5] - Add migrate to GCP inspec resources in tests Migrate to inspec-gcp resources in tests Sep 5, 2018
@brandonjbjelland brandonjbjelland force-pushed the feature/migrate_to_inspec-gcp branch from e0d2400 to e3cd1ed Compare September 5, 2018 23:11
@brandonjbjelland
Copy link
Contributor Author

Hmm the bottommost failure here indicates.kitchen.yml is lacking the environment variable necessary but the test run seems to actually fail even earlier as we try to read credentials.json. I don't have a lot of visibility into what's going on here since it's wrapped up in the encrypted tarball. Can you look when you have a chance @nictrix ?

ERROR: (gcloud.auth.activate-service-account) Unable to read file [credentials.json]: [Errno 2] No such file or directory: u'credentials.json'
ERROR: (gcloud.config.set) argument VALUE: Must be specified.
Usage: gcloud config set SECTION/PROPERTY VALUE [optional flags]
  optional flags may be  --help | --installation

Copy link
Member

@nictrix nictrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thanks for the updates. I'll check out what's going on with the encrypted tarball/credentials issue. Maybe it's because my free account trial expired. I'll let you know soon.

bin/kitchen.sh Show resolved Hide resolved
@KevinBuchs KevinBuchs merged commit e3cd1ed into newcontext-oss:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants