Conversation
|
|
This PR changes implementation code, but doesn't include a changeset. Did you forget to add one? |
afe9409 to
a443f95
Compare
a443f95 to
883e4bc
Compare
883e4bc to
56d656e
Compare
|
Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review. |
smartcontracts
left a comment
There was a problem hiding this comment.
I really like this refactor. It makes holes in test coverage much more obvious. Thanks!
packages/contracts-bedrock/contracts/test/CrossDomainOwnable.t.sol
Outdated
Show resolved
Hide resolved
d1b29e1 to
2383689
Compare
| } | ||
| } | ||
|
|
||
| contract Encoding_EncodeVersionedNonce_TestFail is Encoding_TestInit { |
There was a problem hiding this comment.
Why is this included if there are none?
There was a problem hiding this comment.
The intention is to express that I've actually thought about whether or not there are any sad path tests that could be written here, and determined that there are none.
I like having it, but I'm not attached to it.
| @@ -0,0 +1,77 @@ | |||
| import fs from 'fs' | |||
There was a problem hiding this comment.
Should this script run as part of CI?
There was a problem hiding this comment.
eventually yes, but I haven't yet gone through all the test files.
There was a problem hiding this comment.
It would fail if run in CI now.
|
Generally makes sense, I think we need to document the guidelines in the readme that you posted here Also this PR needs a rebase to fix the conflicts with the more files |
4ec2ee1 to
a61feaa
Compare
|
@tynes |
|
Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review. |
Accept suggestion Co-authored-by: smartcontracts <kelvin@optimism.io>
a61feaa to
55306da
Compare
|
Hey @maurelian! This PR has merge conflicts. Please fix them before continuing review. |
|
Not a priority right now. Setting to draft. |
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Description
Furthers the work of reorganizing the forge tests, which was begun in #3611.
Test organizing principles
contracts to organize the test suite similar to how mocha usesdescribe.Test naming convention
Test function names are split by underscores, into 3 or 4 parts. An example function name is
test_onlyOwner_callerIsNotOwner_reverts().The parts are:
[method]_[FunctionName]_[reason]_[success], where:[method]is eithertestortestFuzz[FunctionName]is the name of the function or higher level behavior being tested.[reason]is an optional description for the behavior being tested.[success]must be one ofsuccessorrevertsor_fails.Name validation
I also wrote a quick and dirty script which can be run to validate function names and identify ones which are not yet compliant. From within the bedrock package:
ts-node scripts/forges-test-names.ts.It will error, because there are still test files which haven't yet been cleaned up.