Skip to content

Commit

Permalink
hell enabled #10
Browse files Browse the repository at this point in the history
  • Loading branch information
inertia186 committed Oct 5, 2018
1 parent 4cbb91a commit 10e8ff5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ If you want to point to any node for tests, instead of letting the test suite pi
$ TEST_NODE=https://api.steemitdev.com bundle exec rake test
```

#### Hell Enabled

There is an additional testing environment variables to enable additional lint checks and tighter testing conditions:

`HELL_ENABLED=true bundle exec rake`

The `HELL_ENABLED=true` flag tells the `minitest/hell` gem to generate lint reports and will allow tests to fail if certain conditions are detected. These are useful in finding design problems that manifest during parallelization.

## Contributions

Patches are welcome! Contributors are listed in the `steem-ruby.gemspec` file. Please run the tests (`rake test`) before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list.
Expand Down
2 changes: 1 addition & 1 deletion steem-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|

spec.summary = %q{Steem Ruby Client}
spec.description = %q{Client for accessing the Steem blockchain.}
spec.homepage = 'https://github.com/steem/steem-ruby'
spec.homepage = 'https://github.com/steemit/steem-ruby'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test)/}) }
Expand Down
14 changes: 12 additions & 2 deletions test/steem/broadcast_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1159,14 +1159,24 @@ def test_can_retry
e = NonCanonicalSignatureError.new("test")

refute_nil Broadcast.send(:first_retry_at)
assert Broadcast.send(:can_retry?, e) unless Broadcast.send :retry_reset?

if !!ENV['HELL_ENABLED']
assert Broadcast.send(:can_retry?, e) unless Broadcast.send :retry_reset?
elsif Broadcast.send(:retry_reset?) && !Broadcast.send(:can_retry?, e)
skip 'Cannot retry broadcast.' # just warn
end
end

def test_can_retry_remote_node_error
e = IncorrectResponseIdError.new("test: The json-rpc id did not match")

refute_nil Broadcast.send(:first_retry_at)
assert Broadcast.send(:can_retry?, e) unless Broadcast.send :retry_reset?

if !!ENV['HELL_ENABLED']
assert Broadcast.send(:can_retry?, e) unless Broadcast.send :retry_reset?
elsif Broadcast.send(:retry_reset?) && !Broadcast.send(:can_retry?, e)
skip 'Cannot retry broadcast.' # just warn
end
end
end
end
2 changes: 1 addition & 1 deletion test/steem/database_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_get_hardfork_properties

def test_get_order_book
vcr_cassette('database_api_get_order_book', record: :once) do
@api.get_order_book do |result|
@api.get_order_book(limit: 1) do |result|
assert_equal Hashie::Mash, result.class
end
end
Expand Down
6 changes: 5 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def vcr_cassette(name, options = {match_requests_on: [:method, :uri, :body]}, &b
begin
yield
rescue Steem::BaseError => e
skip "Probably just a node acting up: #{e}"
if !!ENV['HELL_ENABLED']
raise e
else
skip "Probably just a node acting up: #{e}"
end
rescue Psych::SyntaxError => e
skip 'This happens when we try to get fancy and disable thread-safety.'
end
Expand Down

0 comments on commit 10e8ff5

Please sign in to comment.