-
Notifications
You must be signed in to change notification settings - Fork 34
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
Run permissions tests from Foreman core #51
base: master
Are you sure you want to change the base?
Conversation
I wish this list (or at least its base) could come from Foreman and not be hard-coded here. |
How do you know what is and isn't relevant from Foreman core? Today in Jenkins we run the full Foreman test suite, which makes it a lot slower but you'd test for regressions. |
a91eb4d
to
cf5edfa
Compare
I don't think there is a way to "know", but we can offer a "recommended minimum"? |
OpenSCAP has defined a specific task for it: Now one question is: should |
I think a static list is perfectly fine. |
Just a crazy idea: how about some helper in Foreman itself to define the test tasks? Then allow further configuration via a block. |
Crazy? Maybe. IMHO one thing we should consider is time. Is this something we want to have soon or we can live without while we figure out the best implementation? |
t.libs << test_dir | ||
t.pattern = "#{test_dir}/**/*_test.rb" | ||
Rake::TestTask.new(:foreman_plugin_template => 'db:test:prepare') do |t| | ||
t.libs << ForemanPluginTemplate::Engine.root.join('test') |
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.
Before this, libs
was ['test', File.expand_path('../../test', __dir__)]
, now it's only [ForemanPluginTemplate::Engine.root.join('test')]
, doesn't that mean the bare test
one is not added anymore, which means the test helpers from Foreman are not available anymor?
Rake::TestTask.new(:foreman_plugin_template => 'db:test:prepare') do |t| | ||
t.libs << ForemanPluginTemplate::Engine.root.join('test') | ||
t.pattern = ForemanPluginTemplate::Engine.root.join('test', '**', '*_test.rb') | ||
t.test_files = [Rails.root.join('test/unit/foreman/access_permissions_test.rb')] |
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.
IMHO this is the important line of this PR and we should get that merged.
Opened to showcase an alternative to theforeman/actions#16.
The idea is that plugins should always run a certain test from core. This relies on:
It also starts to depend on
db:test:prepare
since I saw that at least inforeman_tasks
.