After upgrading truffle to 5.0.40, my tests are no longer executed.
5.0.39 works correctly.
I've hit this on a couple projects now but I wasn't able to reproduce it in a barebones repository.
git clone [email protected]:unlock-protocol/unlock.git
cd unlock/smart-contracts
npm i truffle@latest
npm run build
npm run ganache
npm run test
Running truffle test compiles contracts, migrations are run, and it returns success but no tests are run.
Here's an example from the public repo Unlock-Protocol:
Unlock is currently using 5.0.37 which works as expected of course.
Here's a branch upgrading to 5.0.39 which also works as expected: https://circleci.com/gh/unlock-protocol/unlock/114715
And here's the branch upgrading to 5.0.40 which does not run tests: https://circleci.com/gh/unlock-protocol/unlock/114718
truffle version): 5.0.40node --version): 10.16.3npm --version): 6.12.0With the latest version of Truffle (5.0.40) I was able to run your tests successfully using the instructions above. For you, the last thing you see are the compilation messages?
Hmm that's strange. On my local machine I see the same results as the CI build I linked.
> cross-env NODE_ENV=test truffle test --network development
Using network 'development'.
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Deployed bytes4(keccak256(bytecode))
Unlock.bytecode: 0x67334ac6
Unlock.deployedBytecode: 0x056592f0
PublicLock.bytecode: 0x4e921189
PublicLock.deployedBytecode: 0x4a8ff40d
·----------------------------------------|---------------------------|-------------|----------------------------·
| Solc version: 0.5.12+commit.7709ece9 · Optimizer enabled: true · Runs: 200 · Block limit: 6721975 gas │
·········································|···························|·············|·····························
| Methods │
······················|··················|·············|·············|·············|·············|···············
| Contract · Method · Min · Max · Avg · # calls · usd (avg) │
·---------------------|------------------|-------------|-------------|-------------|-------------|--------------·
0 passing (2s)
I just confirmed the repo steps above on both Windows and on Linux. And of course we have the CI repros.
...Is it possible there's a global dependency conflict of some sort (?)
not sure how it works for you.
Yes it seems 5.0.40 doesn't run test located in ./test/** subfolders.
Like in my travis task here it produces 0 passing.
But if I put a .js in ./test folder it works properly for this file.
Oh I see, you have the truffle version pinned in the package.json. I think that was why it was passing for me. I was able to reproduce your bug, looks like we might have to adjust the mechanism that searches for files! Thanks for reporting this!
So here is the PR for the fix for this https://github.com/trufflesuite/truffle/pull/2468
Confirmed this is fixed with the 5.0.41 update. Thanks for the fast turn-around!
Most helpful comment
Confirmed this is fixed with the 5.0.41 update. Thanks for the fast turn-around!