-
Notifications
You must be signed in to change notification settings - Fork 56
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
rake task to gather modules from Puppetfile or .fixtures.yml #183
Comments
Hey @logicminds i have "the fix" maybe :)
Can we close this ticket, and open a new ticket if you have feedback with the new functionality |
That should work, except for the symlinks. The symlink just points to the module itself though. Are you also installing the module being tested or just the fixtures without symlinks? |
Hey @logicminds it could work for symlinked folders. But i was unsure about the recursion issue with the symlink, It can be changed. sorry that was meant to be a simple explanation. it turns out this isnt that simple |
So i removed the check for symlinks, while we were able to build the module, the metadata.json file was missing causing the install of the module under test to fail. I dont think it is a good idea to build symlinked folders.
On the SUT.
|
I have a similar situation in that my modules are for internal use and therefore are not published on Puppet Forge. All my modules and node definitions are in one git repo and I resolve includes using modulepath in environment.conf. How can I resolve the includes during litmus acceptance testing? I tried playing around with install_modules_from_directory but it ignored the other module's fixtures directory because it saw a symlink (even though it was to the module itself). Any suggestions would be greatly appreciated. |
Seems like what is missing is the following:
|
PDK build may not work well for testing if it tries to validate all dependencies. You often want to test against If you want to do this, PDK needs to loosen up and allow 'bad things' because we're in the middle of testing. |
Thanks for your thoughts @trevor-vaughan. Since all my modules are in the same git repo, they are effectively versioned together. I actually want my acceptance tests to run against my local master. |
To anyone who stumbles upon this issue, my approach outlined above works. I use Gradle as my top level build tool for running PDK so I simply invoke PDK and Bolt directly from a Gradle task. The steps to make dependencies available are:
This is not meant as a solution that will work in all use cases but can serve as food for thought for those with more complex environments. |
hi @baron1405 , thanks for sharing your solution. There seem to be two overlapping issues. I'll try to dissect them below, please confirm whether I've covered everything, or if there's something missing.
|
Perhaps this should be rephrased to |
Thanks @DavidS and @ekohl for your responses. As far as dependency management goes, I am used to the way Gradle and Maven resolve dependencies. The developer lists their direct dependencies and transitive dependency resolution is handled by the tooling. If symlinks were processed, things would probably work for me but I cannot say definitively. One thing that concerns me about the use of symlinks is that there is a symlink pointing to the module itself. I have noticed that this can confuse IDEs. For example, IntelliJ IDEA 2019.3 gets bogged down when I right click on a module. I suspect it is the circular reference (module contains spec/fixtures/modules -> module). |
Symlinks are insanely useful for code reuse across tests. IMO Broken IDEs should have bugs filed against them. |
@trevor-vaughan the good news is that at least IntelliJ 2019.3 get a bit sluggish. 2019.2 would go off into an infinite loop. Speaking of reuse, for my use case where I am not publishing modules to Puppet Forge, it would be great to avoid the duplication of test framework files in each module (e.g. provision.yml). By no means a high priority issue, but since the topic came up. |
It's always been my understanding that namespace :litmus do
desc 'Install all fixture modules'
task :install_modules_from_fixtures, [:resolve_dependencies] do |_task, args|
args.with_defaults(resolve_dependencies: false)
Rake::Task['spec_prep'].invoke
Rake::Task['litmus:install_modules_from_directory'].invoke(nil, nil, nil, !args[:resolve_dependencies])
end
end Place the above code in |
Use Case
Our systems only use internal git repos, so installing the module with PMT doesn't satisfy the dependencies we have listed in fixtures.yml or Puppetfile for each module. All of our modules are on internal github/gitlab repositories.
Describe the Solution You Would Like
I would like to see a new rake task that runs the following:
Describe Alternatives You've Considered
Additional Context
Systems are not allowed to access the forge directly. The meatadata.json file does not support git urls or anything besides forge modules.
The text was updated successfully, but these errors were encountered: