Comments (11)
hi,
the container always needs to be destroyed but the image can be preserved by enabling this option ( see example in my nodeset configs )
https://github.com/elasticsearch/puppet-elasticsearch/blob/master/spec/acceptance/nodesets/centos-6-x64.yml#L14
from beaker.
Alright, thank you. I added this to the wiki.
Still, when I use that command and remove the BEAKER
env variables beaker seems to run the following commands every run.
apt-get update
apt-get install --force-yes -y curl
apt-get install --force-yes -y ntpdate
apt-get install --force-yes -y lsb-release
Shouldn't that be part of the image creation process, which should only run once unless/until I delete the image? Or might that be some problem with my projects spec_helper_acceptance.rb
? It looks like that:
require 'beaker-rspec'
require 'pry'
hosts.each do |host|
# install_package host, 'rubygems'
# on host, 'DEBIAN_FRONTEND=noninteractive apt-get install --yes -q openssl libssl-dev'
# on host, 'gem install puppet --no-ri --no-rdoc'
on host, "mkdir -p #{host['distmoduledir']}"
end
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module
puppet_module_install(:source => proj_root, :module_name => 'puma')
end
end
from beaker.
Hi,
Things that should in the image you can do with this:
https://github.com/elasticsearch/puppet-elasticsearch/blob/master/spec/acceptance/nodesets/centos-6-x64.yml#L11-L13
from beaker.
I know that. I am just wondering, why every run of the rake task is executing:
apt-get update
apt-get install --force-yes -y curl
apt-get install --force-yes -y ntpdate
apt-get install --force-yes -y lsb-release
Those have not been defined by my projects configuration. Or so I suppose. :-)
And I think they should not be run by beaker but by the image creation process. Isn't it?
(At least when using the docker hypervisor)
from beaker.
Ah, those are in beaker it self in the pre-build steps.
That's to ensure that they will be installed no matter what.
from beaker.
See https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host_prebuilt_steps.rb#L13-L16
from beaker.
Ah! I understand.
As I am not into the beaker development (yet :-).
What do you think about moving those concerns into the docker image creation process when using docker?
I'd love to create a pull request. My solution would be to not install the packages from the prebuilt steps when using docker and just adding the needed packages to https://github.com/puppetlabs/beaker/blob/master/lib/beaker/hypervisor/docker.rb#L96
Do you have any hints on that?
I think this would speed up the execution of specs tremendously.
from beaker.
I looked again. The validate_host
method does check whether a package is installed.
So I think installing those packages per default in beakers docker code would suffice.
I will have a try and request a pull.
Thank you for your help on this. 👍
from beaker.
Hi,
The packages are setup by default unrelated to which hyper-visor you use.
This is to ensure that the required packages are installed even if the base image that is used have it installed or not.
I doubt it will have much use to send a PR for this to be very honest.
from beaker.
Hi again,
As far as I can see those packages are mandatory, as are the packages here:
https://github.com/puppetlabs/beaker/blob/master/lib/beaker/hypervisor/docker.rb#L115
Beaker always creates a new image; installing openssh. Why not simply install those packages there too?
It speeds up the execution and one does not have to add those packages to the projects host config manually.
And it would not break other hypervisors.
from beaker.
Hi,
Sorry that i miss understood you.
Yeah it makes sense to put them in that step.
I've put them in my nodeset files.
from beaker.
Related Issues (20)
- The beaker reboot needs to cross minute boundaries based on the method used HOT 6
- retry_on says that it can take an Array of hosts, but it will fail if one is passed
- beaker is failing to run acceptance tests on existing node HOT 2
- Rsync may not be able to use a provided password for the SSH connection HOT 2
- (BKR-1690) Rm -rf not working when path has spaces and logging on localhost
- (BKR-1675) Update net-scp to version 3.0.0 HOT 1
- Add support for opensuse? HOT 3
- The get_ip method should match on any vagrant-backed hypervisor
- ssh_config file not used by default HOT 3
- EL 9 error - /sbin/service: No such file or directory
- Failed to exec 'vagrant up' (rbenv, ruby 2.7.6, bundler 2.3.19, virtualbox) HOT 11
- Ruby 3.1/Psych 4 compatibility issues HOT 3
- 4.39.0 breaks beaker-puppet tests HOT 1
- Consider setting defaults to systemctl/systemd commands
- beaker master scp issue HOT 1
- Support installing modules from git branches HOT 4
- puppet_module_install excludes too much HOT 4
- having error finding my class using beaker HOT 1
- how can i test hiera roles using beaker? HOT 2
- Better Openstack IP address assignment HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beaker.