-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feat/ipfs-fixes
- Loading branch information
Showing
13 changed files
with
290 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Reviewing | ||
|
||
## A pull request created from a fork | ||
|
||
Due to preference or push permissions, some contributors create pull requests from a different | ||
remote than `origin`, i.e. a fork. For example: `aragon:master` < `satoshi:feat/add-consensus`. | ||
|
||
### Testing locally (read-only) | ||
|
||
- Fetch the branch using a PR reference, and switch to it: | ||
|
||
```sh | ||
git fetch origin pull/ID/head:BRANCHNAME | ||
git checkout BRANCHNAME | ||
``` | ||
|
||
Where: | ||
- `ID` is the PR number (e.g.: `5`) | ||
- `BRANCHNAME` the branch of the PR (e.g.: `feat/add-consensus`) | ||
|
||
Note: the remote `refs/pulls` is read-only, we cannot push commits. | ||
|
||
### Testing and adding commits | ||
|
||
If the pull request creator has [allowed edits from maintaners][allow-edits-docs], and we wish to | ||
add some commits as well, we can proceed like this: | ||
|
||
- Add a new remote and switch to a branch tracking it: | ||
|
||
```sh | ||
git remote add REMOTE_NAME [email protected]:USER/REPO.git | ||
git checkout -t REMOTE_NAME/BRANCHNAME | ||
``` | ||
|
||
Where: | ||
- `USER` is the GH account (e.g.: `satoshi`) | ||
- `REPO` the repository (e.g.: `aragon-cli`) | ||
- `REMOTE_NAME` can be anything, but we recommend it to be the same as `USER` | ||
|
||
Tips: | ||
- to see the current remotes: `git remote --verbose` | ||
- to remove a remote: `git remote remove <name>` | ||
|
||
- Make changes, commit, and push as usual | ||
|
||
### Testing and adding commits using `hub` | ||
|
||
Alternatively, if we are using the git extension called [hub][hub-ext], which allows us to use | ||
GitHub from the command-line, we can proceed like this: | ||
|
||
- Switch to a branch that is tracking the remote using a PR reference: | ||
|
||
```sh | ||
hub pr checkout ID | ||
``` | ||
|
||
Where: | ||
- `ID` is the PR number (e.g.: `5`) | ||
|
||
[allow-edits-docs]: https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests | ||
[hub-ext]: https://hub.github.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
[ | ||
"@babel/preset-env", | ||
{ | ||
"useBuiltIns": "entry" | ||
"useBuiltIns": "entry", | ||
"corejs": "2" | ||
} | ||
] | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# End-to-end tests | ||
|
||
To test only one file, try: | ||
`npm test -- src/cli/ipfs.js` | ||
`npm test -- src/cli/ipfs.test.js` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import test from 'ava' | ||
import fs from 'fs-extra' | ||
import fetch from 'node-fetch' | ||
import execa from 'execa' | ||
import { startBackgroundProcess, normalizeOutput } from '../util' | ||
|
||
const testSandbox = './.tmp/run' | ||
|
||
test.beforeEach(() => { | ||
fs.ensureDirSync(testSandbox) | ||
}) | ||
|
||
test.afterEach(() => { | ||
fs.removeSync(testSandbox) | ||
}) | ||
|
||
test('should create a new aragon app and run it successfully', async t => { | ||
t.plan(3) | ||
|
||
// arrange | ||
const projectName = 'foobarfoo' | ||
await execa('create-aragon-app', [projectName], { cwd: testSandbox }) | ||
// hack, we need to install the dependencies of the app | ||
await execa('npm', ['install'], { cwd: `${testSandbox}/${projectName}/app` }) | ||
|
||
// act | ||
const runProcess = await startBackgroundProcess({ | ||
cmd: 'aragon', | ||
args: ['run', '--debug', '--reset'], | ||
execaOpts: { cwd: `${testSandbox}/${projectName}` }, | ||
readyOutput: 'Opening http://localhost:3000/#/', | ||
}) | ||
|
||
// hack so the wrapper has time to start | ||
await new Promise(resolve => setTimeout(resolve, 2 * 60 * 1000)) | ||
|
||
// finding the DAO address | ||
const daoAddress = runProcess.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}`) | ||
const fetchBody = await fetchResult.text() | ||
|
||
// cleanup | ||
await runProcess.exit() | ||
|
||
// delete some output sections that are not deterministic | ||
const appBuildOutput = runProcess.stdout.substring( | ||
runProcess.stdout.indexOf('Building frontend [started]'), | ||
runProcess.stdout.indexOf('Building frontend [completed]') | ||
) | ||
const wrapperInstallOutput = runProcess.stdout.substring( | ||
runProcess.stdout.indexOf('Downloading wrapper [started]'), | ||
runProcess.stdout.indexOf('Starting Aragon client [started]') | ||
) | ||
|
||
const outputToSnapshot = runProcess.stdout | ||
.replace(appBuildOutput, '') | ||
.replace(wrapperInstallOutput, '') | ||
|
||
// assert | ||
t.snapshot(normalizeOutput(outputToSnapshot)) | ||
t.snapshot(fetchResult.status) | ||
t.snapshot(fetchBody) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# Snapshot report for `src/cli/run.test.js` | ||
|
||
The actual snapshot is saved in `run.test.js.snap`. | ||
|
||
Generated by [AVA](https://ava.li). | ||
|
||
## should create a new aragon app and run it successfully | ||
|
||
> Snapshot 1 | ||
`[?25lStart a local Ethereum network [started]␊ | ||
Setting up a new chain from latest Aragon snapshot [started]␊ | ||
Setting up a new chain from latest Aragon snapshot [completed]␊ | ||
Starting a local chain from snapshot [started]␊ | ||
Local chain started at port 8545 [title changed]␊ | ||
Local chain started at port 8545 [completed]␊ | ||
Start a local Ethereum network [completed]␊ | ||
Check IPFS [started]␊ | ||
Start IPFS [started]␊ | ||
→ Starting IPFS at port: 5001␊ | ||
Start IPFS [completed]␊ | ||
Add local files [started]␊ | ||
Add local files [completed]␊ | ||
Check IPFS [completed]␊ | ||
Publish app to APM [started]␊ | ||
Applying version bump (major) [started]␊ | ||
Applying version bump (major) [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]␊ | ||
Building frontend [completed]␊ | ||
Prepare files for publishing [started]␊ | ||
Prepare files for publishing [completed]␊ | ||
Generate application artifact [started]␊ | ||
Generate application artifact [completed]␊ | ||
Publish foobarfoo.aragonpm.eth [started]␊ | ||
Generating transaction [started]␊ | ||
→ Fetching DAO at 0x983b4Df4E8458D56CFDC51B9d2149381AF80308A...␊ | ||
Generating transaction [completed]␊ | ||
Sending transaction [started]␊ | ||
→ Waiting for transaction to be mined...␊ | ||
Sending transaction [completed]␊ | ||
Publish foobarfoo.aragonpm.eth [completed]␊ | ||
Fetch published repo [started]␊ | ||
Fetch published repo [completed]␊ | ||
Publish app to APM [completed]␊ | ||
Create DAO [started]␊ | ||
Fetching template bare-kit.aragonpm.eth@latest [started]␊ | ||
Fetching template bare-kit.aragonpm.eth@latest [completed]␊ | ||
Create new DAO from template [started]␊ | ||
Create new DAO from template [completed]␊ | ||
Checking DAO [started]␊ | ||
Checking DAO [completed]␊ | ||
Create DAO [completed]␊ | ||
Open DAO [started]␊ | ||
Starting Aragon client [started]␊ | ||
→ Starting Aragon client...␊ | ||
Starting Aragon client [completed]␊ | ||
Opening wrapper [started]␊ | ||
→ Opening wrapper␊ | ||
Opening wrapper [completed]␊ | ||
Open DAO [completed]␊ | ||
[?25h i You are now ready to open your app in Aragon.␊ | ||
i Here are some Ethereum accounts you can use.␊ | ||
The first one will be used for all the actions the CLI performs.␊ | ||
You can use your favorite Ethereum provider or wallet to import their private keys.␊ | ||
␊ | ||
Address #1: 0xb4124cEB3451635DAcedd11767f004d8a28c6eE7 (this account is used to deploy DAOs, it has more permissions)␊ | ||
Private key: a8a54b2d8197bc0b19bb8a084031be71835580a01e70a45a13babd16c9bc1563␊ | ||
Address #2: 0x8401Eb5ff34cc943f096A32EF3d5113FEbE8D4Eb ␊ | ||
Private key: ce8e3bda3b44269c147747a373646393b1504bfcbb73fc9564f5d753d8116608␊ | ||
i The accounts were generated from the following mnemonic phrase:␊ | ||
explain tackle mirror kit van hammer degree position ginger unfair soup bonus␊ | ||
␊ | ||
⚠ The devchain was reset, some steps need to be done to prevent issues:␊ | ||
- Reset the application cache in Aragon Core by going to Settings > Troubleshooting.␊ | ||
- If using Metamask: switch to a different network, and then switch back to the 'Private Network' (this will clear the nonce cache and prevent errors when sending transactions) ␊ | ||
␊ | ||
␊ | ||
i This is the configuration for your development deployment:␊ | ||
Ethereum Node: ws://localhost:8545␊ | ||
ENS registry: 0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1␊ | ||
APM registry: aragonpm.eth␊ | ||
DAO address: 0xb84dFbdc18069a83af4D5506096f5e7AC7554183␊ | ||
␊ | ||
Opening http://localhost:3000/#/0xb84dFbdc18069a83af4D5506096f5e7AC7554183 to view your DAO` | ||
|
||
> Snapshot 2 | ||
200 | ||
|
||
> Snapshot 3 | ||
`<!DOCTYPE html>␊ | ||
<html lang="en">␊ | ||
<head>␊ | ||
<meta charset="utf-8">␊ | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=no">␊ | ||
<link rel="shortcut icon" type="image/svg+xml" href="/favicon.caf9c731.svg">␊ | ||
<link rel="shortcut icon" type="image/png" href="/favicon.6d47dbe5.png">␊ | ||
<title>Aragon</title>␊ | ||
<style>html, body {␊ | ||
height: 100%;␊ | ||
overflow: hidden;␊ | ||
}</style>␊ | ||
</head>␊ | ||
<body>␊ | ||
<noscript>␊ | ||
You need to enable JavaScript to run this app.␊ | ||
</noscript>␊ | ||
<div id="root"></div>␊ | ||
<script src="/src.e31bb0bc.js"></script>␊ | ||
</body>␊ | ||
</html>␊ | ||
` |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.