boltops-tools / terraspace-demo-module-test

Terraspace module test demo
1 stars 0 forks source link

Instructions to run the example test (README.md) don't work #1

Open LggLd opened 3 years ago

LggLd commented 3 years ago

I am unable to run the test included in the example following the instructions of the README.md. These are the steps I have followed:

$> git clone https://github.com/boltops-tools/terraspace-demo-module-test.git
$> cd terraspace-demo-module-test/app/modules/example
$> bundle
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies.......
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using multipart-post 2.1.1
Using minitest 5.14.4
Using azure_info 0.1.2
Using public_suffix 4.0.6
Using aws-partitions 1.516.0
Using unf_ext 0.0.8
Using text-table 1.2.4
Using declarative 0.0.20
Using zeitwerk 2.5.0
Using diff-lcs 1.4.4
Using timeliness 0.3.10
Using rainbow 3.0.0
Using eventmachine 1.2.7
Using memoist 0.16.2
Using jwt 2.3.0
Using racc 1.6.0
Using os 1.1.1
Using digest-crc 0.6.4
Using mini_mime 1.1.2
Using jmespath 1.4.0
Using trailblazer-option 0.1.1
Using uber 0.1.0
Using retriable 3.1.2
Using rexml 3.2.5
Using webrick 1.7.0
Using google-cloud-errors 1.2.0
Using graph 2.10.0
Using tilt 2.0.10
Using rspec-support 3.10.2
Using rubyzip 2.3.2
Using thor 1.1.0
Using tty-tree 0.4.0
Using i18n 1.8.10
Using tzinfo 2.0.4
Using faraday 0.17.4
Using addressable 2.8.0
Using unf 0.1.4
Using dsl_evaluator 0.1.3
Using gcp_data 0.2.0
Using bundler 2.2.25
Using activesupport 6.1.4.1
Using deep_merge 1.2.1
Using faraday_middleware 0.14.0
Using ms_rest 0.7.6
Using representable 3.1.1
Using google-cloud-env 1.5.0
Using rspec-core 3.10.1
Using rspec-expectations 3.10.1
Using domain_name 0.5.20190701
Using cli-format 0.2.0
Using rhcl 0.1.0
Using httpclient 2.8.3
Using google-cloud-core 1.6.0
Using http-cookie 1.0.4
Using hcl_parser 0.1.0
Using faraday-cookie_jar 0.0.7
Using rspec-mocks 3.10.2
Using aws-eventstream 1.2.0
Using render_me_pretty 0.8.3
Using aws-sigv4 1.4.0
Using nokogiri 1.12.5 (x86_64-darwin)
Using google-protobuf 3.18.1 (universal-darwin)
Using aws-sdk-core 3.121.2
Using googleapis-common-protos-types 1.3.0
Using aws-sdk-dynamodb 1.64.0
Using aws-sdk-ssm 1.120.0
Using aws_data 0.1.1
Using grpc 1.41.0 (universal-darwin)
Using ms_rest_azure 0.12.0
Using aws-sdk-kms 1.50.0
Using azure_mgmt_resources 0.18.2
Using aws-sdk-s3 1.104.0
Using eventmachine-tail 0.6.5
Using s3-secure 0.5.1
Using multi_json 1.15.0
Using googleapis-common-protos 1.3.12
Using azure_mgmt_storage 0.23.0
Using grpc-google-iam-v1 1.0.0
Using rspec 3.10.0
Using azure-core 0.1.15
Using rspec-terraspace 0.3.0
Using azure-storage-common 1.1.0
Using signet 0.16.0
Using azure-storage-blob 1.1.0
Using googleauth 0.17.1
Using aws-sdk-secretsmanager 1.51.0
Using gapic-common 0.3.4
Using google-apis-core 0.4.1
Using terraspace_plugin_azurerm 0.3.1
Using google-apis-iamcredentials_v1 0.7.0
Using google-apis-storage_v1 0.8.0
Using google-cloud-secret_manager-v1 0.8.0
Using google-cloud-storage 1.34.1
Using terraspace_plugin_aws 0.3.0
Using terraspace-bundler 0.4.2
Using google-cloud-secret_manager-v1beta1 0.8.0
Using google-cloud-secret_manager 1.1.2
Using terraspace_plugin_google 0.3.0
Using terraspace 0.6.17
Bundle complete! 3 Gemfile dependencies, 101 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

$> terraspace test
=> cd test && bundle exec rspec
Could not find terraspace-0.6.9, rspec-terraspace-0.2.2, activesupport-6.1.3.2, terraspace-bundler-0.3.4, aws-sdk-dynamodb-1.60.0, aws-sdk-s3-1.95.1, aws-sdk-secretsmanager-1.46.0, aws-sdk-ssm-1.110.0, concurrent-ruby-1.1.8, azure-storage-blob-2.0.1, google-cloud-storage-1.31.1, google-cloud-secret_manager-1.1.0, aws-sdk-core-3.114.0, aws-sigv4-1.2.3, aws-sdk-kms-1.43.0, azure-storage-common-2.0.2, addressable-2.7.0, digest-crc-0.6.3, google-apis-iamcredentials_v1-0.4.0, google-apis-storage_v1-0.4.0, googleauth-0.16.2, mini_mime-1.1.0, google-cloud-secret_manager-v1-0.10.0, aws-eventstream-1.1.1, aws-partitions-1.465.0, faraday-1.4.2, faraday_middleware-1.0.0, net-http-persistent-4.0.1, google-apis-core-0.3.0, google-cloud-errors-1.1.0, signet-0.15.0, gapic-common-0.4.1, grpc-google-iam-v1-0.6.11, faraday-em_http-1.0.0, faraday-em_synchrony-1.0.0, faraday-excon-1.1.0, faraday-net_http-1.0.1, faraday-net_http_persistent-1.1.0, ruby2_keywords-0.0.4, connection_pool-2.2.5, http-cookie-1.0.3, googleapis-common-protos-1.3.11, googleapis-common-protos-types-1.0.6, unf_ext-0.0.7.7 in any of the sources
Run `bundle install` to install missing gems.

Running bundle install solves nothing, so I tried:

$> rm test/Gemfile.lock
$> bundle install

which succeeds, and then:

$> terraspace test

=> cd test && bundle exec rspec

main
  successful deploy (FAILED - 1)
=> TS_ENV=test terraspace down example -y
ERROR: It doesnt look like this is a terraspace project. Are you sure you are in a terraspace project?

Failures:

  1) main successful deploy
     Failure/Error: reconfigure_logging # reconfigure Terraspace.logger to a file

     NameError:
       undefined local variable or method `reconfigure_logging' for #<RSpec::ExampleGroups::Main before(:context) hook>
     # ./spec/main_spec.rb:3:in `block (2 levels) in <top (required)>'

Finished in 0.11271 seconds (files took 0.5078 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/main_spec.rb:17 # main successful deploy

Are there additional configuration steps or missing dependencies required before running the test?

LggLd commented 3 years ago

I was able to run the test after removing the reconfigure_logging line here: https://github.com/boltops-tools/terraspace-demo-module-test/blob/57ee83015d0ab7b374377816a290bf98facd63f7/app/modules/example/test/spec/main_spec.rb#L3