Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also test gnosis contracts. #2818

Merged
merged 3 commits into from
Feb 13, 2018
Merged

Also test gnosis contracts. #2818

merged 3 commits into from
Feb 13, 2018

Conversation

chriseth
Copy link
Contributor

No description provided.

@chriseth
Copy link
Contributor Author

I had some local failures, we might need node 7.

@axic
Copy link
Member

axic commented Aug 25, 2017

Fails with this:


> @gnosis.pm/[email protected] test /tmp/tmp.XGMmD5sn74/gnosis-contracts
> run-with-testrpc -l 40000000 'truffle test'
Error: testrpc exited with code 1 and the following error:
    at ChildProcess.testrpc.on (/tmp/tmp.XGMmD5sn74/gnosis-contracts/node_modules/run-with-testrpc/bin/run-with-testrpc.js:45:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:891:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

@axic
Copy link
Member

axic commented Sep 14, 2017

@Georgi87 any idea why this fails?

> @gnosis.pm/[email protected] prepublish /tmp/tmp.5GXUse2BHK
> eslint . && node scripts/measure_gas_stats.js && truffle compile && truffle networks --clean && node scripts/inject_network_info.js
> @gnosis.pm/[email protected] test /tmp/tmp.5GXUse2BHK
> run-with-testrpc -l 40000000 'truffle test'
Error: testrpc exited with code 1 and the following error:
    at ChildProcess.testrpc.on (/tmp/tmp.5GXUse2BHK/node_modules/run-with-testrpc/bin/run-with-testrpc.js:45:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm ERR! Test failed.  See above for more details.
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT: no such file or directory, open 'build/gas-stats.json'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:491:33)
    at Object.<anonymous> (/tmp/tmp.5GXUse2BHK/scripts/measure_gas_stats.js:31:32)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-93-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v7.10.1/bin/node" "/home/travis/.nvm/versions/node/v7.10.1/bin/npm" "install"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @gnosis.pm/[email protected] prepublish: `eslint . && node scripts/measure_gas_stats.js && truffle compile && truffle networks --clean && node scripts/inject_network_info.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @gnosis.pm/[email protected] prepublish script 'eslint . && node scripts/measure_gas_stats.js && truffle compile && truffle networks --clean && node scripts/inject_network_info.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @gnosis.pm/gnosis-core-contracts package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint . && node scripts/measure_gas_stats.js && truffle compile && truffle networks --clean && node scripts/inject_network_info.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @gnosis.pm/gnosis-core-contracts
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @gnosis.pm/gnosis-core-contracts
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/.npm/_logs/2017-09-13T22_59_05_473Z-debug.log

@cag
Copy link

cag commented Sep 14, 2017

Hmm, that error recently started to appear in the node 7 CI builds of gnosis contracts. I haven't figured why, but the test runner also generates the gas-stats.json, so that accounts for the second issue. It passes in the node 8 CI builds, so yeah this is a mystery. I'll install node 7 on my machine to check this out soon.

@axic
Copy link
Member

axic commented Sep 14, 2017

@cag thanks! We also tried node 6 to no avail (that is the version our CI runs on currently and everything else works).

@cag
Copy link

cag commented Sep 15, 2017

@axic Okay I think I got to the bottom of this. Basically, it's my fault and I'm very sorry 😅

Unfortunately, the test suite won't work with node 6 as it makes quite liberal use of async/await syntax, which was introduced in 7 iirc.

As for the spawn testrpc ENOENT issue, it is from here: gnosis/run-with-testrpc#1

I have a PR to address this here: gnosis/pm-contracts#46

Hopefully that's all!

@axic
Copy link
Member

axic commented Sep 15, 2017

@cag that seems to mean we could use with Node 7? That's great news!

Can you ping us when it is merged? (We run our tests against master. Is there a release branch we should rather use?)

@cag
Copy link

cag commented Sep 15, 2017

@axic Yep, master is fine. Releases are just tagged. Fix branch is merged. LMK if you would like a release cut on NPM or anything.

@axic
Copy link
Member

axic commented Sep 16, 2017

@cag it seems we still have some issues, are we doing something wrong?

> @gnosis.pm/[email protected] test /tmp/tmp.rlw39r9BXg
> run-with-testrpc -l 40000000 'truffle test'
Error: testrpc exited with code 1 and the following error:
    at ChildProcess.testrpc.on (/tmp/tmp.rlw39r9BXg/node_modules/run-with-testrpc/bin/run-with-testrpc.js:45:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm ERR! Test failed.  See above for more details.
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT: no such file or directory, open 'build/gas-stats.json'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:491:33)
    at Object.<anonymous> (/tmp/tmp.rlw39r9BXg/scripts/measure_gas_stats.js:31:32)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)

@cag
Copy link

cag commented Sep 16, 2017

I don't believe so. This is really strange. I'll have to try running that script. The testrpc failure didn't come with a lot of diagnostics unfortunately, so if there is a way to get more information, I'll push up a diagnostics upgrade.

@cag
Copy link

cag commented Sep 18, 2017

@axic This is really strange. I ran scripts/test_emscripten.sh locally after I had rebuilt the project on this branch and copied the nightly soljson.js into the SOLJSON build location. It failed due to the compiler pragma mismatch, as it should, and there was no issue getting past the build step where it runs the instrumented test for the prepublish step (specifically the measure_gas_stats.js script). Specifically, I saw:

> @gnosis.pm/[email protected] test /tmp/tmp.0swtEwsjXT
> run-with-testrpc -l 40000000 'truffle test'

No local truffle config found. Using all defaults...
Compiling ./contracts/Events/CategoricalEvent.sol...

I was thinking that maybe it had to do with the prepublish hook, but that seems unlikely, since the test-runner also relies on run-with-testrpc. Still, if there is the possibility, maybe this branch might do the trick? https://github.com/gnosis/gnosis-contracts/tree/prepublish-only (the only reason I don't already use prepublishOnly is because of this: npm/npm#15147)

Another possibility that crossed my mind is that maybe the Zeppelin test runner's testrpc process had not finished terminating by the time the new testrpc for gnosis started getting spun up. Still, this seems like a very unlikely possibility since it takes quite a while for the Gnosis repo to get set up, and there's I doubt that the Zeppelin process wasn't successful at killing testrpc.

Something weird I noticed is that the error testrpc reported actually seems cut off!? Very helpful... I know that run-with-testrpc only accumulates stuff from the stderr pipe of the testrpc process, so maybe the error reporting began in stdout. I didn't want to accumulate stdout data originally since that would have resulted in some very messy output, as well as heavy memory usage, but maybe this means that I should start tracking the last few stdouts as well to get the whole error... or just let testrpc output to the same terminal... hmm...

I'm using node v7.10.1 and npm v4.2.0. Not going to lie... I am pretty stumped right now, esp. since I am unable to locally reproduce this.

@axic
Copy link
Member

axic commented Sep 18, 2017

Rebased and pushed, lets see again.

@cag tried locally on a mac (the first part seems to work, but it fails later):

> @gnosis.pm/[email protected] test /private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL
> run-with-testrpc -l 40000000 'truffle test'

No local truffle config found. Using all defaults...
Using network 'development'.

Compiling ./contracts/Utils/Math.sol...
Compiling ./test/solidity/TestMath.sol...
Compiling truffle/Assert.sol...
Compiling truffle/DeployedAddresses.sol...

Compilation warnings encountered:

Warning: This is a pre-release compiler version, please do not use it in production.
,/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL/contracts/Utils/Math.sol:182:18: Warning: This declaration shadows an existing declaration.
        returns (int max)
                 ^-----^
/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL/contracts/Utils/Math.sol:179:5: The shadowed declaration is here:
    function max(int[] nums)
    ^
Spanning multiple lines.

,truffle/Assert.sol:114:20: Warning: This declaration shadows an existing declaration.
    function equal(string A, string B, string message) constant returns (bool result) {
                   ^------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:137:23: Warning: This declaration shadows an existing declaration.
    function notEqual(string A, string B, string message) constant returns (bool result) {
                      ^------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:206:20: Warning: This declaration shadows an existing declaration.
    function equal(bytes32 A, bytes32 B, string message) constant returns (bool result) {
                   ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:226:23: Warning: This declaration shadows an existing declaration.
    function notEqual(bytes32 A, bytes32 B, string message) constant returns (bool result) {
                      ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:286:20: Warning: This declaration shadows an existing declaration.
    function equal(address A, address B, string message) constant returns (bool result) {
                   ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:305:23: Warning: This declaration shadows an existing declaration.
    function notEqual(address A, address B, string message) constant returns (bool result) {
                      ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:403:20: Warning: This declaration shadows an existing declaration.
    function equal(bool A, bool B, string message) constant returns (bool result) {
                   ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:426:23: Warning: This declaration shadows an existing declaration.
    function notEqual(bool A, bool B, string message) constant returns (bool result) {
                      ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:451:20: Warning: This declaration shadows an existing declaration.
    function equal(uint A, uint B, string message) constant returns (bool result) {
                   ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:474:23: Warning: This declaration shadows an existing declaration.
    function notEqual(uint A, uint B, string message) constant returns (bool result) {
                      ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:497:22: Warning: This declaration shadows an existing declaration.
    function isAbove(uint A, uint B, string message) constant returns (bool result) {
                     ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:520:24: Warning: This declaration shadows an existing declaration.
    function isAtLeast(uint A, uint B, string message) constant returns (bool result) {
                       ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:543:22: Warning: This declaration shadows an existing declaration.
    function isBelow(uint A, uint B, string message) constant returns (bool result) {
                     ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:566:23: Warning: This declaration shadows an existing declaration.
    function isAtMost(uint A, uint B, string message) constant returns (bool result) {
                      ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:635:20: Warning: This declaration shadows an existing declaration.
    function equal(int A, int B, string message) constant returns (bool result) {
                   ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:658:23: Warning: This declaration shadows an existing declaration.
    function notEqual(int A, int B, string message) constant returns (bool result) {
                      ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:681:22: Warning: This declaration shadows an existing declaration.
    function isAbove(int A, int B, string message) constant returns (bool result) {
                     ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:704:24: Warning: This declaration shadows an existing declaration.
    function isAtLeast(int A, int B, string message) constant returns (bool result) {
                       ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:727:22: Warning: This declaration shadows an existing declaration.
    function isBelow(int A, int B, string message) constant returns (bool result) {
                     ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:750:23: Warning: This declaration shadows an existing declaration.
    function isAtMost(int A, int B, string message) constant returns (bool result) {
                      ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1267:27: Warning: This declaration shadows an existing declaration.
    function balanceEqual(address A, uint b, string message) constant returns (bool result) {
                          ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1287:30: Warning: This declaration shadows an existing declaration.
    function balanceNotEqual(address A, uint b, string message) constant returns (bool result) {
                             ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1306:28: Warning: This declaration shadows an existing declaration.
    function balanceIsZero(address A, string message) constant returns (bool result) {
                           ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1325:31: Warning: This declaration shadows an existing declaration.
    function balanceIsNotZero(address A, string message) constant returns (bool result) {
                              ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^



Warning: This is a pre-release compiler version, please do not use it in production.
,/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL/contracts/Utils/Math.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.4.17-nightly.2017.9.6 commit.59223061.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity 0.4.15;
^---------------------^
,/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL/test/solidity/TestMath.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.4.17-nightly.2017.9.6 commit.59223061.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity 0.4.15;
^---------------------^
,/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL/contracts/Utils/Math.sol:182:18: Warning: This declaration shadows an existing declaration.
        returns (int max)
                 ^-----^
/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL/contracts/Utils/Math.sol:179:5: The shadowed declaration is here:
    function max(int[] nums)
    ^
Spanning multiple lines.

,truffle/Assert.sol:114:20: Warning: This declaration shadows an existing declaration.
    function equal(string A, string B, string message) constant returns (bool result) {
                   ^------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:137:23: Warning: This declaration shadows an existing declaration.
    function notEqual(string A, string B, string message) constant returns (bool result) {
                      ^------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:206:20: Warning: This declaration shadows an existing declaration.
    function equal(bytes32 A, bytes32 B, string message) constant returns (bool result) {
                   ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:226:23: Warning: This declaration shadows an existing declaration.
    function notEqual(bytes32 A, bytes32 B, string message) constant returns (bool result) {
                      ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:286:20: Warning: This declaration shadows an existing declaration.
    function equal(address A, address B, string message) constant returns (bool result) {
                   ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:305:23: Warning: This declaration shadows an existing declaration.
    function notEqual(address A, address B, string message) constant returns (bool result) {
                      ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:403:20: Warning: This declaration shadows an existing declaration.
    function equal(bool A, bool B, string message) constant returns (bool result) {
                   ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:426:23: Warning: This declaration shadows an existing declaration.
    function notEqual(bool A, bool B, string message) constant returns (bool result) {
                      ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:451:20: Warning: This declaration shadows an existing declaration.
    function equal(uint A, uint B, string message) constant returns (bool result) {
                   ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:474:23: Warning: This declaration shadows an existing declaration.
    function notEqual(uint A, uint B, string message) constant returns (bool result) {
                      ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:497:22: Warning: This declaration shadows an existing declaration.
    function isAbove(uint A, uint B, string message) constant returns (bool result) {
                     ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:520:24: Warning: This declaration shadows an existing declaration.
    function isAtLeast(uint A, uint B, string message) constant returns (bool result) {
                       ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:543:22: Warning: This declaration shadows an existing declaration.
    function isBelow(uint A, uint B, string message) constant returns (bool result) {
                     ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:566:23: Warning: This declaration shadows an existing declaration.
    function isAtMost(uint A, uint B, string message) constant returns (bool result) {
                      ^----^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:635:20: Warning: This declaration shadows an existing declaration.
    function equal(int A, int B, string message) constant returns (bool result) {
                   ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:658:23: Warning: This declaration shadows an existing declaration.
    function notEqual(int A, int B, string message) constant returns (bool result) {
                      ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:681:22: Warning: This declaration shadows an existing declaration.
    function isAbove(int A, int B, string message) constant returns (bool result) {
                     ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:704:24: Warning: This declaration shadows an existing declaration.
    function isAtLeast(int A, int B, string message) constant returns (bool result) {
                       ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:727:22: Warning: This declaration shadows an existing declaration.
    function isBelow(int A, int B, string message) constant returns (bool result) {
                     ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:750:23: Warning: This declaration shadows an existing declaration.
    function isAtMost(int A, int B, string message) constant returns (bool result) {
                      ^---^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1267:27: Warning: This declaration shadows an existing declaration.
    function balanceEqual(address A, uint b, string message) constant returns (bool result) {
                          ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1287:30: Warning: This declaration shadows an existing declaration.
    function balanceNotEqual(address A, uint b, string message) constant returns (bool result) {
                             ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1306:28: Warning: This declaration shadows an existing declaration.
    function balanceIsZero(address A, string message) constant returns (bool result) {
                           ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^

,truffle/Assert.sol:1325:31: Warning: This declaration shadows an existing declaration.
    function balanceIsNotZero(address A, string message) constant returns (bool result) {
                              ^-------^
truffle/Assert.sol:64:5: The shadowed declaration is here:
    uint8 constant A = uint8(byte('a'));
    ^---------------------------------^
Compiliation failed. See above.
{ Error: Command failed: truffle test
    at checkExecSyncError (child_process.js:481:13)
    at execSync (child_process.js:521:13)
    at Promise.then (/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.3eNeVSTL/node_modules/run-with-testrpc/bin/run-with-testrpc.js:49:5)
    at process._tickCallback (internal/process/next_tick.js:109:7)
  error: null,
  cmd: 'truffle test',
  file: '/bin/sh',
  args: [ '/bin/sh', '-c', 'truffle test' ],

@cag
Copy link

cag commented Sep 18, 2017 via email

@axic
Copy link
Member

axic commented Sep 19, 2017

@cag good news, I think it is sorted now both on Travis and CircleCI, the only problem left is the code using pragma experimental 0.4.15;.

@cag
Copy link

cag commented Sep 19, 2017

Great! Something like find contracts -type f -print0 | xargs -0 sed -i -e 's/pragma 0/pragma ^0/' should work.

Edit: bleh writing shell scripts on a phone
Edit 2: vanilla sh compatibility

git clone --depth 1 "$repo" "$DIR"
cd "$DIR"
npm install
cp "$SOLJSON" ./node_modules/solc/soljson.js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • find contracts -type f -print0 | xargs -0 sed -i -e 's/pragma 0/pragma ^0/'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed solidity after pragma :)

@axic axic force-pushed the testGnosis branch 2 times, most recently from e750429 to b605b21 Compare September 19, 2017 12:41
@cag
Copy link

cag commented Sep 19, 2017 via email

@axic
Copy link
Member

axic commented Sep 19, 2017

So it runs finally locally, but not sure what is going on. It seems to run it 3 times and from the second time on the pragma is back to unchanged.

Lets see what will happen on Travis.

@cag
Copy link

cag commented Sep 19, 2017

@axic >_< I forgot to account for Solidity tests with the pragma directive.

Here is a better command: find contracts test -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity 0/pragma solidity ^0/'

Edit: It didn't run locally until I changed the command. It just passed for me. Hopefully that's what CI was concerned about.

@axic
Copy link
Member

axic commented Sep 19, 2017

Getting closer :)

  Contract: Market
    ✓ can be created and closed (641ms)
    ✓ should allow buying and selling (2040ms)
    ✓ should allow short selling (1897ms)
    1) should be created by a successful campaign

    Events emitted during test:
    ---------------------------

    CentralizedOracleCreation(creator: <indexed>, centralizedOracle: 0xd30d6021ea63631963c79bb6d9f45633d67426b6, ipfsHash: 0x516d597741504a7a7635435a736e4136323573335866326e656d7459675070486457457a37396f6a576e50626447)
    OutcomeTokenCreation(outcomeToken: 0xbad60007bd34d76a990f66d6b3e639467f9c54b9, index: 0)
    OutcomeTokenCreation(outcomeToken: 0x5bc0aaae305c8a322ff4f477b8f2a0f61d22956e, index: 1)
    CategoricalEventCreation(creator: <indexed>, categoricalEvent: 0xa75a3b9f91bbb123563a66deb6f8c59629303918, collateralToken: 0xb19f4e80ed054a0350025c63f6e163c3d6bfece3, oracle: 0xd30d6021ea63631963c79bb6d9f45633d67426b6, outcomeCount: 2)
    CampaignCreation(creator: <indexed>, campaign: 0xb09e37bb60e3750ebc1a1adb77331581fd1ca707, eventContract: 0xa75a3b9f91bbb123563a66deb6f8c59629303918, marketFactory: 0x1a8b644068f20828a02fe88c2efef7cec31b8c42, marketMaker: 0x21a4e22bbdc5f3fb5ba41f2382e67cc465c11748, fee: 50000, funding: 1000000000000000000, deadline: 1505865175)
    Deposit(sender: <indexed>, value: 750000000000000000)
    Approval(owner: <indexed>, spender: <indexed>, value: 750000000000000000)
    Transfer(from: <indexed>, to: <indexed>, value: 750000000000000000)
    CampaignFunding(sender: <indexed>, funding: 750000000000000000)
    Deposit(sender: <indexed>, value: 250000000000000000)
    Approval(owner: <indexed>, spender: <indexed>, value: 250000000000000000)

    ---------------------------
    ✓ should not be created by an unsuccessful campaign (710ms)

  Contract: Math
    ✓ should compute ln (727ms)
    ✓ should compute exp (769ms)
    ✓ should compute max (417ms)

  Contract: Oracle
    ✓ should test centralized oracle (424ms)
    ✓ should test difficulty oracle (245ms)
    ✓ can create futarchy oracles in the future, but not the past (820ms)
    ✓ should test futarchy oracle (2608ms)
    ✓ should test majority oracle (883ms)
    ✓ should test ultimate oracle (1374ms)
    ✓ should test ultimate oracle challenge period (403ms)


  21 passing (59s)
  1 failing

  1) Contract: Market should be created by a successful campaign:
     AssertionError: expected { Object (s, e, ...) } to equal 1
      at it (test/javascript/test_markets.js:221:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)

@axic
Copy link
Member

axic commented Sep 19, 2017

Also for some reason it runs twice plus some kind of gas estimation in the middle.

@axic
Copy link
Member

axic commented Sep 20, 2017

It seems to also fail with stock version, without changing the compiler. @cag do you see that happening?

@cag
Copy link

cag commented Sep 20, 2017

The Travis build seems to be alright??

But yeah, it does run twice. Once is due to the prepublish task, which fires during installs to prepare the package (I would prefer it only do this stuff right before publishing but I haven't found a good way yet), mainly so gas estimations based on the test suite are available.

Anyway, this is weird. The source repo has CI on it so it should still work...??? I'll look into it tomorrow.

@axic
Copy link
Member

axic commented Sep 20, 2017

@cag it seems travis is fine (and will fix circle as it was running node 6). It still fails on my local computer, maybe it is a bug somewhere or my computer is broken.

Do you want to investigate reasons? :)

@cag
Copy link

cag commented Oct 20, 2017

@axic I just did this: gnosis/pm-contracts#59
So that whole step prepublish on install step is skipped for you. It's really only relevant for the publisher. The tests should run fine otherwise.
Also don't know why the error message for testrpc is cutting off D':

@axic
Copy link
Member

axic commented Oct 23, 2017

@cag I don't know what's going on but I can imagine this is very frustrating at this point (I am just running the script: ./test/externalTests.sh <absolute path to soljson.j>

After your latest changes (well, git master from 30 minutes ago):

> @gnosis.pm/[email protected] test /private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.tEUkodmL
> run-with-testrpc -l 20000000 'truffle test --network testing'

Error: testrpc exited with code 1 and the following error:


    at ChildProcess.testrpc.on (/private/var/folders/8g/rhqxpd5s0f39vcp_gbhfk2p00000gn/T/tmp.tEUkodmL/node_modules/run-with-testrpc/bin/run-with-testrpc.js:45:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:511:12)

@cag
Copy link

cag commented Oct 23, 2017

It seems like run-with-testrpc is still having issues on your setup. It's really strange that I don't actually get to see what the error is... :/

I'm going to try doing this on a macOS. Maybe that'll give me more clues.

@axic I just used a macOS Sierra VPS, put node 7.10.1 and npm 5.5.1 on it, and ran the tests with the nightly soljson.js from this branch with this result:

it worked, but whyy

So good/bad news: it worked. 😖

@axic
Copy link
Member

axic commented Nov 4, 2017

It works without problems on El Capitan 10.11.6 Xcode 8.0 node 8.9.0 npm 5.5.1. It doesn't work (for me) on latest Mac Xcode 9 I think node 7 something. Will need to try with a different node on that machine, but that wont happen for a week.

@cag
Copy link

cag commented Nov 4, 2017 via email

@axic
Copy link
Member

axic commented Nov 16, 2017

The failing machine has Sierra 10.12.6 Xcode 9.0 node 7.1.0.1 npm 4.2.0.

@cag did you had any success running it on such a setup?

@cag
Copy link

cag commented Nov 16, 2017

Not yet, but I'll look into procuring such a setup.

@pirapira
Copy link
Member

pirapira commented Dec 6, 2017

Please rebase.

@axic
Copy link
Member

axic commented Dec 6, 2017

@pirapira since you have a Mac would you be able to run this with either of the two mentioned configurations? The failure on one is blocking the merge of this, maybe it is an isolated issue to a single computer.

@pirapira
Copy link
Member

pirapira commented Dec 6, 2017

@axic I'll try.

@pirapira
Copy link
Member

pirapira commented Dec 6, 2017

I got stuck with an irrelevant issue

In file included from /Users/yh/shared/solidity/libsolidity/interface/CompilerStack.cpp:49:
/Users/yh/shared/solidity/libdevcore/JSON.h:33:15: error: 'StyledWriter' is deprecated: Use StreamWriterBuilder instead [-Werror,-Wdeprecated-declarations]
        return Json::StyledWriter().write(_input);

I'll solve this on develop first. [edit] Ahh, I just had to brew remove jsoncpp --force.

@pirapira
Copy link
Member

pirapira commented Dec 6, 2017

I get

$ scripts/test_emscripten.sh
cp: /Users/yh/shared/solidity/build/solc/soljson.js: No such file or directory

Somehow I need to build soljson.js.

@axic
Copy link
Member

axic commented Dec 8, 2017

Somehow I need to build soljson.js.

Just download the latest release from solc-bin. Well, better to download some nightly around 4th of November, because that definitely triggered it, but now I cannot test if the latest one triggers it.

@axic
Copy link
Member

axic commented Feb 12, 2018

Rebased.

@@ -97,12 97,12 @@ matrix:
sudo: required
compiler: gcc
node_js:
- "6"
- "7"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should upgrade to 8 instead, see #3485

@axic
Copy link
Member

axic commented Feb 13, 2018

This works on CI as well as locally. Ready to merge! 🍾

@chriseth chriseth merged commit a75d4ec into develop Feb 13, 2018
@axic axic deleted the testGnosis branch February 13, 2018 10:54
@axic
Copy link
Member

axic commented Feb 13, 2018

@cag finally merged! Be prepared for complaints if you break something and that stalls the Solidity build pipeline 😉

@cag
Copy link

cag commented Feb 13, 2018

Omg, thanks a bunch!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants