This message was deleted.
# voxpupuli
s
This message was deleted.
j
this is testing with a module dep that is not released on the forge, the git needs to be installed via git
b
use the fixtures method documented in the readme
j
aww, I'll give that a try. Thanks.
although, this isn't great in the sense that the dep is only for the acceptance test, regular spec doesn't need it
the good news is that fixes acceptance tests. The bad news is blows up rspec-puppet because it seems it doesn't like the ref being a branch name???
Copy code
fatal: ambiguous argument 'production': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
b
how does your fixtures look like
i'm nuking the .bundle dir and reinstalling clean
ugh, the failure is repeatable
lets try a short sha1
b
use
branch:
j
facepalm
I had tried that and gotten the same failure
but now its working after nuking .bundle and reinstalling
wtf
ok, I think the other problem is that
configure_beaker
is in
spec_helper_acceptance.rb
but I've also got
configure_beaker(modules: :fixtures)
under
spec/support
. I guess I'll have to unmanage
spec_helper_acceptance.rb
for the moment. Should we add some templating into
spec_helper_acceptance.rb.erb
?
b
ah you need to call it only once
j
I understand. It just means having to unmanage spec_helper_acceptance.rb even in trivial cases
wow
so removing the plain
configure_breaker
actually breaks it completely because the a copy of the module being tested isn't installed at all
b
did you run the spec_prep task so the stuff is published locally?
j
is this like the old days and "self" needs to be in fixtures?
Could not find declared class smee
b
check the readme again, you need to call spec_preo before running beaker :)
j
ok... but this is uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
b
you do that in your Rakefile usually
we added support for fixtures brcause other might use it. the foreman people for example
j
right... so they are changing their
beaker
task then?
b
but it isnt templated in our modulesync_condig bevause vox pupuli doesnt use it
task :beaker => "spec_prep"
is all you need I think
that should run the spec_prep task every time beaker is called
j
huh, I thought that didn't inherit
learn something new every day
b
Maybe I am wrong :D
j
so I should probably publish the stupid fork to the forge
it is only needed for stdlib
b
:D
j
and its only for EL7
which is why I haven't done anything as EL7 is on its last days
b
ah yes
j
because of course the gems aren't installed
b
yes. add puppetlabs_spec_helper to the system_tests group
j
argh, and I need to unmanage Rakefile as well
I figured out I can just use
./rakelib/beaker.rb
and not have unmanage
Rakefile
or not, this isn't my day
facepalm
needs to be .rake
more ugh. .fixtures.yml doesn't do dep resolution... so I need to work out recursive deps to convert to fixtures...
b
why again don't you use the normal installation method? 😄
a dependency wasn't on the forge?
j
no, this is for forge modules
when they were installed the old way with pmt it pulled down deps
1:1 conversion to .fixtures.yml fails because no dep resolution... just another gotcha
it would be way better if we put in a
Puppetfile
and use librarian for fixture setup as it would resolve deps
b
yeah but why do you need to use the fixtures inszallation method at all?
j
because I use puppet modules for setting up the acceptance test that aren't deps of the module itself
because I don't want to add a dep to puppet/yum, epel, etc. to all my modules because that makes re-composition hard
d
b
ah okay
there are also methods to install deps for acceptance tests
j
you mean #install_module_from_forge_on, which I was using?
wait, are we keeping beaker-module_install_helper?
b
no :)
j
right... so what option is there other than
.fixtures.yml
?
b
like we did it in the past, read the deps from metadata.json. and if you have deps specific for acceptance tests you can install them like https://github.com/voxpupuli/puppet-grafana/blob/master/spec/spec_helper_acceptance.rb#L11
j
facepalm
Copy code
install_puppet_module_via_pmt_on
is the replacement for
Copy code
install_module_from_forge_on
?
b
yeah
j
that method name is even worse...
b
we are open for patches! :D
j
how about aliasing it to install_module_from_forge_on?
that would have saved me some grief today
b
I am not sure if the params are identical
but I considered a wrapper, that would be nice
just never had the time :+
j
copy. I don't know how I missed the discussion on this revamp. I would have been more than willing to help.
j
backtracking a bit, should I merge https://github.com/voxpupuli/modulesync_config/pull/837 or do you want to think about it more?
I honestly never use pmt so I'm unsure how it deals with version constraints
b
I think thats already a good enough improvement so that we can merge it
👍 1
pmt honours major version constraints and poops itself if you try to violate them
it forces us to review module dependencies, which I like. with stuff like stdlib 9 we see that version constraints actually make sense
j
I know that it won't downgrade already installed modules, which is sort of pita. I see that in acceptance tests if stdlib 9 gets installed and then its invoked again for a mod that only wants stdlib 8
it would be really great to just use a Puppetfile and librarian
or r10k with dep resolution...
b
yeah
j
argh, thanks puppet 8
Copy code
error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, deprecation. ensure_packages. This function is deprecated, please use stdlib::ensure_packages instead. at ["/home/runner/work/puppet-ccs_software/puppet-ccs_software/spec/fixtures/modules/sudo/manifests/package.pp", 76]:["/home/runner/work/puppet-ccs_software/puppet-ccs_software/spec/fixtures/modules/sudo/manifests/conf.pp", 50] (file: /home/runner/work/puppet-ccs_software/puppet-ccs_software/spec/fixtures/modules/sudo/manifests/package.pp, line: 76, column: 9) (file: /home/runner/work/puppet-ccs_software/puppet-ccs_software/spec/fixtures/modules/ccs_software/manifests/service.pp, line: 56) on node <http://fv-az612-160.gqp4uj4dnjkevoqu2sjlt0n5ta.cx.internal.cloudapp.net|fv-az612-160.gqp4uj4dnjkevoqu2sjlt0n5ta.cx.internal.cloudapp.net>
so all deps have to be upgraded too
b
stdlib 9 is biting you, not puppet 8
j
fixtures...
b
see, thats why we use pmt and metadata.json :D
j
it is only failing on puppet 8 though... puppet 7 passes
b
becazse ouppet 8 has strict = error so it shows the problem, puppet 7 just swallows it
j
facepalm
b
my fingers are too fat for this smartphone keyboard
Its getting late here, I will head out to bed o/
j
thank you for bailing me out once again
have a good evening 😉