markusklems / desema

Prototype of a blockchain-based decentralized service marketplace.
MIT License
5 stars 1 forks source link

Unit tests for IPFS and Ethereum services #77

Closed simon991 closed 7 years ago

simon991 commented 7 years ago

Test the functionalities of the IPFS (connect to daemon, put value, get value) and Ethereum (connect to ethereum geth client, unlock deafault account) service

ChristianKniep commented 7 years ago

Sorry to be that guy, but the ethereum tests are failing... I wrote a little HowTo, to show how you can run it locally - not so sure how Windows will look like - at least there is a binary: https://github.com/markusklems/cp2017/blob/master/howto/droneci.md

simon991 commented 7 years ago

well, they should work actually. Can you try to pass this parameters when starting the geth client please?: --rpcapi db,eth,net,web3,personal,shh --shh

If it still doesn't work, can you post the log?

ChristianKniep commented 7 years ago

The geth command is started like this and is part of the network namespace... I'll kick out --rpc --rpcaddr 0.0.0.0 and give it a try.

$ docker exec -t drone_DLFeOX-k6Mg_1 ps -efwww 
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 20:30 ?        00:00:00 /bin/bash /opt/start.sh
root         8     1 38 20:30 ?        00:00:20 geth --rpc --rpcaddr 0.0.0.0 --rpcapi db,eth,net,web3,personal,shh --shh
root        29     0  0 20:31 ?        00:00:00 ps -efwww
ChristianKniep commented 7 years ago

Nope, still failes, I left --rpcaddr 0.0.0.0 out, the daemon starts like this:

CMD ["geth", "--rpc", "--rpcapi", "db,eth,net,web3,personal,shh", "--shh"]

The meat of the test fails here, even though the geth shows that he fetches stuff from the blockchain.

[build:L102:132s] 03 01 2017 20:38:45.729:DEBUG [web-server]: serving (cached): /drone/src/node_modules/web3/dist/web3.js
[build:L103:133s] Chrome 53.0.2785 (Linux 0.0.0): Executed 0 of 17 SUCCESS (0 secs / 0 secs)
                  Chrome 53.0.2785 (Linux 0.0.0): Executed 3 of 17 SUCCESS (0 secs / 0.661 secs)
                  ALERT: Error{}
[build:L109:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 4 of 17 SUCCESS (0 secs / 0.821 secs)
                  LOG: Error{}
[build:L112:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 4 of 17 SUCCESS (0 secs / 0.821 secs)
                  LOG: Object{}
[build:L115:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 4 of 17 SUCCESS (0 secs / 0.821 secs)
                  LOG: Object{}
[build:L119:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 5 of 17 SUCCESS (0 secs / 0.943 secs)
                  Chrome 53.0.2785 (Linux 0.0.0): Executed 9 of 17 SUCCESS (0 secs / 1.36 secs)
[geth:L29:136s] I0103 20:38:48.965733 core/blockchain.go:1047] imported 394 blocks,     0 txs (  0.000 Mg) in    1.487s ( 0.000 Mg/s). #3072 [fba46d8c… / e1304296…]
                  Chrome 53.0.2785 (Linux 0.0.0) EthereumService should create a connection to the locally running Ethereum client with address http://localhost:8545 FAILED
[build:L126:137s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L127:137s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:42:24 <- src/test.ts:63399:25
[build:L128:137s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L129:137s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L130:137s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
[build:L131:137s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:191:0 <- src/test.ts:79450:34)
[build:L132:137s] Chrome 53.0.2785 (Linux 0.0.0): Executed 10 of 17 (1 FAILED) (0 secs / 3.424 secs)
[build:L133:137s] Chrome 53.0.2785 (Linux 0.0.0) EthereumService should create a connection to the locally running Ethereum client with address http://localhost:8545 FAILED
[build:L134:137s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L135:137s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:42:24 <- src/test.ts:63399:25
[build:L136:137s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L137:137s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L138:137s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
                  Chrome 53.0.2785 (Linux 0.0.0) EthereumService should unlock the default ethereum account with the password pw0 FAILED
[build:L141:139s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L142:139s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:78:24 <- src/test.ts:63426:25
[build:L143:139s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L144:139s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L145:139s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
[build:L146:139s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:191:0 <- src/test.ts:79450:34)
[build:L147:139s] Chrome 53.0.2785 (Linux 0.0.0): Executed 11 of 17 (2 FAILED) (0 secs / 5.559 secs)
[build:L148:139s] Chrome 53.0.2785 (Linux 0.0.0) EthereumService should unlock the default ethereum account with the password pw0 FAILED
[build:L149:139s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L150:139s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:78:24 <- src/test.ts:63426:25
[build:L151:139s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L152:139s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L153:139s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
                  LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
[build:L157:139s] Chrome 53.0.2785 (Linux 0.0.0): Executed 12 of 17 (2 FAILED) (0 secs / 5.648 secs)
[build:L158:139s] LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
                  LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
[build:L161:141s] Chrome 53.0.2785 (Linux 0.0.0): Executed 13 of 17 (2 FAILED) (0 secs / 7.931 secs)
                  LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
[build:L165:143s] Chrome 53.0.2785 (Linux 0.0.0): Executed 14 of 17 (2 FAILED) (0 secs / 10.009 secs)
                  Chrome 53.0.2785 (Linux 0.0.0): Executed 17 of 17 (2 FAILED) (12.56 secs / 12.423 secs)
[build:L171:146s] 03 01 2017 20:38:59.350:DEBUG [reporter.remap-istanbul]: Writing coverage to coverage
[build:L172:146s] 03 01 2017 20:38:59.356:DEBUG [reporter.remap-istanbul]: Writing coverage to ./coverage/coverage.lcov
[build:L173:146s] 03 01 2017 20:38:59.359:DEBUG [karma]: Run complete, exiting.
[build:L174:146s] 03 01 2017 20:38:59.361:DEBUG [launcher]: Disconnecting all browsers
[geth:L32:148s] I0103 20:39:00.825165 core/blockchain.go:1047] imported 1877 blocks,     0 txs (  0.000 Mg) in    8.001s ( 0.000 Mg/s). #5677 [89465418… / 92afc55a…]
[build:L175:148s] 03 01 2017 20:39:01.217:WARN [launcher]: Nightmare was not killed in 2000 ms, sending SIGKILL.
[build:L176:148s] 03 01 2017 20:39:01.222:DEBUG [launcher]: Process Nightmare exited with code 0
[build:L177:148s] 03 01 2017 20:39:01.222:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-50190385
[build:L178:148s] 03 01 2017 20:39:01.229:DEBUG [launcher]: Finished all browsers
[geth:L33:148s] I0103 20:39:01.423401 core/blockchain.go:1047] imported 171 blocks,     0 txs (  0.000 Mg) in 598.259ms ( 0.000 Mg/s). #5848 [92afc55a… / 1edbfa0a…]
[build] exit code 1
[ipfs:L15:150s]
[ipfs:L16:150s] Received interrupt signal, shutting down...
[ipfs:L17:150s] (Hit ctrl-c again to force-shutdown the daemon.)
[ipfs:L18:151s] 20:39:03.456 ERROR       mdns: mdns lookup error: failed to bind to any multicast udp port mdns.go:131
build : exit code 1
drone exec --repo.trusted --privileged build  0.04s user 0.02s system 0% cpu 2:33.73 total

@simon991 Could you share the exact version you are running and the exact command(s)? Maybe I missed something...

ChristianKniep commented 7 years ago

Btw: 1.5.2-stable-c8695209

ChristianKniep commented 7 years ago

Full log:

Running Matrix job #0
[ipfs:L0:0s] ipfs version 0.4.4
[ipfs:L1:0s] initializing ipfs node at /data/ipfs
[ipfs:L2:0s] generating 2048-bit RSA keypair...done
[ipfs:L3:0s] peer identity: QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx
[geth:L0:0s] I0103 20:36:32.555622 cmd/utils/flags.go:615] WARNING: No etherbase set and no accounts found as default
[geth:L1:0s] I0103 20:36:32.555836 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /root/.ethereum/geth/chaindata
[geth:L2:0s] I0103 20:36:32.587128 ethdb/database.go:176] closed db:/root/.ethereum/geth/chaindata
[geth:L3:0s] I0103 20:36:32.590893 node/node.go:176] instance: Geth/v1.5.5-stable-ff07d548/linux/go1.7.3
[geth:L4:0s] I0103 20:36:32.591506 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /root/.ethereum/geth/chaindata
[geth:L5:0s] I0103 20:36:32.612799 eth/backend.go:191] Protocol Versions: [63 62], Network Id: 1
[geth:L6:0s] I0103 20:36:32.995703 eth/backend.go:209] WARNING: Wrote default ethereum genesis block
[geth:L7:0s] I0103 20:36:32.995903 eth/backend.go:219] Chain config: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000}
[geth:L8:0s] I0103 20:36:32.997171 core/blockchain.go:219] Last header: #0 [d4e56740…] TD=17179869184
[geth:L9:0s] I0103 20:36:32.997260 core/blockchain.go:220] Last block: #0 [d4e56740…] TD=17179869184
[geth:L10:0s] I0103 20:36:32.997271 core/blockchain.go:221] Fast block: #0 [d4e56740…] TD=17179869184
[geth:L11:0s] I0103 20:36:32.998423 p2p/server.go:342] Starting Server
[build:L0:0s] + npm install typescript
[ipfs:L4:0s] to get started, enter:
[ipfs:L5:0s]
[ipfs:L6:0s]    ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
[ipfs:L7:0s]
[build:L1:0s] npm info it worked if it ends with ok
[build:L2:0s] npm info using npm@3.10.9
[build:L3:0s] npm info using node@v6.9.2
[ipfs:L8:1s] Initializing daemon...
[geth:L12:2s] I0103 20:36:35.115402 p2p/discover/udp.go:227] Listening, enode://2ba47503deb24c7b7c24b211323f1a7f2a559b6c9482059e7de983327e4e2afd6adb163c57e2655fa5cb23b2653191441c3bb4615a1333b6619eb986d88723bf@[::]:30303
[geth:L13:2s] I0103 20:36:35.115896 whisper/whisperv2/whisper.go:176] Whisper started
[geth:L14:2s] I0103 20:36:35.117844 p2p/server.go:610] Listening on [::]:30303
[geth:L15:2s] I0103 20:36:35.120039 node/node.go:341] IPC endpoint opened: /root/.ethereum/geth.ipc
[geth:L16:2s] I0103 20:36:35.124505 node/node.go:411] HTTP endpoint opened: http://localhost:8545
[ipfs:L9:3s] Swarm listening on /ip4/127.0.0.1/tcp/4001
[ipfs:L10:3s] Swarm listening on /ip4/172.17.0.2/tcp/4001
[ipfs:L11:3s] Swarm listening on /ip6/::1/tcp/4001
[ipfs:L12:3s] API server listening on /ip4/0.0.0.0/tcp/5001
[ipfs:L13:3s] Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
[ipfs:L14:3s] Daemon is ready
[build:L4:8s] npm info attempt registry request try #1 at 8:36:41 PM
[build:L5:8s] npm http request GET https://registry.npmjs.org/typescript
[build:L6:8s] npm http 200 https://registry.npmjs.org/typescript
[build:L7:21s] npm info lifecycle typescript@2.0.10~preinstall: typescript@2.0.10
[build:L8:21s] npm info lifecycle typescript@2.0.10~preuninstall: typescript@2.0.10
[build:L9:21s] npm info lifecycle typescript@2.0.10~uninstall: typescript@2.0.10
[build:L10:21s] npm info lifecycle typescript@2.0.10~postuninstall: typescript@2.0.10
[build:L11:21s] npm info linkStuff typescript@2.0.10
[build:L12:21s] npm info lifecycle typescript@2.0.10~install: typescript@2.0.10
[build:L13:21s] npm info lifecycle typescript@2.0.10~postinstall: typescript@2.0.10
[geth:L17:22s] I0103 20:36:55.118513 eth/downloader/downloader.go:326] Block synchronisation started
[build:L14:25s] market-client@0.0.0 /drone/src
[build:L15:25s] `-- typescript@2.0.10
[build:L16:25s]
[build:L17:25s] npm info ok
[build:L18:25s] + npm install enhanced-resolve
[build:L19:26s] npm info it worked if it ends with ok
[build:L20:26s] npm info using npm@3.10.9
[build:L21:26s] npm info using node@v6.9.2
[geth:L18:31s] I0103 20:37:04.362201 core/blockchain.go:1047] imported 2 blocks,     0 txs (  0.000 Mg) in    2.860s ( 0.000 Mg/s). #2 [9f68b3d3… / c4e2bac9…]
[build:L22:34s] npm info attempt registry request try #1 at 8:37:07 PM
[build:L23:34s] npm http request GET https://registry.npmjs.org/enhanced-resolve
[build:L24:35s] npm http 304 https://registry.npmjs.org/enhanced-resolve
[build:L25:36s] npm info addNameTag [ 'enhanced-resolve', 'latest' ]
[build:L26:36s] npm info retry fetch attempt 1 at 8:37:09 PM
[build:L27:36s] npm info attempt registry request try #1 at 8:37:09 PM
[build:L28:36s] npm http fetch GET https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.0.2.tgz
[build:L29:36s] npm http fetch 200 https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.0.2.tgz
[build:L30:36s] npm info attempt registry request try #1 at 8:37:09 PM
[build:L31:36s] npm http request GET https://registry.npmjs.org/memory-fs
[build:L32:36s] npm http 304 https://registry.npmjs.org/memory-fs
[build:L33:48s] npm info lifecycle enhanced-resolve@3.0.2~preinstall: enhanced-resolve@3.0.2
[build:L34:48s] npm info lifecycle enhanced-resolve@3.0.2~preuninstall: enhanced-resolve@3.0.2
[build:L35:48s] npm info lifecycle enhanced-resolve@3.0.2~uninstall: enhanced-resolve@3.0.2
[build:L36:48s] npm info lifecycle enhanced-resolve@3.0.2~postuninstall: enhanced-resolve@3.0.2
[build:L37:48s] npm info linkStuff enhanced-resolve@3.0.2
[build:L38:48s] npm info lifecycle enhanced-resolve@3.0.2~install: enhanced-resolve@3.0.2
[build:L39:48s] npm info lifecycle enhanced-resolve@3.0.2~postinstall: enhanced-resolve@3.0.2
[build:L40:53s] market-client@0.0.0 /drone/src
[build:L41:53s] `-- enhanced-resolve@3.0.2
[build:L42:53s]
[build:L43:53s] npm info ok
[build:L44:53s] + npm install
[build:L45:53s] npm info it worked if it ends with ok
[build:L46:53s] npm info using npm@3.10.9
[build:L47:53s] npm info using node@v6.9.2
[geth:L19:57s] I0103 20:37:30.107462 core/blockchain.go:1047] imported 2 blocks,     0 txs (  0.000 Mg) in  72.948ms ( 0.000 Mg/s). #2 [88e96d45… / b495a1d7…]
[geth:L20:57s] I0103 20:37:30.363121 core/blockchain.go:1047] imported 4 blocks,     0 txs (  0.000 Mg) in  94.837ms ( 0.000 Mg/s). #6 [3d612266… / 1f1aed8e…]
[geth:L21:58s] I0103 20:37:31.119890 core/blockchain.go:1047] imported 26 blocks,     0 txs (  0.000 Mg) in 678.283ms ( 0.000 Mg/s). #32 [e0c7c0b4… / 88be699f…]
[geth:L22:59s] I0103 20:37:31.533621 core/blockchain.go:1047] imported 4 blocks,     0 txs (  0.000 Mg) in  93.375ms ( 0.000 Mg/s). #36 [0cd0deee… / 5f81bfa6…]
[geth:L23:65s] I0103 20:37:37.799188 core/blockchain.go:1047] imported 348 blocks,     0 txs (  0.000 Mg) in    3.442s ( 0.000 Mg/s). #384 [0ee49bf8… / d3d5d5c1…]
[build:L48:73s] npm info lifecycle market-client@0.0.0~preinstall: market-client@0.0.0
[build:L49:73s] npm info linkStuff market-client@0.0.0
[build:L50:74s] npm info lifecycle market-client@0.0.0~install: market-client@0.0.0
[build:L51:74s] npm info lifecycle market-client@0.0.0~postinstall: market-client@0.0.0
[build:L52:74s] npm info lifecycle market-client@0.0.0~prepublish: market-client@0.0.0
[build:L53:74s] npm info ok
[build:L54:74s] + ./test.sh
[build:L55:94s] 03 01 2017 20:38:07.920:DEBUG [config]: Loading config /drone/src/karma.conf.js
[build:L56:98s] 03 01 2017 20:38:11.101:DEBUG [config]: autoWatch set to false, because of singleRun
[build:L57:98s] 03 01 2017 20:38:11.104:DEBUG [plugin]: Loading inlined plugin (defining framework:jasmine).
[build:L58:98s] 03 01 2017 20:38:11.104:DEBUG [plugin]: Loading inlined plugin (defining launcher:Chrome, launcher:ChromeCanary, launcher:Chromium, launcher:Dartium, test).
[build:L59:98s] 03 01 2017 20:38:11.105:DEBUG [plugin]: Loading inlined plugin (defining reporter:karma-remap-istanbul).
[build:L60:98s] 03 01 2017 20:38:11.105:DEBUG [plugin]: Loading inlined plugin (defining framework:angular-cli, preprocessor:angular-cli, webpackPlugin, preprocessor:webpack, middleware:webpackBlocker, preprocessor:sourcemap).
[build:L61:98s] 03 01 2017 20:38:11.106:DEBUG [plugin]: Loading inlined plugin (defining launcher:Nightmare, screenshot, isNightmare).
[build:L62:98s] 03 01 2017 20:38:11.335:DEBUG [web-server]: Instantiating middleware
[build:L63:98s] 03 01 2017 20:38:11.404:DEBUG [reporter]: Trying to load reporter: karma-remap-istanbul
[build:L64:98s] 03 01 2017 20:38:11.410:DEBUG [reporter]: Trying to load color-version of reporter: karma-remap-istanbul (karma-remap-istanbul_color)
[build:L65:98s] 03 01 2017 20:38:11.411:DEBUG [reporter]: Couldn't load color-version.
[geth:L24:110s] I0103 20:38:23.423292 core/blockchain.go:1047] imported 4 blocks,     0 txs (  0.000 Mg) in  32.295ms ( 0.000 Mg/s). #388 [bbb506ab… / 0ace7268…]
[geth:L25:118s] I0103 20:38:30.912780 core/blockchain.go:1047] imported 242 blocks,     0 txs (  0.000 Mg) in    2.003s ( 0.000 Mg/s). #630 [ea1b14a4… / 8593158e…]
[build:L66:124s] 03 01 2017 20:38:37.787:DEBUG [preprocessor.sourcemap]: base64-encoded source map for /drone/src/src/test.ts
[build:L67:125s] 03 01 2017 20:38:38.031:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
[build:L68:125s] 03 01 2017 20:38:38.044:INFO [launcher]: Launching browser Nightmare with unlimited concurrency
[build:L69:125s] 03 01 2017 20:38:38.596:INFO [launcher]: Starting browser Nightmare
[build:L70:125s] 03 01 2017 20:38:38.598:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-50190385
[build:L71:125s] 03 01 2017 20:38:38.601:DEBUG [launcher]: node /drone/src/node_modules/karma-nightmare/lib/browser.js http://localhost:9876/?id=50190385 {"width":800,"height":600,"show":false}
[geth:L26:126s] I0103 20:38:38.948067 core/blockchain.go:1047] imported 1009 blocks,     0 txs (  0.000 Mg) in    8.013s ( 0.000 Mg/s). #1639 [ffb60c7e… / d83235a0…]
[build:L72:131s] 03 01 2017 20:38:44.819:DEBUG [web-server]: serving: /drone/src/node_modules/karma/static/client.html
[build:L73:132s] 03 01 2017 20:38:45.150:DEBUG [web-server]: serving: /drone/src/node_modules/karma/static/karma.js
[build:L74:132s] 03 01 2017 20:38:45.331:DEBUG [karma]: A browser has connected on socket /#20QTqmvqA0qTCNhGAAAA
[build:L75:132s] 03 01 2017 20:38:45.357:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=20QTqmvqA0qTCNhGAAAA
[build:L76:132s] 03 01 2017 20:38:45.423:INFO [Chrome 53.0.2785 (Linux 0.0.0)]: Connected on socket /#20QTqmvqA0qTCNhGAAAA with id 50190385
[build:L77:132s] 03 01 2017 20:38:45.425:DEBUG [launcher]: Nightmare (id 50190385) captured in 7.38 secs
[build:L78:132s] 03 01 2017 20:38:45.468:DEBUG [middleware:karma]: custom files null null
[build:L79:132s] 03 01 2017 20:38:45.468:DEBUG [middleware:karma]: Serving static request /context.html
[build:L80:132s] 03 01 2017 20:38:45.480:DEBUG [web-server]: serving: /drone/src/node_modules/karma/static/context.html
[build:L81:132s] 03 01 2017 20:38:45.503:DEBUG [middleware:source-files]: Requesting /base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?391e45351df9ee35392d2e5cb623221a969fc009 /
[build:L82:132s] 03 01 2017 20:38:45.504:DEBUG [middleware:source-files]: Fetching /drone/src/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
[build:L83:132s] 03 01 2017 20:38:45.512:DEBUG [web-server]: serving (cached): /drone/src/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
[build:L84:132s] 03 01 2017 20:38:45.517:DEBUG [middleware:source-files]: Requesting /base/src/assets/ipfs-api/dist/index.js?a5eb5e9519836a6d5c44fe6593e54581f4083220 /
[build:L85:132s] 03 01 2017 20:38:45.518:DEBUG [middleware:source-files]: Fetching /drone/src/src/assets/ipfs-api/dist/index.js
[build:L86:132s] 03 01 2017 20:38:45.520:DEBUG [web-server]: serving (cached): /drone/src/src/assets/ipfs-api/dist/index.js
[build:L87:132s] 03 01 2017 20:38:45.560:DEBUG [middleware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/boot.js?945a38bf4e45ad2770eb94868231905a04a0bd3e /
[build:L88:132s] 03 01 2017 20:38:45.560:DEBUG [middleware:source-files]: Fetching /drone/src/node_modules/karma-jasmine/lib/boot.js
[build:L89:132s] 03 01 2017 20:38:45.570:DEBUG [middleware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/adapter.js?7a813cc290d592e664331c573a1a796192cdd1ad /
[build:L90:132s] 03 01 2017 20:38:45.571:DEBUG [middleware:source-files]: Fetching /drone/src/node_modules/karma-jasmine/lib/adapter.js
[build:L91:132s] 03 01 2017 20:38:45.571:DEBUG [middleware:source-files]: Requesting /base/node_modules/babel-polyfill/dist/polyfill.js?68728a259817e9d453b98449aca050fc1bfa2159 /
[build:L92:132s] 03 01 2017 20:38:45.577:DEBUG [middleware:source-files]: Fetching /drone/src/node_modules/babel-polyfill/dist/polyfill.js
[build:L93:132s] 03 01 2017 20:38:45.579:DEBUG [middleware:source-files]: Requesting /base/src/test.ts?538cff039ae548b7d3c2e8ccf40ae36aec31d466 /
[build:L94:132s] 03 01 2017 20:38:45.579:DEBUG [middleware:source-files]: Fetching /drone/src/src/test.ts
[build:L95:132s] 03 01 2017 20:38:45.580:DEBUG [web-server]: serving (cached): /drone/src/node_modules/karma-jasmine/lib/boot.js
[build:L96:132s] 03 01 2017 20:38:45.582:DEBUG [web-server]: serving (cached): /drone/src/node_modules/karma-jasmine/lib/adapter.js
[build:L97:132s] 03 01 2017 20:38:45.595:DEBUG [web-server]: serving (cached): /drone/src/node_modules/babel-polyfill/dist/polyfill.js
[build:L98:132s] 03 01 2017 20:38:45.622:DEBUG [web-server]: serving (cached): /drone/src/src/test.ts
[build:L99:132s] 03 01 2017 20:38:45.704:DEBUG [web-server]: serving: /drone/src/node_modules/karma/static/context.js
[build:L100:132s] 03 01 2017 20:38:45.719:DEBUG [middleware:source-files]: Requesting /base/node_modules/web3/dist/web3.js?e6ddae876d1d27c730fe9fea6c330fa14977cee4 /
[build:L101:132s] 03 01 2017 20:38:45.724:DEBUG [middleware:source-files]: Fetching /drone/src/node_modules/web3/dist/web3.js
[build:L102:132s] 03 01 2017 20:38:45.729:DEBUG [web-server]: serving (cached): /drone/src/node_modules/web3/dist/web3.js
[build:L103:133s] Chrome 53.0.2785 (Linux 0.0.0): Executed 0 of 17 SUCCESS (0 secs / 0 secs)
                  Chrome 53.0.2785 (Linux 0.0.0): Executed 3 of 17 SUCCESS (0 secs / 0.661 secs)
                  ALERT: Error{}
[build:L109:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 4 of 17 SUCCESS (0 secs / 0.821 secs)
                  LOG: Error{}
[build:L112:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 4 of 17 SUCCESS (0 secs / 0.821 secs)
                  LOG: Object{}
[build:L115:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 4 of 17 SUCCESS (0 secs / 0.821 secs)
                  LOG: Object{}
[build:L119:134s] Chrome 53.0.2785 (Linux 0.0.0): Executed 5 of 17 SUCCESS (0 secs / 0.943 secs)
                  Chrome 53.0.2785 (Linux 0.0.0): Executed 9 of 17 SUCCESS (0 secs / 1.36 secs)
[geth:L29:136s] I0103 20:38:48.965733 core/blockchain.go:1047] imported 394 blocks,     0 txs (  0.000 Mg) in    1.487s ( 0.000 Mg/s). #3072 [fba46d8c… / e1304296…]
                  Chrome 53.0.2785 (Linux 0.0.0) EthereumService should create a connection to the locally running Ethereum client with address http://localhost:8545 FAILED
[build:L126:137s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L127:137s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:42:24 <- src/test.ts:63399:25
[build:L128:137s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L129:137s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L130:137s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
[build:L131:137s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:191:0 <- src/test.ts:79450:34)
[build:L132:137s] Chrome 53.0.2785 (Linux 0.0.0): Executed 10 of 17 (1 FAILED) (0 secs / 3.424 secs)
[build:L133:137s] Chrome 53.0.2785 (Linux 0.0.0) EthereumService should create a connection to the locally running Ethereum client with address http://localhost:8545 FAILED
[build:L134:137s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L135:137s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:42:24 <- src/test.ts:63399:25
[build:L136:137s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L137:137s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L138:137s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
                  Chrome 53.0.2785 (Linux 0.0.0) EthereumService should unlock the default ethereum account with the password pw0 FAILED
[build:L141:139s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L142:139s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:78:24 <- src/test.ts:63426:25
[build:L143:139s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L144:139s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L145:139s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
[build:L146:139s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:191:0 <- src/test.ts:79450:34)
[build:L147:139s] Chrome 53.0.2785 (Linux 0.0.0): Executed 11 of 17 (2 FAILED) (0 secs / 5.559 secs)
[build:L148:139s] Chrome 53.0.2785 (Linux 0.0.0) EthereumService should unlock the default ethereum account with the password pw0 FAILED
[build:L149:139s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.
[build:L150:139s]       at webpack:///drone/src/src/app/services/ethereum/ethereum.service.spec.ts:78:24 <- src/test.ts:63426:25
[build:L151:139s]       at ZoneDelegate.invoke (webpack:///drone/src/~/zone.js/dist/zone.js:192:0 <- src/test.ts:79451:28)
[build:L152:139s]       at AsyncTestZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/async-test.js:30:0 <- src/test.ts:49141:43)
[build:L153:139s]       at ProxyZoneSpec.onInvoke (webpack:///drone/src/~/zone.js/dist/proxy.js:57:0 <- src/test.ts:49738:43)
                  LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
[build:L157:139s] Chrome 53.0.2785 (Linux 0.0.0): Executed 12 of 17 (2 FAILED) (0 secs / 5.648 secs)
[build:L158:139s] LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
                  LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
[build:L161:141s] Chrome 53.0.2785 (Linux 0.0.0): Executed 13 of 17 (2 FAILED) (0 secs / 7.931 secs)
                  LOG: 'My IPFS node id is: ', 'QmWVtWdFirqomVvA4PT4S5z5r2vNRx6yNtBU5vDiJPzqPx'
[build:L165:143s] Chrome 53.0.2785 (Linux 0.0.0): Executed 14 of 17 (2 FAILED) (0 secs / 10.009 secs)
                  Chrome 53.0.2785 (Linux 0.0.0): Executed 17 of 17 (2 FAILED) (12.56 secs / 12.423 secs)
[build:L171:146s] 03 01 2017 20:38:59.350:DEBUG [reporter.remap-istanbul]: Writing coverage to coverage
[build:L172:146s] 03 01 2017 20:38:59.356:DEBUG [reporter.remap-istanbul]: Writing coverage to ./coverage/coverage.lcov
[build:L173:146s] 03 01 2017 20:38:59.359:DEBUG [karma]: Run complete, exiting.
[build:L174:146s] 03 01 2017 20:38:59.361:DEBUG [launcher]: Disconnecting all browsers
[geth:L32:148s] I0103 20:39:00.825165 core/blockchain.go:1047] imported 1877 blocks,     0 txs (  0.000 Mg) in    8.001s ( 0.000 Mg/s). #5677 [89465418… / 92afc55a…]
[build:L175:148s] 03 01 2017 20:39:01.217:WARN [launcher]: Nightmare was not killed in 2000 ms, sending SIGKILL.
[build:L176:148s] 03 01 2017 20:39:01.222:DEBUG [launcher]: Process Nightmare exited with code 0
[build:L177:148s] 03 01 2017 20:39:01.222:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-50190385
[build:L178:148s] 03 01 2017 20:39:01.229:DEBUG [launcher]: Finished all browsers
[geth:L33:148s] I0103 20:39:01.423401 core/blockchain.go:1047] imported 171 blocks,     0 txs (  0.000 Mg) in 598.259ms ( 0.000 Mg/s). #5848 [92afc55a… / 1edbfa0a…]
[build] exit code 1
[ipfs:L15:150s]
[ipfs:L16:150s] Received interrupt signal, shutting down...
[ipfs:L17:150s] (Hit ctrl-c again to force-shutdown the daemon.)
[ipfs:L18:151s] 20:39:03.456 ERROR       mdns: mdns lookup error: failed to bind to any multicast udp port mdns.go:131
build : exit code 1
drone exec --repo.trusted --privileged build  0.04s user 0.02s system 0% cpu 2:33.73 total
simon991 commented 7 years ago

strange :/ geth version 1.5.2-stable-c8695209 and this is how I start my geth client: geth --datadir ./db --nodiscover --port 30301 --rpc --rpcapi db,eth,net,web3,personal,shh --shh --rpcaddr "localhost" --rpccorsdomain "*" --rpcport 8545

ChristianKniep commented 7 years ago

and in ./db/ is some bootstrap stuff? How does the test knows about this:

Chrome 53.0.2785 (Linux 0.0.0) EthereumService should unlock 
the default ethereum account with the password pw0 FAILED
simon991 commented 7 years ago

yes, I was about to write it right now: some of the ethereum tests will probably fail because the contracts are not deployed to the ethereum db of your container and the accounts are not created. but the first test, where we only test the connection should run anyway...

ChristianKniep commented 7 years ago

true that, I just copied the exact command you used and kick the tires once more. Let's see...

ChristianKniep commented 7 years ago
➜  docker-geth git:(master) ✗ docker exec -t drone_gQfQJPrJ1tQ_1 ps -efwww 
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 20:51 ?        00:00:00 /bin/bash /opt/start.sh
root         5     1  0 20:51 ?        00:00:00 geth --datadir ./db --nodiscover --port 30301 --rpc --rpcapi db,eth,net,web3,personal,shh --shh --rpcaddr localhost --rpccorsdomain * --rpcport 8545
root        13     0  0 20:53 ?        00:00:00 ps -efwww
➜  docker-geth git:(master) ✗ docker diff drone_gQfQJPrJ1tQ_1
A /db
A /db/geth
A /db/geth/LOCK
A /db/geth/chaindata
A /db/geth/chaindata/000002.log
A /db/geth/chaindata/CURRENT
A /db/geth/chaindata/LOCK
A /db/geth/chaindata/LOG
A /db/geth/chaindata/MANIFEST-000003
A /db/geth/nodekey
A /db/geth.ipc
A /db/keystore
A /drone
ChristianKniep commented 7 years ago

:?

[build:L54:69s] + ./test.sh
[build:L55:86s] 03 01 2017 20:53:17.249:DEBUG [config]: Loading config /drone/src/karma.conf.js
[build:L56:87s] 03 01 2017 20:53:19.103:DEBUG [config]: autoWatch set to false, because of singleRun
[build:L57:88s] 03 01 2017 20:53:19.105:DEBUG [plugin]: Loading inlined plugin (defining framework:jasmine).
[build:L58:88s] 03 01 2017 20:53:19.105:DEBUG [plugin]: Loading inlined plugin (defining launcher:Chrome, launcher:ChromeCanary, launcher:Chromium, launcher:Dartium, test).
[build:L59:88s] 03 01 2017 20:53:19.105:DEBUG [plugin]: Loading inlined plugin (defining reporter:karma-remap-istanbul).
[build:L60:88s] 03 01 2017 20:53:19.105:DEBUG [plugin]: Loading inlined plugin (defining framework:angular-cli, preprocessor:angular-cli, webpackPlugin, preprocessor:webpack, middleware:webpackBlocker, preprocessor:sourcemap).
[build:L61:88s] 03 01 2017 20:53:19.105:DEBUG [plugin]: Loading inlined plugin (defining launcher:Nightmare, screenshot, isNightmare).
[build:L62:88s] 03 01 2017 20:53:19.236:DEBUG [web-server]: Instantiating middleware
[build:L63:88s] 03 01 2017 20:53:19.277:DEBUG [reporter]: Trying to load reporter: karma-remap-istanbul
[build:L64:88s] 03 01 2017 20:53:19.278:DEBUG [reporter]: Trying to load color-version of reporter: karma-remap-istanbul (karma-remap-istanbul_color)
[build:L65:88s] 03 01 2017 20:53:19.279:DEBUG [reporter]: Couldn't load color-version.
500 Internal Server Error: dial unix /Users/kniepbert/Library/Containers/com.docker.docker/Data/*00000003.00000948: connect: connection refused
simon991 commented 7 years ago

but since we are discussing it right now :D it would be cool to use the ethereum db with the contracts and accounts also in that container. So we can also test their functionality

ChristianKniep commented 7 years ago

we're getting closer - I feel it. For starters: I didn't have CORS - that bits me all the time.

ChristianKniep commented 7 years ago

No I get I slightly different error:

before

Chrome 53.0.2785 (Linux 0.0.0) EthereumService should create a connection to the locally running Ethereum client with address http://localhost:8545 FAILED
[build:L126:137s]   Expected Error: CONNECTION ERROR: Couldn't connect to node http://localhost:8545. to be undefined.

now

Chrome 53.0.2785 (Linux 0.0.0) EthereumService should create a connection to the locally running Ethereum client with address http://localhost:8545 FAILED
[build:L126:116s]   Expected true to be falsy.

Hmm... Now the unit-test is not empty... :)

ChristianKniep commented 7 years ago

Does the connection rely on a password/username? Maybe we indeed need to bootstrap the DB in order to get it going.

simon991 commented 7 years ago

cool, it means its working now. The reason it fails is, because I check whether the default account could be set in the method that creates the connection to the ethereum client: // Check if the default account is set expect(typeof web3Ethereum.eth.defaultAccount === 'undefined').toBeFalsy();

But since there we didn't set up the accounts (and contracts) in the ethereum database of the container yet, the default account is undefined. ==> But it means the connection could be established, thats a good start :) see you tomorrow