Truffle: Contracts in a subdirectory are compiled every time running `truffle test`

Created on 21 Jul 2019  路  4Comments  路  Source: trufflesuite/truffle

  • [x] I've asked for help in the Truffle Gitter before filing this issue.

Issue

Discussed this with @CruzMolina & we believe this is a separate issue from https://github.com/trufflesuite/truffle/issues/469

I have a large number of contracts in a subdirectory for development purposes. I will never edit these contracts and therefore do not want to recompile them yet running truffle test recompiles all of these contracts every time.

Steps to Reproduce

  • Run truffle compile
  • Run truffle test

Expected Behavior

My understanding was you could prevent contracts in the contract folder from being recompiled by compiling them separately before running tests.

Actual Results

When I:

  • Run truffle compile
  • Run truffle test

All contracts in my subdirectory are recompiled every time. Full log output here:
https://gist.github.com/sbrichards/e057c51042bf509082bba35cb95d5498

Environment

  • Operating System: macOS Mojave 10.14.5.
  • Ethereum client: Ganache
$ truffle version
Truffle v5.0.21 (core: 5.0.21)
Solidity - 0.4.24 (solc-js)
Node v10.13.0
Web3.js v1.0.0-beta.37
needs investigated needs reproduced

Most helpful comment

The issue still persists in 5.0.39

Truffle v5.0.39 (core: 5.0.39)
Solidity - 0.5.12 (solc-js)
Node v10.15.1
Web3.js v1.2.1

Would it be better just to introduce a flag for truffle-config.js that if turned on would skip the compilation process at all when running truffle test?

All 4 comments

HI @sbrichards can you upgrade to the latest Truffle version and see if you issue is fixed? @CruzMolina tried to reproduce and everything seemed ok. Thanks!

@samajammin closing this for issue maintenance... but I have a feeling this hasn't gone away so let us know if you get the chance to try a newer version!

The issue still persists in 5.0.39

Truffle v5.0.39 (core: 5.0.39)
Solidity - 0.5.12 (solc-js)
Node v10.15.1
Web3.js v1.2.1

Would it be better just to introduce a flag for truffle-config.js that if turned on would skip the compilation process at all when running truffle test?

I'm getting this also in CircleCI. I am caching and restoring the build folder between processes - is there a tmp file or some such where truffle caches the last compilation time? Either way, a flag on truffle test seems like an easy win.

Was this page helpful?
0 / 5 - 0 ratings