Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2090 from ethcore/js-gitlab-testing
Browse files Browse the repository at this point in the history
gitlab testing & build processes
  • Loading branch information
jacogr authored Sep 19, 2016
2 parents ab7fde6 + e5fc247 commit 4396952
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 56 deletions.
4 changes: 3 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ stages:
- deploy
variables:
GIT_DEPTH: "3"
SIMPLECOV: "true"
SIMPLECOV: "true"
RUST_BACKTRACE: "1"
cache:
key: "$CI_BUILD_NAME/$CI_BUILD_REF_NAME"
Expand Down Expand Up @@ -244,7 +244,9 @@ test-linux:
stage: test
before_script:
- git submodule update --init --recursive
- ./js/scripts/install-deps.sh
script:
- ./js/scripts/test.sh
- ./test.sh --verbose
tags:
- rust-test
Expand Down
10 changes: 0 additions & 10 deletions js/scripts/check-master.sh

This file was deleted.

33 changes: 0 additions & 33 deletions js/scripts/deploy-to-gh-pages.sh

This file was deleted.

15 changes: 15 additions & 0 deletions js/scripts/install-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# change into the js directory (one down from scripts)
pushd `dirname $0`
cd ..

# install deps and store the exit code
npm install
EXICCODE=$?

# back to root
popd

# exit with exit code
exit $EXITCODE
15 changes: 15 additions & 0 deletions js/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# change into the js directory (one down from scripts)
pushd `dirname $0`
cd ..

# run lint & tests and store the exit code
npm run lint && npm run test
EXICCODE=$?

# back to root
popd

# exit with exit code
exit $EXITCODE
2 changes: 1 addition & 1 deletion js/src/api/transport/ws/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Ws extends JsonRpcBase {

_onMessage = (event) => {
const result = JSON.parse(event.data);
const {resolve, reject} = this._messages[result.id];
const { resolve, reject } = this._messages[result.id];

if (result.error) {
this.error(event.data);
Expand Down
8 changes: 3 additions & 5 deletions js/src/dapps/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ import './style.css';
import './registry.html';

ReactDOM.render(
(
<Provider store={ store }>
<Container />
</Provider>
),
<Provider store={ store }>
<Container />
</Provider>,
document.querySelector('#container')
);
2 changes: 2 additions & 0 deletions js/src/dapps/registry/Application/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default class Application extends Component {
}

Application.propTypes = {
actions: PropTypes.object,
contract: PropTypes.object,
fee: PropTypes.object,
lookup: PropTypes.object,
owner: PropTypes.string
};
9 changes: 6 additions & 3 deletions js/src/dapps/registry/Lookup/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,29 @@ const initialState = {
};

export default (state = initialState, action) => {
if (action.type === 'lookup start')
if (action.type === 'lookup start') {
return {
pending: true,
name: action.name, key: action.key,
result: null
};
}

if (action.type === 'lookup error')
if (action.type === 'lookup error') {
return {
pending: false,
name: null, key: null,
result: null
};
}

if (action.type === 'lookup success')
if (action.type === 'lookup success') {
return {
pending: false,
name: null, key: null,
result: action.result
};
}

return state;
};
9 changes: 6 additions & 3 deletions js/src/dapps/registry/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ const initialState = {
};

export default (state = initialState, action) => {
if (action.type === 'set contract')
if (action.type === 'set contract') {
return { ...state, contract: action.contract };
}

if (action.type === 'set fee')
if (action.type === 'set fee') {
return { ...state, fee: action.fee };
}

if (action.type === 'set owner')
if (action.type === 'set owner') {
return { ...state, owner: action.owner };
}

if (action.type.slice(0, 6) === 'lookup') {
return { ...state, lookup: lookupReducer(state.lookup, action) };
Expand Down

0 comments on commit 4396952

Please sign in to comment.