Skip to content

Commit

Permalink
Merge pull request #28 from cosmos/adding-tests
Browse files Browse the repository at this point in the history
Adding tests
  • Loading branch information
mappum authored Nov 8, 2017
2 parents 7c26d0c + 7ba8219 commit aba8b47
Show file tree
Hide file tree
Showing 28 changed files with 10,422 additions and 6,418 deletions.
24 changes: 20 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,36 @@ jobs:
working_directory: ~/repo

steps:
- run: sudo npm i -g codeclimate-test-reporter

- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-root-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-root-
- restore_cache:
keys:
- v1-dependencies-app-{{ checksum "app/package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v1-dependencies-app-

- run: yarn install
- run: yarn

- save_cache:
paths:
- yarn.lock
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
key: v1-dependencies-root-{{ checksum "package.json" }}
- save_cache:
paths:
- app/yarn.lock
- app/node_modules
key: v1-dependencies-app-{{ checksum "app/package.json" }}

- run: yarn lint
- run: npm run pack
- run: xvfb-run -e /dev/stdout -a npm run test
- run: codeclimate-test-reporter < test/unit/coverage/lcov.info
12 changes: 12 additions & 0 deletions .circleci/images/primary/DOCKERFILE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM circleci/golang:1.8.1-browsers

RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
RUN sudo apt-get install -y nodejs

RUN go get -d github.com/cosmos/cosmos-sdk
RUN cd $GOPATH/src/github.com/cosmos/cosmos-sdk && git checkout v0.7.1 && make get_vendor_deps && make install

RUN go get -d github.com/tendermint/tendermint/cmd/tendermint
RUN cd $GOPATH/src/github.com/tendermint/tendermint && git checkout v0.11.1 && make get_vendor_deps && make install

RUN sudo npm i -g yarn
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ npm-debug.log
npm-debug.log.*
thumbs.db
!.gitkeep
env.js
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is still alpha-level software as of September 2017. Do not enter in your Co

## Development

To run the dev build, first you will need the following binaries installed in your GOPATH: `basecoin`, `baseserver`, and `tendermint`.
To run the dev build, first you will need the following binaries installed in your GOPATH: `basecoin`, `baseserver`, and `tendermint`. Download those from `https://tendermint.com/downloads`.

```fish
# check your versions
Expand All @@ -20,8 +20,7 @@ $ tendermint version
0.11.0-7682ad9a
```

```
npm install
# on Window set GOPATH in `./env.js`. This file is gitignored.

# run on the default testnet
npm run testnet
Expand Down Expand Up @@ -50,14 +49,14 @@ brew install glide
# install basecoin/baseserver
go get -d github.com/cosmos/cosmos-sdk
cd $GOPATH/src/github.com/cosmos/cosmos-sdk
cd $GOPATH/src/github.com/cosmos/cosmos-sdk // Windows: cd %GOPATH%/src/github.com/cosmos/cosmos-sdk
git checkout develop
make get_vendor_deps
make install
# install tendermint
go get -d github.com/tendermint/tendermint/cmd/tendermint
cd $GOPATH/src/github.com/tendermint/tendermint
cd $GOPATH/src/github.com/tendermint/tendermint // Windows: cd %GOPATH%/src/github.com/tendermint/tendermint
git checkout v0.11.0
make get_vendor_deps
make install
Expand All @@ -68,3 +67,30 @@ Then build and run the app:
npm run pack && npm run build:darwin
open builds/cosmos-ui-darwin-x64/cosmos-ui.app
```

## Testing

To test you need to first package the web content of the app, as this content can only be used bundled by the electron instance.

```bash
$ npm run pack
$ npm run test
```


## FAQ

- If tendermint crashes and the log shows "Tendermint state.AppHash does not match AppHash after replay." delete the config folders at $HOME/.cosmos-ui[-dev].

- If you use yarn, the postinstall hook may not execute. In this case you have to execute these script manualy:
```bash
$ cd app
$ yarn
$ cd ..
$ npm run rebuild
```

- If electron shows the error: "A DLL initialization routine has failed." rebuild the electron dependencies.
```bash
$ npm run rebuild
```
Loading

0 comments on commit aba8b47

Please sign in to comment.