0001-test-all-parallel-fails-if-a-test-is-skipped-after-r.patch

Hiroshi Shirosaki, 04/22/2014 09:42 AM

Download (3.27 KB)

View differences:

lib/test/unit/parallel.rb
155 155
      end
156 156

  
157 157
      def puke(klass, meth, e) # :nodoc:
158
        if e.is_a?(MiniTest::Skip)
159
          new_e = MiniTest::Skip.new(e.message)
160
          new_e.set_backtrace(e.backtrace)
161
          e = new_e
162
        end
158 163
        @partial_report << [klass.name, meth, e.is_a?(MiniTest::Assertion) ? e : ProxyError.new(e)]
159 164
        super
160 165
      end
test/testunit/test_parallel.rb
90 90
    def test_done
91 91
      timeout(10) do
92 92
        @worker_in.puts "run #{TESTS}/ptest_forth.rb test"
93
        6.times { @worker_out.gets }
93
        7.times { @worker_out.gets }
94 94
        buf = @worker_out.gets
95 95
        assert_match(/^done (.+?)$/, buf)
96 96

  
......
98 98

  
99 99
        result = Marshal.load($1.chomp.unpack("m")[0])
100 100

  
101
        assert_equal(4, result[0])
101
        assert_equal(5, result[0])
102 102
        assert_equal(2, result[1])
103 103
        assert_kind_of(Array,result[2])
104 104
        assert_kind_of(Array,result[3])
......
106 106
        assert_kind_of(Array,result[2][1])
107 107
        assert_kind_of(MiniTest::Assertion,result[2][0][2])
108 108
        assert_kind_of(MiniTest::Skip,result[2][1][2])
109
        assert_kind_of(Exception, result[2][2][2])
109
        assert_kind_of(MiniTest::Skip,result[2][2][2])
110
        assert_kind_of(Exception, result[2][3][2])
110 111
        assert_equal(result[5], "TestE")
111 112
      end
112 113
    end
......
156 157
    def test_should_run_all_without_any_leaks
157 158
      spawn_runner
158 159
      buf = timeout(10){@test_out.read}
159
      assert_match(/^[SFE\.]{8}$/,buf)
160
      assert_match(/^[SFE\.]{9}$/,buf)
160 161
    end
161 162

  
162 163
    def test_should_retry_failed_on_workers
test/testunit/tests_for_parallel/ptest_forth.rb
15 15
    assert_equal(0,1)
16 16
  end
17 17

  
18
  def test_skip_after_unknown_error
19
    begin
20
      raise UnknownError, "unknown error"
21
    rescue
22
      skip "after raise"
23
    end
24
  end
25

  
18 26
  def test_unknown_error
19 27
    raise UnknownError, "unknown error"
20 28
  end
21
-