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

junit format does not always use proper classname. #126

Closed
stefanandres opened this issue Jan 23, 2017 · 1 comment
Closed

junit format does not always use proper classname. #126

stefanandres opened this issue Jan 23, 2017 · 1 comment

Comments

@stefanandres
Copy link

verifier:
  name: inspec
  format: junit
  output: ../../build/junit/%{platform}_%{suite}_inspec.xml
$ cat test/integration/memcached-single-instance/inspec/memcached.rb
describe package('memcached') do
  it { should be_installed }
end

# workaround service() auto-detect
# https://github.com/chef/inspec/issues/1171
describe sysv_service('memcached') do
  it { should be_running }
  it { should be_enabled }
  before do
    skip unless os[:release] == '14.04' or os[:release] == '16.04'
  end
end

describe service('memcached') do
  it "is listening on port 11211" do
    expect(port(11211)).to be_listening
  end
end

describe file('/etc/memcached.conf') do
       its('content') { should match '-m 1G' }
end
$ cat ../../build//junit/ubuntu-16.04_memcached-single-instance_inspec.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="rspec" tests="5" failures="0" errors="0" time="0.197933" timestamp="2017-01-23T10:17:42+01:00">
  <!-- Randomized with seed 24234 -->
  <properties/>
  <testcase classname="usr.local.lib.ruby.gems.2.4.0.gems.inspec-1.9.0.lib.inspec.rule" name="System Package memcached should be installed" file="/usr/local/lib/ruby/gems/2.4.0/gems/inspec-1.9.0/lib/inspec/rule.rb" time="0.061945"/>
  <testcase classname="usr.local.lib.ruby.gems.2.4.0.gems.inspec-1.9.0.lib.inspec.rule" name="Service memcached should be running" file="/usr/local/lib/ruby/gems/2.4.0/gems/inspec-1.9.0/lib/inspec/rule.rb" time="0.077482"/>
  <testcase classname="usr.local.lib.ruby.gems.2.4.0.gems.inspec-1.9.0.lib.inspec.rule" name="Service memcached should be enabled" file="/usr/local/lib/ruby/gems/2.4.0/gems/inspec-1.9.0/lib/inspec/rule.rb" time="0.000192"/>
  <testcase classname="usr.local.lib.ruby.gems.2.4.0.gems.inspec-1.9.0.lib.inspec.rule" name="Service memcached is listening on port 11211" file="/usr/local/lib/ruby/gems/2.4.0/gems/inspec-1.9.0/lib/inspec/rule.rb" time="0.032800"/>
  <testcase classname="test.integration.memcached-single-instance.inspec.memcached" name="File /etc/memcached.conf content should match &quot;-m 1G&quot;" file="./test/integration/memcached-single-instance/inspec/memcached.rb" time="0.023982"/>
</testsuite>

Why does describe file come from memcached.rb, but describe package from /usr/local/lib/ruby/gems/2.4.0/gems/inspec-1.9.0/lib/inspec/rule.rb?

@chris-rock
Copy link
Collaborator

I assume this was fixed with inspec/inspec#1438 Please reopen if this continues to be an issue

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

No branches or pull requests

2 participants