foreman_pipeline 0.0.11 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +2 -1
  4. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/jenkins-instance-details-info.controller.js +23 -2
  5. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/jenkins-instance-details.controller.js +1 -23
  6. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details-info.html +31 -0
  7. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details-users.html +17 -14
  8. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/details/views/jenkins-instance-details.html +3 -10
  9. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/jenkins-instances.module.js +4 -1
  10. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/new/new-jenkins-instance.controller.js +4 -7
  11. data/app/assets/javascripts/foreman_pipeline/jenkins-instances/new/views/new-jenkins-instance-form.html +18 -3
  12. data/app/assets/javascripts/foreman_pipeline/jenkins-users/new/new-jenkins-user.controller.js +5 -5
  13. data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-content-views.controller.js +3 -3
  14. data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-hostgroups.controller.js +3 -5
  15. data/app/assets/javascripts/foreman_pipeline/jobs/details/job-details-jenkins-projects.controller.js +2 -2
  16. data/app/assets/javascripts/foreman_pipeline/jobs/details/project-discovery/job-projects-discovery.controller.js +10 -1
  17. data/app/assets/javascripts/foreman_pipeline/jobs/details/project-discovery/views/job-projects-discovery.html +20 -12
  18. data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-content-views.html +12 -8
  19. data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-environments.html +10 -6
  20. data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-hostgroups.html +6 -2
  21. data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-jenkins-projects.html +7 -6
  22. data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-jenkins.html +15 -11
  23. data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-resources.html +16 -12
  24. data/app/assets/javascripts/foreman_pipeline/jobs/details/views/job-details-to-environments.html +11 -7
  25. data/app/assets/javascripts/foreman_pipeline/jobs/jobs.module.js +4 -1
  26. data/app/assets/stylesheets/foreman_pipeline/foreman_pipeline.css +4 -0
  27. data/app/controllers/foreman_pipeline/api/jenkins_instances_controller.rb +10 -3
  28. data/app/controllers/foreman_pipeline/api/jenkins_projects_controller.rb +1 -1
  29. data/app/controllers/foreman_pipeline/api/jenkins_users_controller.rb +1 -1
  30. data/app/controllers/foreman_pipeline/api/jobs_controller.rb +44 -48
  31. data/app/lib/actions/foreman_pipeline/jenkins/build.rb +9 -3
  32. data/app/lib/actions/foreman_pipeline/jenkins/build_project.rb +2 -0
  33. data/app/lib/actions/foreman_pipeline/jenkins/bulk_build.rb +4 -0
  34. data/app/lib/actions/foreman_pipeline/jenkins/list.rb +4 -0
  35. data/app/lib/actions/foreman_pipeline/jenkins_instance/create_jenkins_instance_keys.rb +1 -1
  36. data/app/lib/actions/foreman_pipeline/job/create_host.rb +2 -2
  37. data/app/lib/actions/foreman_pipeline/job/cv_promote_job_hook.rb +1 -3
  38. data/app/lib/actions/foreman_pipeline/job/cv_publish_job_hook.rb +1 -3
  39. data/app/lib/actions/foreman_pipeline/job/job_hook.rb +4 -3
  40. data/app/lib/actions/foreman_pipeline/job/repo_sync_job_hook.rb +4 -17
  41. data/app/lib/actions/foreman_pipeline/job/run_job_manually.rb +2 -11
  42. data/app/lib/actions/foreman_pipeline/job/wait_until_provisioned.rb +4 -1
  43. data/app/lib/actions/foreman_pipeline/mixins/uri_extension.rb +1 -1
  44. data/app/models/foreman_pipeline/jenkins_instance.rb +8 -6
  45. data/app/models/foreman_pipeline/jenkins_project.rb +2 -4
  46. data/app/models/foreman_pipeline/jenkins_project_param.rb +0 -1
  47. data/app/models/foreman_pipeline/jenkins_user.rb +0 -2
  48. data/app/models/foreman_pipeline/job.rb +24 -8
  49. data/app/models/foreman_pipeline/job_to_environment.rb +0 -2
  50. data/app/services/foreman_pipeline/job_filter.rb +34 -0
  51. data/app/views/foreman/unattended/snippets/_jenkins_instance_pubkey.erb +3 -3
  52. data/app/views/foreman_pipeline/api/jenkins_instances/show.json.rabl +1 -1
  53. data/config/routes.rb +2 -7
  54. data/db/migrate/20150209160604_add_jenkins_home_to_jenkins_instance_table.rb +1 -1
  55. data/db/migrate/20150213095447_add_cert_path_to_jenkins_instances.rb +1 -1
  56. data/db/migrate/20150223142315_change_jenkins_instance_cert_path_column.rb +1 -1
  57. data/db/migrate/20150224090100_create_jenkins_projects_table.rb +4 -4
  58. data/db/migrate/20160404102405_update_projects_table.rb +9 -0
  59. data/db/migrate/20160404133012_drop_job_jenkins_project.rb +30 -0
  60. data/db/migrate/20160629085119_add_timeout_to_jenkins_instance.rb +9 -0
  61. data/db/seeds.d/location.rb +9 -0
  62. data/db/seeds.d/snippets.rb +11 -0
  63. data/lib/foreman_pipeline/engine.rb +1 -2
  64. data/lib/foreman_pipeline/plugin.rb +1 -1
  65. data/lib/foreman_pipeline/roles.rb +3 -3
  66. data/lib/foreman_pipeline/skip_tests.rb +22 -6
  67. data/lib/foreman_pipeline/tasks/{foreman_pipeline_test.rake → test.rake} +3 -2
  68. data/lib/foreman_pipeline/version.rb +1 -1
  69. data/test/fixtures/jenkins_instances.yml +8 -0
  70. data/test/fixtures/jenkins_projects.yml +9 -0
  71. data/test/fixtures/jenkins_users.yml +4 -0
  72. data/test/fixtures/jobs.yml +47 -0
  73. data/test/fixtures/pipeline_compute_attributes.yml +20 -0
  74. data/test/fixtures/pipeline_compute_profiles.yml +5 -0
  75. data/test/fixtures/pipeline_hostgroups.yml +25 -0
  76. data/test/fixtures_support.rb +17 -0
  77. data/test/{foreman_pipeline_plugin_test_helper.rb → foreman_pipeline_test_helper.rb} +17 -8
  78. data/test/functional/foreman_pipeline/api/jenkins_users_controller_test.rb +47 -0
  79. data/test/functional/foreman_pipeline/api/jobs_controller_test.rb +186 -0
  80. data/test/{unit → models}/jenkins_instance_test.rb +1 -1
  81. data/test/{unit → models}/job_test.rb +111 -55
  82. data/test/services/job_filter_test.rb +59 -0
  83. metadata +37 -16
  84. data/app/models/foreman_pipeline/job_jenkins_project.rb +0 -27
  85. data/lib/foreman_pipeline/tasks/foreman_pipeline_seed.rake +0 -28
  86. data/test/factories/hostgroup_factory.rb +0 -5
  87. data/test/unit/sanity_test.rb +0 -12
@@ -8,7 +8,6 @@ module ForemanPipeline
8
8
  self.inheritance_column = :_inheritance_type_disabled
9
9
  belongs_to :organization
10
10
  belongs_to :jenkins_project, :class_name => "ForemanPipeline::JenkinsProject"
11
- attr_accessible :name, :type, :description, :value, :organization_id, :jenkins_project_id
12
11
 
13
12
  TYPES = ["string", "boolean", "text"]
14
13
  validates :type, :inclusion => { :in => TYPES }
@@ -11,8 +11,6 @@ module ForemanPipeline
11
11
  validates :name, :presence => true
12
12
  validates :token, :presence => true
13
13
 
14
- attr_accessible :name, :token, :organization_id
15
-
16
14
  scoped_search :on => :name, :complete_value => true
17
15
  end
18
16
  end
@@ -13,8 +13,8 @@ module ForemanPipeline
13
13
  belongs_to :jenkins_instance, :class_name => "ForemanPipeline::JenkinsInstance"
14
14
  belongs_to :environment, :class_name => 'Katello::KTEnvironment'
15
15
 
16
- has_many :job_jenkins_projects, :dependent => :destroy
17
- has_many :jenkins_projects, :through => :job_jenkins_projects, :class_name => 'ForemanPipeline::JenkinsProject'
16
+ has_many :jenkins_projects, :class_name => 'ForemanPipeline::JenkinsProject'
17
+
18
18
  has_many :content_view_repositories, :class_name=> 'Katello::ContentViewRepository',
19
19
  :primary_key => :content_view_id, :foreign_key => :content_view_id
20
20
  has_many :repositories, :through => :content_view_repositories
@@ -24,10 +24,8 @@ module ForemanPipeline
24
24
 
25
25
  validates :name, :presence => true
26
26
  validates :organization, :presence => true
27
- validate :no_composite_view, :check_env_succession
28
27
 
29
- attr_accessible :name, :content_view_id, :hostgroup_id, :organization_id, :compute_resource_id, :jenkins_instance_id,
30
- :environment_id, :manual_trigger, :levelup_trigger, :sync_trigger
28
+ validate :no_composite_view, :env_succession, :compute_resource_on_hg, :compute_profile_on_hg, :hg_with_puppet_env
31
29
 
32
30
  scoped_search :on => :name, :complete_value => true
33
31
  scoped_search :on => :organization_id, :complete_value => true
@@ -84,7 +82,9 @@ module ForemanPipeline
84
82
  end
85
83
 
86
84
  def available_compute_resources
87
- hostgroup.compute_profile.compute_attributes.map(&:compute_resource) rescue []
85
+ return [] unless hostgroup
86
+ ids = ComputeAttribute.where(:compute_profile_id => hostgroup.compute_profile_id).pluck(:compute_resource_id).uniq
87
+ ComputeResource.where(:id => ids)
88
88
  end
89
89
 
90
90
  private
@@ -94,7 +94,7 @@ module ForemanPipeline
94
94
  "Cannot add content view, only non-composites allowed.") if !content_view.nil? && content_view.composite?
95
95
  end
96
96
 
97
- def check_env_succession
97
+ def env_succession
98
98
  if environment && should_be_promoted?
99
99
  to_environments.each do |to_env|
100
100
  unless to_env.prior == environment
@@ -103,5 +103,21 @@ module ForemanPipeline
103
103
  end
104
104
  end
105
105
  end
106
+
107
+ def compute_profile_on_hg
108
+ errors.add(:base,
109
+ "Cannot add Hostgroup without Compute Profile") if hostgroup && hostgroup.compute_profile.nil?
110
+ end
111
+
112
+ def compute_resource_on_hg
113
+ if (hostgroup && compute_resource && !available_compute_resources.include?(compute_resource)) || (!hostgroup && compute_resource)
114
+ errors.add(:base,
115
+ "Cannot add a Compute resource that is not associated with assigned Hostgroup through a Compute profile")
116
+ end
117
+ end
118
+
119
+ def hg_with_puppet_env
120
+ errors.add(:base, "Cannot add Hostgroup without Puppet environment") if hostgroup && !hostgroup.environment
121
+ end
106
122
  end
107
- end
123
+ end
@@ -7,8 +7,6 @@ module ForemanPipeline
7
7
  belongs_to :organization
8
8
  validate :org_membership
9
9
 
10
- attr_accessible :job_id, :environment_id, :organization_id
11
-
12
10
  private
13
11
 
14
12
  def org_membership
@@ -0,0 +1,34 @@
1
+ module ForemanPipeline
2
+ class JobFilter
3
+
4
+ def allow_run_for?(job)
5
+ allowed?(job) && job.target_cv_version_avail?
6
+ end
7
+
8
+ def allowed?(job)
9
+ job.is_valid? && job.not_yet_promoted?
10
+ end
11
+
12
+ def allowed_jobs_for_repo(repo)
13
+ jobs = ForemanPipeline::Job.where(:content_view_id => repo.content_view_ids)
14
+ jobs.select { |job| allow_run_for?(job) && job.sync_trigger }
15
+ end
16
+
17
+ def allowed_jobs_for_cvv(version)
18
+ jobs = ForemanPipeline::Job.where(:content_view_id => version.content_view_id)
19
+ jobs.select do |job|
20
+ allowed?(job) &&
21
+ job.levelup_trigger &&
22
+ version == job.target_cv_version
23
+ end
24
+ end
25
+
26
+ def allowed_jobs_for_cv(content_view)
27
+ content_view.jobs.select do |job|
28
+ allowed?(job) &&
29
+ job.environment.library? &&
30
+ job.levelup_trigger
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,10 +1,10 @@
1
- echo "running jenkins_pubkey snippet"
1
+ echo "running pipeline_jenkins_pubkey snippet"
2
2
  mkdir -p /root/.ssh
3
3
  touch /root/.ssh/authorized_keys || exit
4
- echo "<%= @host.params['foreman_pipeline_jenkins_pubkey']%>" >> /root/.ssh/authorized_keys
4
+ echo "<%= @host.params['pipeline_jenkins_pubkey']%>" >> /root/.ssh/authorized_keys
5
5
 
6
6
  <% if @host.operatingsystem.name.match(/centos/i) -%>
7
7
  restorecon -R -v /root/.ssh
8
8
  <% end -%>
9
9
 
10
- echo "jenkins_pubkey snippet done"
10
+ echo "pipeline_jenkins_pubkey snippet done"
@@ -1,6 +1,6 @@
1
1
  object @resource
2
2
 
3
- attributes :id, :name, :url, :organization_id, :server_version, :jenkins_home, :cert_path
3
+ attributes :id, :name, :url, :organization_id, :server_version, :jenkins_home, :cert_path, :timeout
4
4
 
5
5
  child :jenkins_user => :jenkins_user do
6
6
  extends "foreman_pipeline/api/jenkins_users/show"
@@ -5,12 +5,8 @@ class ActionDispatch::Routing::Mapper
5
5
  end
6
6
 
7
7
  ForemanPipeline::Engine.routes.draw do
8
-
9
-
10
8
  scope :foreman_pipeline, :path => '/foreman_pipeline' do
11
-
12
9
  namespace :api do
13
-
14
10
  api_resources :organizations, :only => [] do
15
11
  api_resources :jobs do
16
12
  member do
@@ -37,16 +33,15 @@ ForemanPipeline::Engine.routes.draw do
37
33
 
38
34
  api_resources :jenkins_projects, :only => [:show, :update]
39
35
 
36
+ api_resources :jenkins_project_params, :only => [:update]
37
+
40
38
  api_resources :jenkins_requests, :only => [] do
41
39
  collection do
42
40
  get :list
43
41
  end
44
42
  end
45
43
 
46
- api_resources :jenkins_project_params, :only => [:update]
47
-
48
44
  api_resources :jenkins_users, :only => [:index, :create, :destroy, :show, :update]
49
-
50
45
  end
51
46
  end
52
47
  end
@@ -1,6 +1,6 @@
1
1
  class AddJenkinsHomeToJenkinsInstanceTable < ActiveRecord::Migration
2
2
  def up
3
- add_column :integration_jenkins_instances, :jenkins_home, :string, :null => false, :default => ""
3
+ add_column :integration_jenkins_instances, :jenkins_home, :string, :null => false, :default => "", :limit => 255
4
4
  end
5
5
 
6
6
  def down
@@ -1,6 +1,6 @@
1
1
  class AddCertPathToJenkinsInstances < ActiveRecord::Migration
2
2
  def up
3
- add_column :integration_jenkins_instances, :cert_path, :string, :null => false, :default => "~/.ssh/id_rsa"
3
+ add_column :integration_jenkins_instances, :cert_path, :string, :null => false, :default => "~/.ssh/id_rsa", :limit => 255
4
4
  end
5
5
 
6
6
  def down
@@ -1,6 +1,6 @@
1
1
  class ChangeJenkinsInstanceCertPathColumn < ActiveRecord::Migration
2
2
  def up
3
- change_column :integration_jenkins_instances, :cert_path, :string, :default => ""
3
+ change_column :integration_jenkins_instances, :cert_path, :string, :default => "", :limit => 255
4
4
  end
5
5
 
6
6
  def down
@@ -3,13 +3,13 @@ class CreateJenkinsProjectsTable < ActiveRecord::Migration
3
3
  create_table "integration_jenkins_projects" do |t|
4
4
  t.string "name", :null => false
5
5
  end
6
-
6
+
7
7
  create_table "integration_job_jenkins_projects" do |t|
8
- t.integer "job_id"
9
- t.integer "jenkins_project_id"
8
+ t.integer "job_id"
9
+ t.integer "jenkins_project_id"
10
10
  t.datetime "created_at", :null => false
11
11
  t.datetime "updated_at", :null => false
12
- end
12
+ end
13
13
  end
14
14
 
15
15
  def down
@@ -0,0 +1,9 @@
1
+ class UpdateProjectsTable < ActiveRecord::Migration
2
+ def up
3
+ add_column :foreman_pipeline_jenkins_projects, :job_jenkins_project_id, :integer
4
+ end
5
+
6
+ def down
7
+ remove_column :foreman_pipeline_jenkins_projects, :job_jenkins_project_id
8
+ end
9
+ end
@@ -0,0 +1,30 @@
1
+ class DropJobJenkinsProject < ActiveRecord::Migration
2
+ def up
3
+ jjps = execute("SELECT * FROM foreman_pipeline_job_jenkins_projects;")
4
+ add_column :foreman_pipeline_jenkins_projects, :job_id, :integer
5
+ jjps.each do |jjp|
6
+ project = ForemanPipeline::JenkinsProject.find(jjp['jenkins_project_id'])
7
+ project.job_id = jjp['job_id']
8
+ project.save!
9
+ end
10
+ remove_column :foreman_pipeline_jenkins_projects, :job_jenkins_project_id
11
+ drop_table :foreman_pipeline_job_jenkins_projects
12
+ end
13
+
14
+ def down
15
+ create_table :foreman_pipeline_job_jenkins_projects do |t|
16
+ t.integer :job_id
17
+ t.integer :jenkins_project_id
18
+ t.datetime :created_at, :null => false
19
+ t.datetime :updated_at, :null => false
20
+ end
21
+
22
+ add_column :foreman_pipeline_jenkins_projects, :job_jenkins_project_id, :integer
23
+ projects = execute("SELECT * FROM foreman_pipeline_jenkins_projects;")
24
+ projects.each do |project|
25
+ execute("INSERT INTO foreman_pipeline_job_jenkins_projects (job_id, jenkins_project_id, created_at, updated_at) VALUES (#{project['job_id']},#{project['id']},'#{Time.now}','#{Time.now}')")
26
+ end
27
+
28
+ remove_column :foreman_pipeline_jenkins_projects, :job_id
29
+ end
30
+ end
@@ -0,0 +1,9 @@
1
+ class AddTimeoutToJenkinsInstance < ActiveRecord::Migration
2
+ def up
3
+ add_column :foreman_pipeline_jenkins_instances, :timeout, :integer, :default => 60
4
+ end
5
+
6
+ def down
7
+ remove_column :foreman_pipeline_jenkins_instances, :timeout
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ loc = Location.find_or_create_by(:name => "foreman_pipeline")
2
+ loc.organizations = Organization.all
3
+ loc.environments = Environment.all
4
+ loc.domains = Domain.all
5
+ loc.media = Medium.all
6
+ loc.subnets = Subnet.all
7
+ loc.compute_resources = ComputeResource.all
8
+ loc.smart_proxies = SmartProxy.all
9
+ loc.save!
@@ -0,0 +1,11 @@
1
+ defaults = { :default => true, :locked => false }
2
+
3
+ ProvisioningTemplate.without_auditing do
4
+ [
5
+ { :name => "pipeline_jenkins_pubkey", :source => "snippets/_jenkins_instance_pubkey.erb", :snippet => true }
6
+ ].each do |template|
7
+ next if ProvisioningTemplate.find_by_name(template[:name]).present?
8
+ template[:template] = File.read(File.join(ForemanPipeline::Engine.root, "app/views/foreman/unattended", template.delete(:source)))
9
+ ProvisioningTemplate.create(defaults.merge(template))
10
+ end
11
+ end
@@ -81,8 +81,7 @@ module ForemanPipeline
81
81
 
82
82
 
83
83
  rake_tasks do
84
- load "#{ForemanPipeline::Engine.root}/lib/foreman_pipeline/tasks/foreman_pipeline_seed.rake"
85
- load "#{ForemanPipeline::Engine.root}/lib/foreman_pipeline/tasks/foreman_pipeline_test.rake"
84
+ load "#{ForemanPipeline::Engine.root}/lib/foreman_pipeline/tasks/test.rake"
86
85
  end
87
86
 
88
87
  end
@@ -1,5 +1,5 @@
1
1
  Foreman::Plugin.register :foreman_pipeline do
2
- requires_foreman '>= 1.11'
2
+ requires_foreman '>= 1.13'
3
3
 
4
4
  sub_menu :top_menu, :foreman_pipeline_menu, :caption => N_('Pipeline') do
5
5
  menu :top_menu,
@@ -2,12 +2,12 @@ require 'foreman_pipeline/plugin'
2
2
 
3
3
  viewer_permissions = [:view_jobs, :view_jenkins_instances, :view_jenkins_users,
4
4
  :view_jenkins_projects, :view_jenkins_requests]
5
- manager_permissions = [:view_jobs, :edit_jobs, :destroy_jobs, :create_jobs,
5
+ manager_permissions = [:view_jobs, :edit_jobs, :destroy_jobs, :create_jobs,
6
6
  :view_jenkins_instances, :edit_jenkins_instances, :destroy_jenkins_instances, :create_jenkins_instances,
7
7
  :view_jenkins_users, :edit_jenkins_users, :destroy_jenkins_users, :create_jenkins_users,
8
8
  :view_jenkins_projects,
9
- :edit_jenkins_project_params,
9
+ :edit_jenkins_project_params,
10
10
  :view_jenkins_requests]
11
11
 
12
12
  Foreman::Plugin.find(:foreman_pipeline).send :role, "Pipeline viewer", viewer_permissions
13
- Foreman::Plugin.find(:foreman_pipeline).send :role, "Pipeline manager", manager_permissions
13
+ Foreman::Plugin.find(:foreman_pipeline).send :role, "Pipeline manager", manager_permissions
@@ -1,11 +1,13 @@
1
1
  require 'foreman_pipeline/plugin'
2
2
 
3
- #skipping Bastion routes as they have no permissions
3
+ # skipping Bastion routes as they have no permissions
4
4
  tests_to_skip = {
5
5
  "AccessPermissionsTest" => ["route bastion/bastion/index should have a permission that grants access",
6
6
  "route bastion/bastion/index_ie should have a permission that grants access",
7
- "route katello/api/v2/host_packages/auto_complete_search should have a permission that grants access"],
8
- #skipping seeds tests because katello adds its settings and we get 'unexpected invocation' for mock object
7
+ "route katello/api/v2/host_packages/auto_complete_search should have a permission that grants access",
8
+ "route katello/api/v2/host_subscriptions/create should have a permission that grants access",
9
+ "route katello/api/v2/host_subscriptions/destroy should have a permission that grants access"],
10
+ # skipping seeds tests because katello adds its settings and we get 'unexpected invocation' for mock object
9
11
  "SeedsTest" => ["all access permissions are created by permissions seed",
10
12
  "doesn't add a template back that was deleted",
11
13
  "doesn't add a template back that was renamed",
@@ -29,9 +31,9 @@ tests_to_skip = {
29
31
  "used_and_selected_or_inherited_ids for inherited location"],
30
32
  "OrganizationTest" => ["name can be the same if parent is different",
31
33
  ".my_organizations returns user's associated orgs and children"],
32
- #parent_id for organization is disabled by default
34
+ # parent_id for organization is disabled by default
33
35
  "TaxonomixTest" => [".used_organization_ids can work with array of organizations"],
34
- #bunch of broken tests, various causes
36
+ # bunch of broken tests, various causes
35
37
  "UserTest" => ["when a user logs in, last login time should be updated",
36
38
  "return organization and child ids for non-admin user",
37
39
  "#ensure_last_admin_is_not_deleted with non-admins",
@@ -73,7 +75,21 @@ tests_to_skip = {
73
75
  "should delete null organization",
74
76
  "should clear the session if the user deleted their current organization",
75
77
  "should clone organization with assocations"],
76
- "UnattendedControllerTest" => ["template with hostgroup should be identified as hostgroup provisioning"]
78
+ "UnattendedControllerTest" => ["template with hostgroup should be identified as hostgroup provisioning"],
79
+
80
+ # core compute resoure fixtures do not care about plugins
81
+ "ComputeResourceTest" => ["ensure compute resource with associated profile can get destroyed"],
82
+
83
+ # katello uses keyword args, not compatible with 1.9.3
84
+ "AboutControllerTest" => ["test_index", "test_registered_providers_list"],
85
+ # docker related
86
+ "ContainerStepsTest" => ["shows a link to a new compute resource if none is available",
87
+ "shows taxonomies tabs"],
88
+
89
+ "OrganizationsControllerTest::wizard" => ["redirects to step 3 if no unassigned hosts exist",
90
+ "redirects to step 2 if unassigned hosts exist",
91
+ "redirects to step 3 if no permissins for hosts"],
92
+ "Api::V2::ContainersControllerTest::container operations" => ["creates a container with correct params"]
77
93
  }
78
94
 
79
95
  Foreman::Plugin.find(:foreman_pipeline).send :tests_to_skip, tests_to_skip
@@ -1,11 +1,12 @@
1
1
  require File.expand_path("../engine", File.dirname(__FILE__))
2
2
 
3
3
  namespace :test do
4
-
4
+ desc "Run plugin test suite"
5
5
  task :foreman_pipeline => ['db:test:prepare'] do
6
6
  test_task = Rake::TestTask.new('foreman_pipeline_test_task') do |t|
7
7
  t.libs << ["test", "#{ForemanPipeline::Engine.root}/test"]
8
8
  t.test_files = ["#{ForemanPipeline::Engine.root}/test/**/*_test.rb"]
9
+ t.warning = false
9
10
  t.verbose = true
10
11
  end
11
12
  Rake::Task[test_task.name].invoke
@@ -21,4 +22,4 @@ if Rake::Task.task_defined?(:'jenkins:unit')
21
22
  Rake::Task["jenkins:unit"].enhance do
22
23
  Rake::Task['test:foreman_pipeline'].invoke
23
24
  end
24
- end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanPipeline
2
- VERSION = "0.0.11"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,8 @@
1
+ one:
2
+ name: "jenkins.example.com"
3
+ url: "http://jenkins.example.com:3000"
4
+ organization_id: <%= ActiveRecord::FixtureSet.identify(:empty_organization) %>
5
+ pubkey: "sha-rsa 3gsdf5gsdf4g== jenkins@jenkins.example.com"
6
+ jenkins_home: "/var/lib/jenkins"
7
+ cert_path: "/tmp/my_certs"
8
+ jenkins_user_id: <%= ActiveRecord::FixtureSet.identify(:jenkins_user_one) %>
@@ -0,0 +1,9 @@
1
+ first:
2
+ name: "first jenkins project"
3
+ organization_id: <%= ActiveRecord::FixtureSet.identify(:empty_organization) %>
4
+ job_id: <%= ActiveRecord::FixtureSet.identify(:valid)%>
5
+
6
+ second:
7
+ name: "second jenkins project"
8
+ organization_id: <%= ActiveRecord::FixtureSet.identify(:empty_organization) %>
9
+ job_id: <%= ActiveRecord::FixtureSet.identify(:valid)%>
@@ -0,0 +1,4 @@
1
+ jenkins_user_one:
2
+ name: "Jenkins user"
3
+ token: "53asd74f6g6sd36gdsfg37d7fg3"
4
+ organization_id: <%= ActiveRecord::FixtureSet.identify(:empty_organization) %>