Skip to content

Commit

Permalink
Fix run test & update snapshot (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGabi authored Jul 6, 2019
1 parent 457f98d commit 44a153e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 55 deletions.
16 changes: 7 additions & 9 deletions packages/e2e-tests/src/cli/run.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ test('should run an aragon app successfully', async t => {
await new Promise(resolve => setTimeout(resolve, 2 * 60 * 1000)) // TODO move to utils

// finding the DAO address
const daoAddress = stdout.match(
/DAO address: (0x[a-fA-F0-9]{40})/
)[1]
const daoAddress = stdout.match(/DAO address: (0x[a-fA-F0-9]{40})/)[1]

// TODO: fetch the counter app instead
const fetchResult = await fetch(`http://localhost:3000/#/${daoAddress}`)
Expand All @@ -42,22 +40,22 @@ test('should run an aragon app successfully', async t => {
await exit()

// delete some output sections that are not deterministic
const prepublishScriptOutput = stdout.substring(
stdout.indexOf('Running prepublish script [started]'),
stdout.indexOf('Running prepublish script [completed]')
)

const appBuildOutput = stdout.substring(
stdout.indexOf('Building frontend [started]'),
stdout.indexOf('Building frontend [completed]')
)
const publishOutput = stdout.substring(
stdout.indexOf('Publish app to aragonPM [started]'),
stdout.indexOf('Publish app to aragonPM [completed]')
)

const wrapperInstallOutput = stdout.substring(
stdout.indexOf('Downloading wrapper [started]'),
stdout.indexOf('Starting Aragon client [started]')
)

const outputToSnapshot = stdout
.replace(prepublishScriptOutput, '[deleted-prepublish-script-output]')
.replace(publishOutput, '[deleted-publish-output]')
.replace(appBuildOutput, '[deleted-app-build-output]')
.replace(wrapperInstallOutput, '[deleted-wrapper-install-output]')
.replace(new RegExp(daoAddress, 'g'), '[deleted-dao-address]')
Expand Down
47 changes: 1 addition & 46 deletions packages/e2e-tests/src/cli/run.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,7 @@ Generated by [AVA](https://ava.li).
Add local files [started]␊
Add local files [completed]␊
Check IPFS [completed]␊
Publish app to aragonPM [started]␊
[deleted-prepublish-script-output]Running prepublish script [completed]␊
Applying version bump (major) [started]␊
i Fetching latest version from aragonPM...␊
Applying version bump (major) [completed]␊
[deleted-app-build-output]Building frontend [completed]␊
Deploy contract [started]␊
Compile contracts [started]␊
Compile contracts [completed]␊
Deploy 'CounterApp' to network [started]␊
→ Deploying 'CounterApp' to network␊
Deploy 'CounterApp' to network [completed]␊
Generate deployment artifacts [started]␊
Generate deployment artifacts [completed]␊
Deploy contract [completed]␊
Determine contract address for version [started]␊
Determine contract address for version [completed]␊
Prepare files for publishing [started]␊
Prepare files for publishing [completed]␊
Generate application artifact [started]␊
Generate application artifact [completed]␊
Publish intent [started]␊
Publish intent [completed]␊
The following information will be published: ␊
Contract address: 0x48c2Eac33521070509f9819A824a3D5686Ba5ce8 ␊
Content (ipfs): QmZNbFozyGdBSMtPKMBE7j7hW1ELuLTRjgwZAnNn6S9NdL ␊
Publish foobar.open.aragonpm.eth [started]␊
Generating transaction [started]␊
→ Fetching DAO at 0x9a348D0c3f55c2B3f6A400CC1BE71c882Ff1bdC3...␊
Generating transaction [completed]␊
Sending transaction [started]␊
→ Waiting for transaction to be mined...␊
Sending transaction [completed]␊
Publish foobar.open.aragonpm.eth [completed]␊
Fetch published repo [started]␊
Fetch published repo [completed]␊
Successfully published foobar.open.aragonpm.eth v1.0.0 : ␊
Transaction hash: 0xeadbb6b73c13593b52b3ea1517348cdeeb62f19db662aee610cb47de46ce3b09 ␊
> Published directory: /var/folders/vc/nf2vt5pj5cs67y36r_4gv9gh0000gn/T/tmp-7204QVUD6Bfgtfud␊
Publish app to aragonPM [completed]␊
[deleted-publish-output]Publish app to aragonPM [completed]␊
Create DAO [started]␊
Fetching template bare-kit.aragonpm.eth@latest [started]␊
Fetching template bare-kit.aragonpm.eth@latest [completed]␊
Expand Down
Binary file modified packages/e2e-tests/src/cli/run.test.js.snap
Binary file not shown.

0 comments on commit 44a153e

Please sign in to comment.