(PUP-3248) Fix PMT tests for directory environment#3099
(PUP-3248) Fix PMT tests for directory environment#3099johnduarte wants to merge 2 commits intopuppetlabs:masterfrom
Conversation
|
CLA signed by all contributors. |
There was a problem hiding this comment.
I think this is probably better specified as a 'puppet config print modulepath --environment '; default could be 'production'. Otherwise we're just obtaining the modulepath for whatever environment happens to be associated with the agent section of puppet.conf, (which is likely to be the default, 'production', but it's a little vague).
There was a problem hiding this comment.
@jpartlow the purpose of this helper is to obtain the modulepath segments as an array. It is not intended to obtain the the environment.
There was a problem hiding this comment.
Right, but modulepath is a property of the environment. Really all I'm saying is that it's clearer to obtain settings from puppet by using the puppet config tool and specifying environment and section as needed. A puppet agent --configprint modulepath is the equivalent of saying puppet config print --section agent modulepath And moving forward, modulepath is deprecated in a puppet.conf section. Instead you really need to be asking puppet config print modulepath --environment <something>
There was a problem hiding this comment.
@jpartlow thank you for the additional context. I have pushed an update incorporating your suggested change to puppet config print modulepath --environment #{environment}.
655eabc to
b7f521c
Compare
The beaker host['distmoduledir'] variable is not meaningful if the host is using directory environments (e.g. 'production'). This commit updates the helper methods for validating that a module is (or is not) installed on the host by iterating over the modulepath if a specific modulepath is not provided. The calls to these helper methods have been updated for the change in parameter ordering in the helper methods.
b7f521c to
0126627
Compare
There was a problem hiding this comment.
Why don't we want these running in the pe suite?
There was a problem hiding this comment.
@jpartlow Running these in PE does 'bad things' to the puppet master. I haven't had a chance to do the root cause analysis as to why yet.
There was a problem hiding this comment.
I suspect it's because the generate_base_legacy_and_directory_environments is being given the real master['puppetpath']. We should probably change this to point to a tmpdir, and then I think this will be insulated.
|
Also, let's rebase this to stable and we'll merge up from there; since there's still discussion of a Puppet 3.7.2 and the pe-puppet 3.4.x is targeted to the 3.7.x puppet stable atm. |
|
@jpartlow this has already been rebased on stable. Cheers. |
|
The PR's still targeting master though? |
|
@jpartlow this is the error I get if the environmentpath is not amended with the given path in the setup method. |
|
Ah, ok, I think what is going on. We are inheriting the original puppet.conf settings (sourced from $settings::config), and they now have environmentpath set, so that legacyenv is being ignored. So we do need to set environmentpath in the generate_base_legacy_and_directory_environments() method, but we want to set it to an empty string to begin with (clear it, essentially). |
There was a problem hiding this comment.
So I think this just needs to change to:
"environmentpath", ""
(and we can get ride of the envpath variable lines above that)
This commit changes calls to the generate_base_legacy_and_directory_environments helper to use a tmpdir rather than master['puppetpath'] to isolate the test environments and prevent collisions. The generate_base_legacy_and_directory_environments has also been altered to remove the `environmentpath` setting in the generated configuration file.
b9f8dfe to
5a49f76
Compare
|
This PR needs to be reopened against the puppet stable branch. |
The beaker host['distmoduledir'] variable is not meaningful if the
host is using directory environments (e.g. 'production').
This commit updates the helper methods for validating that a module
is (or is not) installed on the host by iterating over the
modulepath if a specific modulepath is not provided.
The calls to these helper methods have been updated for the change
in parameter ordering in the helper methods.