Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use cabbage tests from a separate repo #1636

Merged
merged 22 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ jobs:
image: ubuntu-1604:201903-01
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- run:
name: Setup data dir
command: |
Expand All @@ -448,7 +453,7 @@ jobs:
name: Start daemon services
command: |
cd priv/cabbage
make start_daemon_services || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
make start_daemon_services-2 || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
- run:
name: Print docker states
command: |
Expand Down Expand Up @@ -530,6 +535,11 @@ jobs:
REORG: true
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- run:
name: Setup data dir
command: |
Expand All @@ -543,7 +553,7 @@ jobs:
name: Start daemon services
command: |
cd priv/cabbage
make start_daemon_services_reorg || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
make start_daemon_services_reorg-2 || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
- run:
name: Print docker states
command: |
Expand Down Expand Up @@ -572,19 +582,23 @@ jobs:
key: v2-mix-specs-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
- run:
name: Print watcher logs
command: docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-reorg.yml -f ./priv/cabbage/docker-compose-cabbage.yml logs --follow watcher
command: make cabbage-reorg-watcher-logs
background: true
- run:
name: Print watcher_info logs
command: docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-reorg.yml -f ./priv/cabbage/docker-compose-cabbage.yml logs --follow watcher_info
command: make cabbage-reorg-watcher_info-logs
background: true
- run:
name: Print childchain logs
command: docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-reorg.yml -f ./priv/cabbage/docker-compose-cabbage.yml logs --follow childchain
command: make cabbage-reorg-childchain-logs
background: true
- run:
name: Print geth logs
command: make cabbage-reorg-geth-logs
background: true
- run:
name: Print reorg logs
command: docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-reorg.yml -f ./priv/cabbage/docker-compose-cabbage.yml logs --follow | grep "reorg"
command: make cabbage-reorgs-logs
background: true
- run:
name: Run specs
Expand All @@ -603,6 +617,11 @@ jobs:
TERM: xterm-256color
steps:
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update --remote
- run: echo 'export PATH=~/.cargo/bin:$PATH' >> $BASH_ENV
- run:
name: Start geth, postgres and pull in blockchain snapshot
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "priv/cabbage"]
path = priv/cabbage
url = git@github.com:omgnetwork/specs.git
branch = init-specs
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,23 @@ docker-push: docker
docker push $(WATCHER_IMAGE_NAME)
docker push $(WATCHER_INFO_IMAGE_NAME)

### Cabbage reorg docker logs

cabbage-reorg-watcher-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow watcher

cabbage-reorg-watcher_info-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow watcher_info

cabbage-reorg-childchain-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow childchain

cabbage-reorg-geth-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow | grep "geth"

cabbage-reorgs-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow | grep "reorg"

###OTHER
docker-start-cluster:
SNAPSHOT=SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120 make init_test && \
Expand Down
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The `elixir-omg` repository contains OmiseGO's Elixir implementation of Plasma and forms the basis for the OMG Network.

[![Build Status](https://circleci.com/gh/omgnetwork/elixir-omg.svg?style=svg)](https://circleci.com/gh/omgnetwork/elixir-omg) [![Coverage Status](https://coveralls.io/repos/github/omisego/elixir-omg/badge.svg?branch=master)](https://coveralls.io/github/omisego/elixir-omg?branch=master)
[![Build Status](https://circleci.com/gh/omgnetwork/elixir-omg.svg?style=svg)](https://circleci.com/gh/omgnetwork/elixir-omg) [![Coverage Status](https://coveralls.io/repos/github/omisego/elixir-omg/badge.svg?branch=master)](https://coveralls.io/github/omisego/elixir-omg?branch=master)

**IMPORTANT NOTICE: Heavily WIP, expect anything**

Expand Down Expand Up @@ -118,6 +118,41 @@ To run a development `iex` REPL with all code loaded:
MIX_ENV=test iex -S mix run --no-start
```

## Running integration cabbage tests

Integration tests are written using the [`cabbage`](https://github.com/cabbage-ex/cabbage) library and they are located in a separated repo - [specs](https://github.com/omgnetwork/specs). This repo is added to `elixir-omg` as a git submodule. So to fetch them run:
```bash
git submodule init
git submodule update --remote
```

Create a directory for geth:
```bash
mkdir data && chmod 777 data
```

Make services:
```bash
make docker-child_chain
make docker-watcher
make docker-watcher_info
```

Start geth and postgres:
```bash
cd priv/cabbage
make start_daemon_services
```

Build the integration tests project and run tests:
```bash
cd priv/cabbage
make install
make generate_api_code
mix deps.get
mix test
```

# Working with API Spec's

This repo contains `gh-pages` branch intended to host [Swagger-based](https://docs.omg.network/elixir-omg/) API specification.
Expand Down
1 change: 1 addition & 0 deletions priv/cabbage
Submodule cabbage added at 196c6f
12 changes: 0 additions & 12 deletions priv/cabbage/.formatter.exs

This file was deleted.

39 changes: 0 additions & 39 deletions priv/cabbage/.gitignore

This file was deleted.

42 changes: 0 additions & 42 deletions priv/cabbage/Makefile

This file was deleted.

19 changes: 0 additions & 19 deletions priv/cabbage/README.md

This file was deleted.

1 change: 0 additions & 1 deletion priv/cabbage/apps/itest/README.md

This file was deleted.

96 changes: 0 additions & 96 deletions priv/cabbage/apps/itest/lib/account.ex

This file was deleted.

Loading