Skip to content

Commit

Permalink
circleci added
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Jan 23, 2018
1 parent 5a074b4 commit c316d03
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Elixir CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-elixir/ for more details
version: 2
jobs:
build:
docker:
# specify the version here
- image: elixir:1.6

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

working_directory: ~/repo
steps:
- checkout
- run:
name: Install node@7.10.1
command: |
set +e
touch $BASH_ENV
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
echo 'nvm install v7.10.1' >> $BASH_ENV
echo 'nvm alias default 7.10.1' >> $BASH_ENV
- run: node -v
- run: npm install -g testrpc
- run: mix deps.get
- run: mix ecto.create
- run: mix test
11 changes: 1 addition & 10 deletions test/eth/query_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ defmodule ETH.Query.Test do
end

test "syncing/0 works" do
result = ETH.syncing()

assert result |> elem(0) == :ok
assert result |> elem(1) == false
assert ETH.syncing() == {:ok, false}
end

test "syncing!/0 works" do
Expand Down Expand Up @@ -101,8 +98,6 @@ defmodule ETH.Query.Test do
end

test "get_block/1 by number works" do
Process.sleep(2)

target_result = ETH.get_block(2)
target_block = target_result |> elem(1)

Expand Down Expand Up @@ -134,7 +129,6 @@ defmodule ETH.Query.Test do
end

test "get_block/1 by hash works" do
Process.sleep(2)
{:ok, first_block} = ETH.get_block(1)
{:ok, second_block} = ETH.get_block(2)

Expand Down Expand Up @@ -171,8 +165,6 @@ defmodule ETH.Query.Test do
end

test "get_block!/1 by number works" do
Process.sleep(2)

target_block = ETH.get_block!(2)

assert target_block.number == 2
Expand Down Expand Up @@ -202,7 +194,6 @@ defmodule ETH.Query.Test do
end

test "get_block!/1 by hash works" do
Process.sleep(2)
first_block = ETH.get_block!(1)
second_block = ETH.get_block!(2)

Expand Down
2 changes: 1 addition & 1 deletion test/support/eth_client.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule ETH.TestClient do
def start do
Task.async(fn ->
spawn(fn ->
"testrpc -b=1 -m=\" parent leopard beauty edit tilt what blast next huge need print advice evolve move explain govern grab raccoon gown gravity gloom walnut silver reopen\""
|> String.to_charlist
|> :os.cmd()
Expand Down

0 comments on commit c316d03

Please # to comment.