Skip to content
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

(MODULES-8390) Enable implementations on the init task and hide others #96

Merged
merged 3 commits into from
Jan 4, 2019

Conversation

MikaelSmith
Copy link
Contributor

Add implementations to the init task so it falls back to non-Ruby
implementations when puppet-agent isn't available. Also hide the extra
implementations from task runners that implement private tasks and task
implementations.

@MikaelSmith
Copy link
Contributor Author

puppetlabs/puppetlabs-service#61 will need the same treatment, but I'm going to wait until this has had some review before repeating it.

.travis.yml Outdated
@@ -24,27 +24,21 @@ matrix:
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
rvm: 2.5.1
script: bundle exec rake beaker
script: bundle exec rake spec_prep beaker
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll need to figure out how to update .sync.yml to make this happen.

Gemfile Outdated
@@ -31,6 +31,8 @@ end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]

gem "bolt", '~> 1.4'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, .sync.yml

@MikaelSmith
Copy link
Contributor Author

MikaelSmith commented Dec 20, 2018

@tphoney should I try out solid-waffle here?

Update: going to ignore it for now.

@MikaelSmith MikaelSmith force-pushed the MODULES-8390 branch 3 times, most recently from 291b3d2 to 4cb7da1 Compare December 21, 2018 18:11
@MikaelSmith
Copy link
Contributor Author

Should be ready now.

@donoghuc
Copy link
Contributor

donoghuc commented Jan 2, 2019

Getting task not found error in Jenkins CI. https://jenkins-master-prod-1.delivery.puppetlabs.net/view/All/job/forge-module_puppetlabs-package_intn-sys_smoke-adhoc/PLATFORM=ubuntu1604-64default.a,WORKER_LABEL=beaker/27/console Is it because we have not added a .fixtures.yml?

fixtures:
  symlinks:
  package: "#{File.absolute_path(File.join(source_dir, '..'))}"

Add implementations to the init task so it falls back to non-Ruby
implementations when puppet-agent isn't available. Also hide the extra
implementations from task runners that implement private tasks and task
implementations.
@donoghuc donoghuc force-pushed the MODULES-8390 branch 2 times, most recently from e7e38dd to dc02b73 Compare January 3, 2019 21:56
Previous acceptance tests were stuck on a pre-1.0 version of Bolt that
didn't support implementations and rejected the private key. We also
never test with the PE install mode from beaker-task_helper. Switch to
testing with BoltSpec::Run as the current supported test method.
apply_manifest_on(default, "package { \"#{package_to_use}\": ensure => present, }")
result = run('action' => 'uninstall', 'name' => package_to_use)
expect(result[0]['status']).to eq('success')
expect(result[0]['result']['action']).to match(%r{uninstall})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikaelSmith Is this what we expect the structure of the package::windows task to be? I ask because it appears to be different than the linux task and needed to be updated to pass Jenkins CI.

Windows:

    24:   describe 'install action' do
    25:     it "install #{package_to_use}" do
    26:       apply_manifest_on(default, "package { \"#{package_to_use}\": ensure => absent, }")
    27:       result = run('action' => 'install', 'name' => package_to_use)
    28:       require 'pry'; binding.pry
 => 29:       expect(result[0]['status']).to eq('success')
    30:       expect(result[0]['result']['action']).to match(%r{install})
    31:     end
    32:   end
    33: 
    34:   describe 'uninstall action' do

[1] pry(#<RSpec::ExampleGroups::WindowsPackageTask::InstallAction>)> result
=> [{"node"=>"xca8yxo2w8ppx0w.delivery.puppetlabs.net",
  "status"=>"success",
  "result"=>
   {"status"=>"success",
    "name"=>"notepadplusplus.install",
    "action"=>"install"}}]

linux

    28:     it 'uninstall rsyslog' do
    29:       apply_manifest_on(default, "package { 'rsyslog': ensure => present, }")
    30:       result = run('action' => 'uninstall', 'name' => 'rsyslog')
    31:       expect(result[0]['status']).to eq('success')
    32:       require 'pry'; binding.pry
 => 33:       expect(result[0]['result']['status']).to match(%r{install})
    34:     end
    35:   end
    36: 
    37:   describe 'upgrade', if: (fact('operatingsystem') == 'CentOS' && fact('operatingsystemmajrelease') == '7') do
    38:     it 'upgrade httpd' do

[1] pry(#<RSpec::ExampleGroups::LinuxPackageTask::UninstallAction>)> result
=> [{"node"=>"tjloscdgqw7s81j.delivery.puppetlabs.net",
  "status"=>"success",
  "result"=>{"status"=>"rsyslog uninstall"}}]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was different. I didn't try to change that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like either, Windows is probably a bit better. I was going to leave improving them as separate work.

@donoghuc
Copy link
Contributor

donoghuc commented Jan 3, 2019

CI is failing to install rsyslog on redhat-6-x86_64. https://jenkins-master-prod-1.delivery.puppetlabs.net/view/__experimental%20automatic/job/experimental_auto_puppetlabs-package_intn-sys_full-pe-current-adhoc/PLATFORM=redhat6-64default.a,WORKER_LABEL=beaker/1/consoleFull

When I yum install -y rsyslog on a vmpooler box I get the same error. Shall I just skip installing rsyslog on redhat 6 for now?

[root@uqos6dqmsi30dzy ~]# yum install -y rsyslog
Loaded plugins: product-id, search-disabled-repos, security, subscription-
              : manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
localmirror-extras                                       | 3.6 kB     00:00     
localmirror-extras/primary_db                            |  49 kB     00:00     
localmirror-lb                                           | 3.6 kB     00:00     
localmirror-optional                                     | 3.6 kB     00:00     
localmirror-optional/primary_db                          | 5.6 MB     00:00     
localmirror-os                                           | 3.7 kB     00:00     
localmirror-os/primary_db                                |  62 MB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package rsyslog.x86_64 0:5.8.10-10.el6_6 will be updated
---> Package rsyslog.x86_64 0:5.8.10-12.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch          Version               Repository             Size
================================================================================
Updating:
 rsyslog        x86_64        5.8.10-12.el6         localmirror-os        650 k

Transaction Summary
================================================================================
Upgrade       1 Package(s)

Total download size: 650 k
Downloading Packages:
https://artifactory.delivery.puppetlabs.net/artifactory/rpm__remote_rhel-68-x86_64/os/Packages/rsyslog-5.8.10-12.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.



Error Downloading Packages:
  rsyslog-5.8.10-12.el6.x86_64: failure: Packages/rsyslog-5.8.10-12.el6.x86_64.rpm from localmirror-os: [Errno 256] No more mirrors to try.

Unable to reliably install rsyslog on RedHat 6. Skipping rsyslog dependent tests on RedHat 6.
@donoghuc
Copy link
Contributor

donoghuc commented Jan 4, 2019

@MikaelSmith MikaelSmith merged commit 2fc215e into master Jan 4, 2019
@MikaelSmith MikaelSmith deleted the MODULES-8390 branch January 4, 2019 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants