I'm using this action to test Terraform modules and it has been working fine until I added a new module to test. I then tested existing untouched modules to find they were also failing to run inspec tests. I can run Inpsec exec
and accept license but it fails to run tests
name: Terraform-CI
on:
# Triggers the workflow on pull request events
pull_request:
branches: [ '*' ]
workflow_dispatch:
jobs:
terraform:
name: Terraform CI
runs-on: ubuntu-latest
env:
ARM_CLIENT_ID: ${{ secrets.AZURE_MODULE_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.AZURE_MODULE_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_MODULE_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.AZURE_MODULE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_MODULE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_MODULE_CLIENT_SECRET }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_MODULE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_MODULE_TENANT_ID }}
steps:
- name: Clone repo
uses: actions/checkout@main
- name: HashiCorp - Setup Terraform
uses: hashicorp/[email protected]
- name: Install Inspec
uses: actionshub/[email protected]
- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true
#### Basic Tests
- name: Terraform Init Basic
id: init_basic
run: |
cd tests/basic
terraform init
- name: Terraform Plan Basic
id: plan_basic
run: |
cd tests/basic
terraform plan
- name: Terraform Apply Basic
id: apply_basic
run: |
cd tests/basic
terraform apply --auto-approve
- name: Inspec Scan Basic
id: inspec_basic
run: |
inspec exec tests/basic/azure-inspec-tests --chef-license accept -t azure://
continue-on-error: true
- name: Terraform Destroy Basic
id: destroy_basic
run: |
cd tests/basic
terraform destroy --auto-approve
Run inspec exec tests/basic/azure-inspec-tests --chef-license accept -t azure://
+---------------------------------------------+
โ 1 product license accepted.
+---------------------------------------------+
/opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:184:in `current_thread_backend': uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError)
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:103:in `backend='
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/xml_mini.rb:11:in `<top (required)>'
from <internal:/opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/core_ext/hash/conversions.rb:3:in `<top (required)>'
from <internal:/opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/core_ext/hash.rb:3:in `<top (required)>'
from <internal:/opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/chef-workstation/embedded/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/dsl_shared.rb:33:in `require'
from libraries/backend/azure_require.rb:8:in `create'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/dsl_shared.rb:47:in `eval'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/dsl_shared.rb:47:in `require'
from libraries/azure_backend.rb:1:in `create'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/dsl_shared.rb:47:in `eval'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/dsl_shared.rb:47:in `require'
from libraries/azure_graph_generic_resource.rb:1:in `create'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/dsl_shared.rb:47:in `eval'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/dsl_shared.rb:47:in `require'
from libraries/azure_active_directory_domain_service.rb:1:in `load_with_context'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile_context.rb:170:in `instance_eval'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile_context.rb:170:in `load_with_context'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile_context.rb:159:in `load_library_file'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile_context.rb:144:in `block in load_libraries'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile_context.rb:143:in `each'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile_context.rb:143:in `load_libraries'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile.rb:376:in `load_libraries'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile.rb:369:in `block in load_libraries'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile.rb:350:in `each'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile.rb:350:in `each_with_index'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/profile.rb:350:in `load_libraries'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/runner.rb:108:in `block in load'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/runner.rb:102:in `each'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/runner.rb:102:in `load'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/runner.rb:136:in `run'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/cli.rb:304:in `exec'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-core-4.52.9/lib/inspec/base_cli.rb:35:in `start'
from /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/inspec-bin-4.52.9/bin/inspec:11:in `<top (required)>'
from /usr/bin/inspec:380:in `load'
from /usr/bin/inspec:380:in `<main>'
Error: Process completed with exit code 1.