jasmine-sauce 0.2.0.alpha2 → 0.2.0.alpha3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/sauce/jasmine/runner.rb +14 -20
- data/lib/sauce/jasmine/selenium_driver.rb +4 -0
- metadata +4 -4
    
        data/lib/sauce/jasmine/runner.rb
    CHANGED
    
    | @@ -35,10 +35,10 @@ module Sauce | |
| 35 35 | 
             
                      browser_string = browser_spec.join('/')
         | 
| 36 36 | 
             
                      Thread.new do
         | 
| 37 37 | 
             
                        begin
         | 
| 38 | 
            -
                          result = run_tests_in_browser(*browser_spec)
         | 
| 38 | 
            +
                          result, job_id = run_tests_in_browser(*browser_spec)
         | 
| 39 39 | 
             
                          puts "Suite finished on #{browser_string}"
         | 
| 40 40 | 
             
                          Thread.exclusive do
         | 
| 41 | 
            -
                            results[browser_string]  | 
| 41 | 
            +
                            results[browser_string] = result, job_id
         | 
| 42 42 | 
             
                          end
         | 
| 43 43 | 
             
                        rescue => e
         | 
| 44 44 | 
             
                          results[browser_string] = e
         | 
| @@ -47,24 +47,17 @@ module Sauce | |
| 47 47 | 
             
                    end
         | 
| 48 48 | 
             
                    threads.each(&:join)
         | 
| 49 49 |  | 
| 50 | 
            -
                     | 
| 51 | 
            -
                      if  | 
| 52 | 
            -
                         | 
| 53 | 
            -
             | 
| 54 | 
            -
                         | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
                       | 
| 59 | 
            -
             | 
| 60 | 
            -
                      puts "Failure:"
         | 
| 61 | 
            -
                      results.each do |browser_string, result|
         | 
| 62 | 
            -
                        puts "#{browser_string}:"
         | 
| 63 | 
            -
                        p result
         | 
| 64 | 
            -
                        puts
         | 
| 65 | 
            -
                        puts
         | 
| 50 | 
            +
                    results.each do |browser_string, result|
         | 
| 51 | 
            +
                      if result.respond_to? :[]
         | 
| 52 | 
            +
                        actual_result, job_id = result
         | 
| 53 | 
            +
                        success = actual_result.values.all? {|suite_result| suite_result['result'] == "passed"}
         | 
| 54 | 
            +
                        if !success
         | 
| 55 | 
            +
                          puts "[FAILURE] Failure on #{browser_string}. See https://saucelabs.com/jobs/#{job_id} for details."
         | 
| 56 | 
            +
                          at_exit { exit!(1) }
         | 
| 57 | 
            +
                        end
         | 
| 58 | 
            +
                      else
         | 
| 59 | 
            +
                        raise result
         | 
| 66 60 | 
             
                      end
         | 
| 67 | 
            -
                      at_exit { exit!(1) }
         | 
| 68 61 | 
             
                    end
         | 
| 69 62 | 
             
                  end
         | 
| 70 63 |  | 
| @@ -77,6 +70,7 @@ module Sauce | |
| 77 70 | 
             
                  def run_tests_in_browser(os, browser, browser_version)
         | 
| 78 71 | 
             
                    driver = SeleniumDriver.new(os, browser, browser_version, @config.tunnel_domain)
         | 
| 79 72 | 
             
                    driver.connect
         | 
| 73 | 
            +
                    job_id = driver.job_id
         | 
| 80 74 | 
             
                    begin
         | 
| 81 75 | 
             
                      while !driver.tests_have_finished?
         | 
| 82 76 | 
             
                        sleep 1.0
         | 
| @@ -84,7 +78,7 @@ module Sauce | |
| 84 78 | 
             
                      result = driver.test_results
         | 
| 85 79 | 
             
                    ensure
         | 
| 86 80 | 
             
                      driver.disconnect
         | 
| 87 | 
            -
                      return result
         | 
| 81 | 
            +
                      return result, job_id
         | 
| 88 82 | 
             
                    end
         | 
| 89 83 | 
             
                  end
         | 
| 90 84 | 
             
                end
         | 
| @@ -24,6 +24,10 @@ module Sauce | |
| 24 24 | 
             
                  def test_results
         | 
| 25 25 | 
             
                    eval_js("var result = jsApiReporter.results(); if (window.Prototype && Object.toJSON) { Object.toJSON(result) } else { JSON.stringify(result) }")
         | 
| 26 26 | 
             
                  end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                  def job_id
         | 
| 29 | 
            +
                    @driver.session_id
         | 
| 30 | 
            +
                  end
         | 
| 27 31 | 
             
                end
         | 
| 28 32 | 
             
              end
         | 
| 29 33 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: jasmine-sauce
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash: - | 
| 4 | 
            +
              hash: -3702664326
         | 
| 5 5 | 
             
              prerelease: 6
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 0
         | 
| 8 8 | 
             
              - 2
         | 
| 9 9 | 
             
              - 0
         | 
| 10 10 | 
             
              - alpha
         | 
| 11 | 
            -
              -  | 
| 12 | 
            -
              version: 0.2.0. | 
| 11 | 
            +
              - 3
         | 
| 12 | 
            +
              version: 0.2.0.alpha3
         | 
| 13 13 | 
             
            platform: ruby
         | 
| 14 14 | 
             
            authors: 
         | 
| 15 15 | 
             
            - Eric Allen
         | 
| @@ -17,7 +17,7 @@ autorequire: | |
| 17 17 | 
             
            bindir: bin
         | 
| 18 18 | 
             
            cert_chain: []
         | 
| 19 19 |  | 
| 20 | 
            -
            date: 2011-03- | 
| 20 | 
            +
            date: 2011-03-25 00:00:00 -07:00
         | 
| 21 21 | 
             
            default_executable: 
         | 
| 22 22 | 
             
            dependencies: 
         | 
| 23 23 | 
             
            - !ruby/object:Gem::Dependency 
         |