1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

Merge pull request #105 from oceanprotocol/feature/#67-use-barge-on-travis-2

Use Barge to run integration tests.
This commit is contained in:
Pedro Gutiérrez 2019-01-16 09:50:42 +01:00 committed by GitHub
commit b706f4852b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 31 additions and 11 deletions

View File

@ -18,14 +18,18 @@ before_install:
before_script:
- greenkeeper-lockfile-update
- ganache-cli > ganache-cli.log &
- sleep 2
- ganache-cli --port 18545 > ganache-cli.log &
- git clone https://github.com/oceanprotocol/barge
- cd barge
- bash -x start_ocean.sh --latest --no-brizo --no-pleuston --local-nile-node 2>&1 > start_ocean.log &
- cd ..
script:
- npm run test:cover
- export ETH_PORT=18545; npm run test:cover
- npm run report-coverage
- npm run build
- npm run doc
- ./src/examples/fire_lazers.sh
after_script:
- greenkeeper-lockfile-upload

View File

@ -68,4 +68,6 @@ import config from "./config"
const paid = await serviceAgreement.payAsset(did.getId(), metaData.base.price, consumer)
Logger.log(`Asset paid: ${paid}`)
process.exit(0)
})()

View File

@ -6,7 +6,6 @@ import {Account, Logger, Ocean, ServiceAgreement} from "../squid"
import config from "./config"
(async () => {
const ocean: Ocean = await Ocean.getInstance(config)
const publisher: Account = (await ocean.getAccounts())[0]
@ -65,4 +64,5 @@ import config from "./config"
publisher)
Logger.log("ServiceAgreement Id:", serviceAgreement.getId())
process.exit(0)
})()

View File

@ -2,10 +2,11 @@ import {Logger, Ocean} from "../squid"
import config from "./config"
(async () => {
const ocean: Ocean = await Ocean.getInstance(config)
const accounts = await ocean.getAccounts()
Logger.log(JSON.stringify(accounts, null, 2))
process.exit(0)
})()

View File

@ -7,4 +7,6 @@ import config from "./config"
const accounts = await ocean.getAccounts()
Logger.log(await accounts[0].getBalance())
process.exit(0)
})()

View File

@ -7,4 +7,6 @@ import config from "./config"
const accounts = await ocean.getAccounts()
Logger.log(JSON.stringify(accounts, null, 2))
process.exit(0)
})()

View File

@ -71,4 +71,6 @@ import config from "./config"
const accessGranted = await serviceAgreement.grantAccess(did.getId(), did.getId(), publisher)
Logger.log(`Asset access granted: ${accessGranted}`)
process.exit(0)
})()

View File

@ -67,4 +67,5 @@ import config from "./config"
consumer,
)
process.exit(0)
})()

View File

@ -5,7 +5,6 @@ import {Account, Logger, Ocean} from "../squid"
import config from "./config"
(async () => {
const ocean: Ocean = await Ocean.getInstance(config)
const publisher: Account = (await ocean.getAccounts())[0]
@ -42,4 +41,6 @@ import config from "./config"
const ddo: DDO = await ocean.registerAsset(metaData, publisher)
Logger.log(ddo.id)
process.exit(0)
})()

View File

@ -2,7 +2,6 @@ import {Account, Logger, Ocean, ServiceAgreementTemplate, Templates} from "../sq
import config from "./config"
(async () => {
const ocean: Ocean = await Ocean.getInstance(config)
const templateOwner: Account = (await ocean.getAccounts())[0]
@ -12,4 +11,6 @@ import config from "./config"
Logger.log("ServiceAgreementTemplate registered:", serviceAgreementRegistered,
"templateId:", serviceAgreementTemplate.getId())
process.exit(0)
})()

View File

@ -14,4 +14,6 @@ import config from "./config"
})
Logger.log(names.length, names)
process.exit(0)
})()

View File

@ -77,4 +77,6 @@ import config from "./config"
Logger.log("ServiceAgreement Id:", serviceAgreementResult.serviceAgreementId)
Logger.log("ServiceAgreement Signature:", serviceAgreementResult.serviceAgreementSignature)
process.exit(0)
})()

View File

@ -2,8 +2,8 @@ import * as HDWalletProvider from "truffle-hdwallet-provider"
import Config from "../models/Config"
import * as config from "./config/config.json"
if (false) {
const seedphrase = "xxx"
if (process.env.SEED_WORDS) {
const seedphrase = process.env.SEED_WORDS
// @ts-ignore
config.web3Provider = new HDWalletProvider(

View File

@ -3,7 +3,7 @@ import Config from "../src/models/Config"
export default {
aquariusUri: "http://localhost:5000",
brizoUri: "http://localhost:3000",
nodeUri: "http://localhost:8545",
nodeUri: `http://localhost:${process.env.ETH_PORT || 8545}`,
parityUri: "http://localhost:9545",
secretStoreUri: "http://localhost:12001",
} as Config

View File

@ -3,5 +3,5 @@
--full-trace
--bail
--exit
--timeout 5000
--timeout 20000
test/**/*.test.ts