Merge pull request #678 from poanetwork/fix-circle-test-reporting

Fix circle test reporting
pull/682/head
John Stamates 6 years ago committed by GitHub
commit 1ddb84ac51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      .circleci/config.yml
  2. 2
      apps/block_scout_web/test/block_scout_web/controllers/address_controller_test.exs
  3. 8
      apps/block_scout_web/test/block_scout_web/controllers/address_token_balance_controller_test.exs
  4. 3
      apps/block_scout_web/test/block_scout_web/controllers/smart_contract_controller_test.exs
  5. 2
      apps/block_scout_web/test/block_scout_web/features/pages/address_contract_page.ex
  6. 2
      apps/block_scout_web/test/block_scout_web/features/pages/contract_verify_page.ex
  7. 2
      apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs
  8. 19
      apps/ethereum_jsonrpc/test/ethereum_jsonrpc/receipt_test.exs
  9. 11
      apps/explorer/test/support/factory.ex
  10. 8
      apps/indexer/test/indexer/block_fetcher/realtime_test.exs

@ -338,8 +338,8 @@ jobs:
mix coveralls.html --exclude no_geth --parallel --umbrella mix coveralls.html --exclude no_geth --parallel --umbrella
else else
mix coveralls.circle --exclude no_geth --parallel --umbrella || mix coveralls.circle --exclude no_geth --parallel --umbrella ||
# if mix failed, then coveralls_merge won't run, so single done here # if mix failed, then coveralls_merge won't run, so signal done here and return original exit status
curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && return $retval)
fi fi
- store_artifacts: - store_artifacts:
@ -388,8 +388,8 @@ jobs:
mix coveralls.html --exclude no_geth --parallel --umbrella mix coveralls.html --exclude no_geth --parallel --umbrella
else else
mix coveralls.circle --exclude no_geth --parallel --umbrella || mix coveralls.circle --exclude no_geth --parallel --umbrella ||
# if mix failed, then coveralls_merge won't run, so signal done here # if mix failed, then coveralls_merge won't run, so signal done here and return original exit status
curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && return $retval)
fi fi
- store_artifacts: - store_artifacts:
@ -438,8 +438,8 @@ jobs:
mix coveralls.html --exclude no_parity --parallel --umbrella mix coveralls.html --exclude no_parity --parallel --umbrella
else else
mix coveralls.circle --exclude no_parity --parallel --umbrella || mix coveralls.circle --exclude no_parity --parallel --umbrella ||
# if mix failed, then coveralls_merge won't run, so signal done here # if mix failed, then coveralls_merge won't run, so signal done here and return original exit status
curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && return $retval)
fi fi
- store_artifacts: - store_artifacts:
@ -488,8 +488,8 @@ jobs:
mix coveralls.html --exclude no_parity --parallel --umbrella mix coveralls.html --exclude no_parity --parallel --umbrella
else else
mix coveralls.circle --exclude no_parity --parallel --umbrella || mix coveralls.circle --exclude no_parity --parallel --umbrella ||
# if mix failed, then coveralls_merge won't run, so single done here # if mix failed, then coveralls_merge won't run, so signal done here and return original exit status
curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && return $retval)
fi fi
- store_artifacts: - store_artifacts:

@ -7,7 +7,7 @@ defmodule BlockScoutWeb.AddressControllerTest do
conn = get(conn, "/address/0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed") conn = get(conn, "/address/0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed")
assert redirected_to(conn) =~ "/en/address/0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed/transactions" assert redirected_to(conn) =~ "/address/0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed/transactions"
end end
end end
end end

@ -8,7 +8,7 @@ defmodule BlockScoutWeb.AddressTokenBalanceControllerTest do
test "without AJAX", %{conn: conn} do test "without AJAX", %{conn: conn} do
%Address{hash: hash} = Factory.insert(:address) %Address{hash: hash} = Factory.insert(:address)
response_conn = get(conn, address_token_balance_path(conn, :index, :en, to_string(hash))) response_conn = get(conn, address_token_balance_path(conn, :index, to_string(hash)))
assert html_response(response_conn, 404) assert html_response(response_conn, 404)
end end
@ -16,7 +16,7 @@ defmodule BlockScoutWeb.AddressTokenBalanceControllerTest do
test "with AJAX without valid address", %{conn: conn} do test "with AJAX without valid address", %{conn: conn} do
ajax_conn = ajax(conn) ajax_conn = ajax(conn)
response_conn = get(ajax_conn, address_token_balance_path(ajax_conn, :index, :en, "invalid_address")) response_conn = get(ajax_conn, address_token_balance_path(ajax_conn, :index, "invalid_address"))
assert html_response(response_conn, 404) assert html_response(response_conn, 404)
end end
@ -24,7 +24,7 @@ defmodule BlockScoutWeb.AddressTokenBalanceControllerTest do
test "with AJAX with valid address without address still returns token balances", %{conn: conn} do test "with AJAX with valid address without address still returns token balances", %{conn: conn} do
ajax_conn = ajax(conn) ajax_conn = ajax(conn)
response_conn = get(ajax_conn, address_token_balance_path(ajax_conn, :index, :en, Factory.address_hash())) response_conn = get(ajax_conn, address_token_balance_path(ajax_conn, :index, Factory.address_hash()))
assert html_response(response_conn, 200) assert html_response(response_conn, 200)
end end
@ -34,7 +34,7 @@ defmodule BlockScoutWeb.AddressTokenBalanceControllerTest do
ajax_conn = ajax(conn) ajax_conn = ajax(conn)
response_conn = get(ajax_conn, address_token_balance_path(ajax_conn, :index, :en, hash)) response_conn = get(ajax_conn, address_token_balance_path(ajax_conn, :index, hash))
assert html_response(response_conn, 200) assert html_response(response_conn, 200)
end end

@ -7,7 +7,7 @@ defmodule BlockScoutWeb.SmartContractControllerTest do
describe "GET index/3" do describe "GET index/3" do
test "error for invalid address", %{conn: conn} do test "error for invalid address", %{conn: conn} do
path = smart_contract_path(BlockScoutWeb.Endpoint, :index, :en, hash: "0x00") path = smart_contract_path(BlockScoutWeb.Endpoint, :index, hash: "0x00")
conn = get(conn, path) conn = get(conn, path)
@ -49,7 +49,6 @@ defmodule BlockScoutWeb.SmartContractControllerTest do
smart_contract_path( smart_contract_path(
BlockScoutWeb.Endpoint, BlockScoutWeb.Endpoint,
:show, :show,
:en,
"0x00", "0x00",
function_name: "get", function_name: "get",
args: [] args: []

@ -18,6 +18,6 @@ defmodule BlockScoutWeb.AddressContractPage do
end end
defp address_contract_path(address) do defp address_contract_path(address) do
"/en/address/#{address.hash}/contracts" "/address/#{address.hash}/contracts"
end end
end end

@ -6,7 +6,7 @@ defmodule BlockScoutWeb.ContractVerifyPage do
import Wallaby.Query import Wallaby.Query
def visit_page(session, address_hash) do def visit_page(session, address_hash) do
visit(session, "/en/address/#{address_hash}/contract_verifications/new") visit(session, "/address/#{address_hash}/contract_verifications/new")
end end
def fill_form(session, %{ def fill_form(session, %{

@ -17,7 +17,7 @@ defmodule BlockScoutWeb.TransactionViewTest do
gas_used: nil gas_used: nil
) )
expected_value = "max of 0.009 POA" expected_value = "Max of 0.009 POA"
assert expected_value == TransactionView.formatted_fee(transaction, denomination: :ether) assert expected_value == TransactionView.formatted_fee(transaction, denomination: :ether)
end end

@ -6,25 +6,6 @@ defmodule EthereumJSONRPC.ReceiptTest do
doctest Receipt doctest Receipt
describe "to_elixir/1" do describe "to_elixir/1" do
test "with status with nil raises ArgumentError with full receipt" do
assert_raise ArgumentError,
"""
Could not convert receipt to elixir
Receipt:
%{"status" => nil, "transactionHash" => "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"}
Errors:
{:unknown_value, %{key: "status", value: nil}}
""",
fn ->
Receipt.to_elixir(%{
"status" => nil,
"transactionHash" => "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"
})
end
end
test "with new key raise ArgumentError with full receipt" do test "with new key raise ArgumentError with full receipt" do
assert_raise ArgumentError, assert_raise ArgumentError,
""" """

@ -262,6 +262,17 @@ defmodule Explorer.Factory do
} }
end end
def internal_transaction_suicide_factory() do
%InternalTransaction{
from_address: build(:address),
trace_address: [],
# caller MUST supply `transaction` because it can't be built lazily to allow overrides without creating an extra
# transaction
type: :suicide,
value: sequence("internal_transaction_value", &Decimal.new(&1))
}
end
def log_factory do def log_factory do
%Log{ %Log{
address: build(:address), address: build(:address),

@ -52,13 +52,13 @@ defmodule Indexer.BlockFetcher.RealtimeTest do
EthereumJSONRPC.Mox EthereumJSONRPC.Mox
|> expect(:json_rpc, fn [ |> expect(:json_rpc, fn [
%{ %{
id: 3_946_079, id: 0,
jsonrpc: "2.0", jsonrpc: "2.0",
method: "eth_getBlockByNumber", method: "eth_getBlockByNumber",
params: ["0x3C365F", true] params: ["0x3C365F", true]
}, },
%{ %{
id: 3_946_080, id: 1,
jsonrpc: "2.0", jsonrpc: "2.0",
method: "eth_getBlockByNumber", method: "eth_getBlockByNumber",
params: ["0x3C3660", true] params: ["0x3C3660", true]
@ -68,7 +68,7 @@ defmodule Indexer.BlockFetcher.RealtimeTest do
{:ok, {:ok,
[ [
%{ %{
id: 3_946_079, id: 0,
jsonrpc: "2.0", jsonrpc: "2.0",
result: %{ result: %{
"author" => "0x5ee341ac44d344ade1ca3a771c59b98eb2a77df2", "author" => "0x5ee341ac44d344ade1ca3a771c59b98eb2a77df2",
@ -127,7 +127,7 @@ defmodule Indexer.BlockFetcher.RealtimeTest do
} }
}, },
%{ %{
id: 3_946_080, id: 1,
jsonrpc: "2.0", jsonrpc: "2.0",
result: %{ result: %{
"author" => "0x66c9343c7e8ca673a1fedf9dbf2cd7936dbbf7e3", "author" => "0x66c9343c7e8ca673a1fedf9dbf2cd7936dbbf7e3",

Loading…
Cancel
Save