Commit 76d19d4c434b76d59922c3e0f9d312a90846710c
Exists in
master
and in
27 other branches
Merge remote-tracking branch 'origin/master'
Showing
2 changed files
with
40 additions
and
25 deletions
Show diff stats
features/signup.feature
| ... | ... | @@ -278,29 +278,6 @@ Feature: signup |
| 278 | 278 | Then "José da Silva" should be a member of "Free Software" |
| 279 | 279 | |
| 280 | 280 | @selenium |
| 281 | - Scenario: join community on direct signup | |
| 282 | - Given the following users | |
| 283 | - | login | name | | |
| 284 | - | mariasilva | Maria Silva | | |
| 285 | - And the following communities | |
| 286 | - | name | identifier | owner | | |
| 287 | - | Free Software | freesoftware | mariasilva | | |
| 288 | - And feature "skip_new_user_email_confirmation" is enabled on environment | |
| 289 | - And I am on /freesoftware | |
| 290 | - When I follow "Join" | |
| 291 | - And I follow "New user" | |
| 292 | - And I fill in the following within ".no-boxes": | |
| 293 | - | e-Mail | josesilva@example.com | | |
| 294 | - | Username | josesilva | | |
| 295 | - | Password | secret | | |
| 296 | - | Password confirmation | secret | | |
| 297 | - | Full name | José da Silva | | |
| 298 | - And wait for the captcha signup time | |
| 299 | - And I press "Create my account" | |
| 300 | - Then I should see "Control panel" | |
| 301 | - And "José da Silva" should be a member of "Free Software" | |
| 302 | - | |
| 303 | - @selenium | |
| 304 | 281 | Scenario: user registration is moderated by admin |
| 305 | 282 | Given feature "admin_must_approve_new_users" is enabled on environment |
| 306 | 283 | And feature "skip_new_user_email_confirmation" is disabled on environment | ... | ... |
lib/tasks/plugins_tests.rake
| 1 | +@broken_plugins = %w[ | |
| 2 | + anti_spam | |
| 3 | + bsc | |
| 4 | + comment_classification | |
| 5 | + ldap | |
| 6 | + send_email | |
| 7 | + shopping_cart | |
| 8 | + solr | |
| 9 | + tolerance_time | |
| 10 | +] | |
| 11 | + | |
| 1 | 12 | @all_plugins = Dir.glob('plugins/*').map { |f| File.basename(f) } - ['template'] |
| 2 | 13 | @all_plugins.sort! |
| 3 | 14 | @all_tasks = [:units, :functionals, :integration, :cucumber, :selenium] |
| ... | ... | @@ -167,6 +178,7 @@ def test_sequence(plugins, tasks) |
| 167 | 178 | end |
| 168 | 179 | end |
| 169 | 180 | rollback_plugins_state |
| 181 | + yield(failed) if block_given? | |
| 170 | 182 | fail 'There are broken tests to be fixed!' if fail_flag |
| 171 | 183 | end |
| 172 | 184 | |
| ... | ... | @@ -195,13 +207,39 @@ namespace :test do |
| 195 | 207 | @all_tasks.each do |taskname| |
| 196 | 208 | desc "Run #{taskname} tests for all plugins" |
| 197 | 209 | task taskname do |
| 198 | - test_sequence(@all_plugins, taskname) | |
| 210 | + test_sequence(@all_plugins - @broken_plugins, taskname) | |
| 199 | 211 | end |
| 200 | 212 | end |
| 201 | 213 | end |
| 202 | 214 | |
| 203 | 215 | desc "Run all tests for all plugins" |
| 204 | 216 | task :noosfero_plugins do |
| 205 | - test_sequence(@all_plugins, @all_tasks) | |
| 217 | + test_sequence(@all_plugins - @broken_plugins, @all_tasks) do |failed| | |
| 218 | + plugins_status_report(failed) | |
| 219 | + end | |
| 206 | 220 | end |
| 207 | 221 | end |
| 222 | + | |
| 223 | +def plugins_status_report(failed) | |
| 224 | + w = @all_plugins.map { |s| s.size }.max | |
| 225 | + | |
| 226 | + puts | |
| 227 | + printf ('=' * (w + 21)) + "\n" | |
| 228 | + puts 'Plugins status report' | |
| 229 | + printf ('=' * (w + 21)) + "\n" | |
| 230 | + printf "%-#{w}s %s\n", "Plugin", "Status" | |
| 231 | + printf ('-' * w) + ' ' + ('-' * 20) + "\n" | |
| 232 | + | |
| 233 | + @all_plugins.each do |plugin| | |
| 234 | + if @broken_plugins.include?(plugin) | |
| 235 | + status = "SKIP" | |
| 236 | + elsif !failed[plugin] || failed[plugin].empty? | |
| 237 | + status = "PASS" | |
| 238 | + else | |
| 239 | + status = "FAIL: #{failed[plugin].join(', ')}" | |
| 240 | + end | |
| 241 | + printf "%-#{w}s %s\n", plugin, status | |
| 242 | + end | |
| 243 | + printf ('=' * (w + 21)) + "\n" | |
| 244 | + puts | |
| 245 | +end | ... | ... |