From ddc7030e1c9318d8fc8c42cfa85aabe5604f5085 Mon Sep 17 00:00:00 2001 From: Lemma199 Date: Wed, 31 May 2023 10:40:57 -0400 Subject: [PATCH 1/5] chore: add make target in op-node to generate mocks --- op-node/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/op-node/Makefile b/op-node/Makefile index e5583432589d..80bce8a2b328 100644 --- a/op-node/Makefile +++ b/op-node/Makefile @@ -37,10 +37,13 @@ fuzz: go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzRejectCreateBlockBadTimestamp ./rollup/driver go test -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzDecodeDepositTxDataToL1Info ./rollup/driver +generate-mocks: + go generate ./... .PHONY: \ op-node \ clean \ test \ lint \ - fuzz + fuzz \ + generate-mocks From 7751a3d4b11f263ddd81a96ff9a685d38842389a Mon Sep 17 00:00:00 2001 From: Lemma199 Date: Wed, 31 May 2023 10:41:09 -0400 Subject: [PATCH 2/5] chore: add make target in op-service to generate mocks --- op-service/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/op-service/Makefile b/op-service/Makefile index a52fd04c937a..7de03d5600de 100644 --- a/op-service/Makefile +++ b/op-service/Makefile @@ -4,6 +4,10 @@ test: lint: golangci-lint run -E asciicheck,goimports,misspell ./... +generate-mocks: + go generate ./... + .PHONY: \ test \ - lint + lint \ + generate-mocks From 17159818310c63ac088e95a4abd9b1760ecbbec9 Mon Sep 17 00:00:00 2001 From: Lemma199 Date: Wed, 31 May 2023 10:41:40 -0400 Subject: [PATCH 3/5] chore: add top level make targets to generate mocks --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 3f6f3a9b37f1..5290fa0fc380 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,14 @@ op-node: make -C ./op-node op-node .PHONY: op-node +generate-mocks-op-node: + make -C ./op-node generate-mocks +.PHONY: generate-mocks-op-node + +generate-mocks-op-service: + make -C ./op-service generate-mocks +.PHONY: generate-mocks-op-service + op-batcher: make -C ./op-batcher op-batcher .PHONY: op-batcher From 2e0c836e432448664dbd71ae9cac7415152580ec Mon Sep 17 00:00:00 2001 From: Lemma199 Date: Wed, 31 May 2023 10:42:14 -0400 Subject: [PATCH 4/5] ci: add checks for generated mocks in op-node and op-service --- .circleci/config.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1eeab2190475..42512e07fe2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -738,7 +738,6 @@ jobs: environment: CI: true - go-lint: parameters: module: @@ -1147,6 +1146,28 @@ jobs: event: fail template: basic_fail_1 + check-generated-mocks-op-node: + docker: + - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest + steps: + - checkout + - check-changed: + patterns: op-node + - run: + name: check-generated-mocks + command: make generate-mocks-op-node && git diff --exit-code + + check-generated-mocks-op-service: + docker: + - image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest + steps: + - checkout + - check-changed: + patterns: op-service + - run: + name: check-generated-mocks + command: make generate-mocks-op-service && git diff --exit-code + workflows: main: jobs: @@ -1523,6 +1544,8 @@ workflows: - op-batcher-docker-build - op-proposer-docker-build - op-challenger-docker-build + - check-generated-mocks-op-node + - check-generated-mocks-op-service release: jobs: - hold: From a0fe574ea44c8df8dfebb49374a423451f6b2eba Mon Sep 17 00:00:00 2001 From: Lemma199 Date: Tue, 6 Jun 2023 19:13:47 -0400 Subject: [PATCH 5/5] chore: update generated mocks in op-node and op-service --- op-node/p2p/gating/mocks/BlockingConnectionGater.go | 2 +- op-node/p2p/gating/mocks/ExpiryStore.go | 2 +- op-node/p2p/gating/mocks/Scores.go | 2 +- op-node/p2p/mocks/GossipMetricer.go | 2 +- op-node/p2p/mocks/Peerstore.go | 2 +- op-node/p2p/mocks/ScoreMetrics.go | 2 +- op-node/p2p/monitor/mocks/PeerManager.go | 2 +- op-service/txmgr/mocks/TxManager.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/op-node/p2p/gating/mocks/BlockingConnectionGater.go b/op-node/p2p/gating/mocks/BlockingConnectionGater.go index afd2d1952cc4..7d289aebd057 100644 --- a/op-node/p2p/gating/mocks/BlockingConnectionGater.go +++ b/op-node/p2p/gating/mocks/BlockingConnectionGater.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.28.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/op-node/p2p/gating/mocks/ExpiryStore.go b/op-node/p2p/gating/mocks/ExpiryStore.go index 3d0f79b2d26e..f4c3faf81f40 100644 --- a/op-node/p2p/gating/mocks/ExpiryStore.go +++ b/op-node/p2p/gating/mocks/ExpiryStore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.28.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/op-node/p2p/gating/mocks/Scores.go b/op-node/p2p/gating/mocks/Scores.go index 2d9b44dae013..eec399f831cc 100644 --- a/op-node/p2p/gating/mocks/Scores.go +++ b/op-node/p2p/gating/mocks/Scores.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.28.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/op-node/p2p/mocks/GossipMetricer.go b/op-node/p2p/mocks/GossipMetricer.go index d7848e7ba099..d5da6438212f 100644 --- a/op-node/p2p/mocks/GossipMetricer.go +++ b/op-node/p2p/mocks/GossipMetricer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.28.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/op-node/p2p/mocks/Peerstore.go b/op-node/p2p/mocks/Peerstore.go index 8c9f51b8fd61..9e49aaf3e1fc 100644 --- a/op-node/p2p/mocks/Peerstore.go +++ b/op-node/p2p/mocks/Peerstore.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.28.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/op-node/p2p/mocks/ScoreMetrics.go b/op-node/p2p/mocks/ScoreMetrics.go index 8ba2b7966eda..7e04e44116ae 100644 --- a/op-node/p2p/mocks/ScoreMetrics.go +++ b/op-node/p2p/mocks/ScoreMetrics.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.28.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/op-node/p2p/monitor/mocks/PeerManager.go b/op-node/p2p/monitor/mocks/PeerManager.go index 7774357ed422..d91af047a182 100644 --- a/op-node/p2p/monitor/mocks/PeerManager.go +++ b/op-node/p2p/monitor/mocks/PeerManager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.28.0. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/op-service/txmgr/mocks/TxManager.go b/op-service/txmgr/mocks/TxManager.go index eadfe0733f0a..7d5348bec98d 100644 --- a/op-service/txmgr/mocks/TxManager.go +++ b/op-service/txmgr/mocks/TxManager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.23.1. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks