edestecd / puppet-mariadb

Puppet Module for managing MariaDB
GNU General Public License v3.0
3 stars 21 forks source link

failed: rspec: ...: dependency cycles found #16

Closed bittner closed 6 years ago

bittner commented 6 years ago

I'm running RSpec tests against a role of our control repository, and the test fails with a dependency cycle on Debian 9. This is what the test looks like:

require 'spec_helper'

describe 'role::server::customer_standalone' do
  on_supported_os.each do |os, facts|
    context "on #{os}" do
      let(:facts) do
        facts.merge(
          service_provider: 'systemd',
        )
      end

      it { is_expected.to compile.with_all_deps }
    end
  end
end

The tests are executed using PDK on a GitLab runner: (Interestingly, when I run the same command locally on my Ubuntu 17.04 Zesty development machine the tests pass. :confused:)

$ pdk test unit 2> /dev/null
failed: rspec: ./spec/classes/role_server_customer_standalone_spec.rb:12: dependency cycles found: (Anchor[apt_key 177F4010FE56CA3336300305F1656F24C74CD1D8 present] => Apt::Key[Add key: 177F4010FE56CA3336300305F1656F24C74CD1D8 from Apt::Source mariadb] => Apt::Source[mariadb] => Class[Apt::Update] => Exec[apt_update] => Class[Apt::Update] => Package[dirmngr] => Apt::Key[Add key: 177F4010FE56CA3336300305F1656F24C74CD1D8 from Apt::Source mariadb] => Anchor[apt_key 177F4010FE56CA3336300305F1656F24C74CD1D8 present])

  role::server::customer_standalone on debian-9-x86_64 should compile into a catalogue without dependency cycles
  Failure/Error:
        end

        it { is_expected.to compile.with_all_deps }
      end
    end

In the role I only include the needed profiles, and the mariadb::server profile only includes this module:

# Role for profiles that need to make a customer standalone host work
class role::server::customer_standalone {
  # All roles should include the base profile
  include profile::base
  include profile::server
  include profile::database::mariadb::server
  include profile::webserver::apache
  include profile::php
  include profile::deployment::comsolit_deploy
  include profile::monitoring::datadog
  include profile::backup
  include profile::ftp::server
}
# MariaDB database service profile (includes component modules for database server setup)
class profile::database::mariadb::server {
  include 'mariadb::server'
}

Any idea what could be wrong?

edestecd commented 6 years ago

Can you paste in the dep cycle you are getting? Graphing it helps sometimes.

bittner commented 6 years ago

Isn't it the one shown by the error message?

(Anchor[apt_key 177F4010FE56CA3336300305F1656F24C74CD1D8 present] => Apt::Key[Add key: 177F4010FE56CA3336300305F1656F24C74CD1D8 from Apt::Source mariadb] => Apt::Source[mariadb] => Class[Apt::Update] => Exec[apt_update] => Class[Apt::Update] => Package[dirmngr] => Apt::Key[Add key: 177F4010FE56CA3336300305F1656F24C74CD1D8 from Apt::Source mariadb] => Anchor[apt_key 177F4010FE56CA3336300305F1656F24C74CD1D8 present])

edestecd commented 6 years ago

What is Package[dirmngr]? That seems to be related and not in the mariadb module

bittner commented 6 years ago

I have no idea (read: too lazy to analyze) where this comes from. It is available in both Jessie and Stretch, though.

edestecd commented 6 years ago

Let me know if this is still an issue. I have converted to pdk. Not sure if that helps.

bittner commented 6 years ago

I'm working in a different environment now. No easy way to test your changes. I'm closing this issue, sorry!