-
Notifications
You must be signed in to change notification settings - Fork 43
Switch mock generation from **moq** to **mockery** (build-tag test) markdown
#877
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| all: true | ||
| mock-build-tags: "test" | ||
| with-expecter: true | ||
| inpackage: true | ||
| recursive: true | ||
|
|
||
| packages: | ||
| nil/nil/client: {} | ||
| nil/internal/db: {} | ||
| nil/internal/vm: {} | ||
| nil/services/rollup: {} | ||
|
|
||
| include-regex: '^(Client|DB|RwTx|StateDBReadOnly|L1BlockFetcher)$' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are still plenty of types used for mock generation which are not covered here |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,9 +20,9 @@ $(root_relayer)/generate_l1_abi: $(root_relayer)/embed_l1_abi | |
|
|
||
| .PHONY: $(root_relayer)/gen_l1_mocks | ||
| $(root_relayer)/gen_l1_mocks: $(root_relayer)/generate_l1_abi | ||
| cd $(root_relayer)/internal/l1 && go run github.com/matryer/moq -out eth_client_generated_mock.go -rm -stub -with-resets . EthClient | ||
| cd $(root_relayer)/internal/l1 && go run github.com/matryer/moq -out l1_contract_generated_mock.go -rm -stub -with-resets . L1Contract | ||
| cd $(root_relayer)/internal/l1 && mockery --name=EthClient | ||
| cd $(root_relayer)/internal/l1 && mockery --name=L1Contract | ||
|
|
||
| .PHONY: $(root_relayer)/gen_l2_mocks | ||
| $(root_relayer)/gen_l2_mocks: $(root_relayer)/embed_l2_abi | ||
| cd $(root_relayer)/internal/l2 && go run github.com/matryer/moq -out l2_contract_generated_mock.go -rm -stub -with-resets . L2Contract | ||
| cd $(root_relayer)/internal/l2 && mockery --name=L2Contract | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you try to build a project? |
||
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.
As far as I see,
mockeryhas a completely different API for assertions in comparison tomoqSo, all existing tests should also be adjusted