-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
add tests for php5.6 #418
add tests for php5.6 #418
Conversation
software-properties-common is needed to add ppas on ubuntu. the puppetlabs-apt module can manage the package. it is save to enable this, because the module uses ensure_package: https://github.com/puppetlabs/puppetlabs-apt/blob/df40baebedf5c0c15e08f3ec78adfd760b1371ca/manifests/ppa.pp#L30 Without this, managing ppa repos at least on ubuntu 16.04 is impossible. I noticed this bug while testing with aceptance tests in voxpupuli#418
c2f1975
to
d2ce25b
Compare
The new spec file alone is working. Our module doesn't support the upgrade/downgrade of the php version, and beaker-rspec executes all tests in the same container. This seems to work in other modules like jenkins?? |
2f3c965
to
f2ef150
Compare
4fdf8c8
to
4452c22
Compare
If we do go this way, I'd prefer the following in
|
spec/acceptance/php56_spec.rb
Outdated
end | ||
|
||
case default[:platform] | ||
when %r{16.04} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the same as 14.04? Would it be better to test for the Debian OS family or at least Ubuntu?
spec/acceptance/php_spec.rb
Outdated
describe package('php-fpm') do | ||
it { is_expected.to be_installed } | ||
|
||
case default[:platform] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to set the expected package name in a case statement (with a let
block?) and then have the same describe
block with a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented it, just without the let block (didn't work)
this will go upstream into modulesync_config
this will execute each of them in their own container
ba844bc
to
9650477
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking about environment variables rather than explicit filenames. You can do describe "case", if/unless: ... do
and set the variables via Travis.
spec/acceptance/php56_spec.rb
Outdated
|
||
describe 'with specific php version' do | ||
case default[:platform] | ||
when %r{16.04} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to just check for Ubuntu here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah would work as well
spec/acceptance/php56_spec.rb
Outdated
packagename = 'php5.6-fpm' | ||
when %r{14.04} | ||
packagename = 'php5.6-fpm' | ||
when %r{7} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this Debian 7 or CentOS 7?
spec/acceptance/php56_spec.rb
Outdated
packagename = 'php5.6-fpm' | ||
when %r{7} | ||
packagename = 'php-fpm' | ||
when %r{8} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing Debian?
@@ -0,0 +1,45 @@ | |||
require 'spec_helper_acceptance' | |||
|
|||
describe 'with specific php version' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a check for php --version
?
8e1e38b
to
dd275af
Compare
spec/acceptance/php_spec.rb
Outdated
package = 'php5-fpm' | ||
when %{centos} | ||
package = 'php-fpm' | ||
when %{'debian'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the quotes needed here? should it be a regex too?
spec/acceptance/php56_spec.rb
Outdated
it { is_expected.to be_enabled } | ||
end | ||
describe command('php --version') do | ||
its(:stdout) { is_expected.to match %r{5.6} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the dot in 5.6 be escaped since it's a regex char?
592c464
to
fcccf06
Compare
b0d1cb2
to
761eec2
Compare
761eec2
to
2b970d7
Compare
finally green |
software-properties-common is needed to add ppas on ubuntu. the puppetlabs-apt module can manage the package. it is save to enable this, because the module uses ensure_package: https://github.com/puppetlabs/puppetlabs-apt/blob/df40baebedf5c0c15e08f3ec78adfd760b1371ca/manifests/ppa.pp#L30 Without this, managing ppa repos at least on ubuntu 16.04 is impossible. I noticed this bug while testing with aceptance tests in voxpupuli#418
No description provided.