Commit dda935046a73574e66cdedb1a9a2db6dba713e2c
1 parent
959b51a1
Exists in
master
and in
27 other branches
Improve plugin test runs
- process plugins in alphabeticall order, so when watching the console output, one can know at which point of the execution we are. - run all tests of a given type (unit, functional etc) for a single plugin together. On my machine this brings the total run time from ~34min down to ~20min.
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
lib/tasks/plugins_tests.rake
1 | 1 | @all_plugins = Dir.glob('plugins/*').map { |f| File.basename(f) } - ['template'] |
2 | +@all_plugins.sort! | |
2 | 3 | @all_tasks = [:units, :functionals, :integration, :cucumber, :selenium] |
3 | 4 | |
4 | 5 | def enabled_plugins |
... | ... | @@ -110,7 +111,7 @@ def run_cucumber(profile, files) |
110 | 111 | sh 'xvfb-run', 'ruby', '-S', 'cucumber', '--profile', profile.to_s, '--format', ENV['CUCUMBER_FORMAT'] || 'progress' , *files |
111 | 112 | end |
112 | 113 | |
113 | -def custom_run(name, files, run=:individually) | |
114 | +def custom_run(name, files, run=:all) | |
114 | 115 | case run |
115 | 116 | when :all |
116 | 117 | run_test name, files |
... | ... | @@ -122,7 +123,7 @@ def custom_run(name, files, run=:individually) |
122 | 123 | end |
123 | 124 | end |
124 | 125 | |
125 | -def run_tests(name, plugins, run=:individually) | |
126 | +def run_tests(name, plugins, run=:all) | |
126 | 127 | plugins = Array(plugins) |
127 | 128 | glob = "plugins/{#{plugins.join(',')}}/test/#{task2folder(name)}/**/*.#{task2ext(name)}" |
128 | 129 | files = Dir.glob(glob) |
... | ... | @@ -169,7 +170,7 @@ def test_sequence(plugins, tasks) |
169 | 170 | fail 'There are broken tests to be fixed!' if fail_flag |
170 | 171 | end |
171 | 172 | |
172 | -def plugin_test_task(plugin, task, run=:individually) | |
173 | +def plugin_test_task(plugin, task, run=:all) | |
173 | 174 | desc "Run #{task} tests for #{plugin_name(plugin)}" |
174 | 175 | task task do |
175 | 176 | test_sequence(plugin, task) | ... | ... |