-
Notifications
You must be signed in to change notification settings - Fork 37
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
Coverage ignore large test #486
Conversation
…ntracts into coverage_ignore_large_test
I don't think that this is happening, is it? Currently, we are only running coverage tests, as otherwise many tests would be run twice! |
I am going to try putting the large test into its own file and running this test independently via
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to only run tests with the @skip-on-coverage
for the second step of the test? That way if we add more tests that should be skipped they automatically get picked up?
This is likely possible, but I will have to dig into the |
@nlordell - I wonder if it would be reasonable to restructure the test folder one for which we run |
That could work, don’t know enough about truffle test to tell you if that’s the best way to go though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice... looks real good.
Now, that we are running the test no longer in the coverage mode, we could also reduce the constant
const sixPointFiveMillion = 6500000
to 5.5 M
I like the idea of grepping on @solidity-no-coverage to make sure all tests are run in either mode. However, looks like the grep is not yet supported for regular truffle test: trufflesuite/truffle#2080 |
Will do. |
How about we land this for now and create an issue for the future (i.e. when this is available in truffle) |
Sure, but then we should probably remove the |
Those mocha options are not in the truffle config, they are in the coverage config and they are necessary for our coverage to ignore the gas estimation test. I will update the PR description to summarize the changes introduced here. |
Oops! My bad. So running |
|
Based on the solidity-coverage advanced usage guide here
we are able to ignore the tests with the
@skip-on-coverage
tag included in the test message.This is directly advised as the proper use from their readme
Note that, in order for the test ignored during coverage to be executed, we have moved it into a separate file and included an additional truffle test for this file. This is not ideal, but does work as expected without executing any tests twice.