Michael Bradley, Jr 991d958436 build: merge test_dapps with the root monorepo
[PR 1318][PR1318] introduces a monorepo member that's used as a DApp
dependency, but the present arrangement whereby `test_dapps/` is an embedded
monorepo makes it difficult to develop and test such packages in tandem with
changes to `test_dapps/packages/*`.

Reorganize `test_dapps/*` as members of the root monorepo and make various
adjustments accordingly. This makes it easy to develop test dapps and any
packages they depend on simultaneously, but we lose the CI/QA arrangement where
test dapps are run with an embark installed from fresh tarballs. That
arrangement, which is quite worthwhile as a means to detect problems arising
from transitive dependencies as soon as possible, will be re-introduced in
another PR, possibly involving an auxiliary repository such as
embark-framework/dapp-bin.

Since the `package.json` `"test"` scripts of `test_dapps/*` are now kicked off
as part of `yarn test` in the root, and since port allocation isn't fully
dynamic, it's important to run `yarn test` with `lerna run`'s `--concurrency=1`
option. For the same reasons, the root `ci` and `qa` scripts are similarly
restricted. In the future, this setup can be refactored and improved, along
with use of `lerna run`'s `--since` option to increase testing efficiency in
CI.

[PR1318]: https://github.com/embark-framework/embark/pull/1318
2019-02-12 16:59:54 -05:00

99 lines
2.4 KiB
JavaScript

module.exports = {
default: {
deployment: {
host: "localhost",
port: 8546,
type: "ws",
accounts: [
{
mnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm",
balance: "5 ether"
}
]
},
dappConnection: [
"ws://localhost:8546",
"http://localhost:8550",
"http://localhost:8545",
"http://localhost:8550",
"$WEB3"
],
gas: "auto",
contracts: {
Ownable: {
deploy: false
},
SimpleStorage: {
fromIndex: 0,
args: [100],
onDeploy: ["SimpleStorage.methods.setRegistar(web3.eth.defaultAccount).send()"]
},
AnotherStorage: {
args: ["$SimpleStorage"]
},
Token: {
deploy: false,
args: [1000]
},
Test: {
onDeploy: ["Test.methods.changeAddress('$MyToken')", "Test.methods.changeENS('embark.eth')"]
},
MyToken: {
instanceOf: "Token"
},
MyToken2: {
instanceOf: "Token",
args: [200]
},
AlreadyDeployedToken: {
address: "0xece374063fe5cc7efbaca0a498477cada94e5ad6",
instanceOf: "Token"
},
MyToken3: {
instanceOf: "Tokn"
},
ContractArgs: {
args: {
initialValue: 123,
"_addresses": ["$MyToken2", "$SimpleStorage"]
}
},
SomeContract: {
deployIf: 'await MyToken.methods.isAvailable().call()',
onDeploy: ['$MyToken'], // Needed because otherwise Embark doesn't know that we depend on MyToken. Would be cleaner with `dependsOn`
args: [
["$MyToken2", "$SimpleStorage"],
100
]
},
ERC20: {
file: "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"
},
SimpleStorageTest: {
file: "./some_folder/test_contract.sol",
args: [1000]
},
StandardToken: {
file: "https://github.com/status-im/contracts/blob/151-embark31/contracts/token/StandardToken.sol",
deploy: false
},
SimpleStorageWithHttpImport: {
fromIndex: 0,
args: [100]
}
},
afterDeploy: [
"Test.methods.changeAddress('$MyToken')",
"web3.eth.getAccounts((err, accounts) => Test.methods.changeAddress(accounts[0]))"
]
},
development: {
contracts: {
MyToken2: {
instanceOf: "Token",
args: [2000]
}
}
}
};