-
Notifications
You must be signed in to change notification settings - Fork 354
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
chore: switch to mockery config file #9473
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9473 +/- ##
==========================================
- Coverage 51.06% 49.00% -2.07%
==========================================
Files 747 1234 +487
Lines 111186 159690 +48504
Branches 2780 2780
==========================================
+ Hits 56778 78253 +21475
- Misses 54233 81262 +27029
Partials 175 175
Flags with carried forward coverage won't be shown. Click here to find out more. |
✅ Deploy Preview for determined-ui canceled.
|
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.
LGTM
thanks for working on this
mockery --quiet --name=CoreV1Interface --output internal/mocks --srcpkg "k8s.io/client-go/kubernetes/typed/core/v1" --filename k8s_corev1_iface.go --structname K8sCoreV1Interface | ||
mockery --quiet --name=BatchV1Interface --output internal/mocks --srcpkg "k8s.io/client-go/kubernetes/typed/batch/v1" --filename k8s_batchv1_iface.go --structname K8sBatchV1Interface | ||
|
||
mockery --config "./.mockery.yaml" |
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.
is the output a lot?
Should we add --quite
to this? I am fine either way
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.
We do not need it as it does not add any noise:
% make -C master check
rm -f build/schema_gen.stamp
rm -f ../harness/determined/common/streams/wire.py
rm -f ../webui/react/src/services/stream/wire.ts
../tools/scripts/gen-attributions.py master packaging/LICENSE
go generate ./pkg/schemas/...
mkdir -p build
touch build/schema_gen.stamp
go build -o build/stream-gen ./cmd/stream-gen
build/stream-gen ./internal/stream//authz_basic_impl.go ./internal/stream//subscription.go ./internal/stream//models.go ./internal/stream//test_util.go ./internal/stream//model_versions.go ./internal/stream//util.go ./internal/stream//supervisor.go ./internal/stream//socketlike.go ./internal/stream//messages.go ./internal/stream//projects.go ./internal/stream//authz_iface.go ./internal/stream//publisher.go --python --output ../harness/determined/common/streams/wire.py
build/stream-gen ./internal/stream//authz_basic_impl.go ./internal/stream//subscription.go ./internal/stream//models.go ./internal/stream//test_util.go ./internal/stream//model_versions.go ./internal/stream//util.go ./internal/stream//supervisor.go ./internal/stream//socketlike.go ./internal/stream//messages.go ./internal/stream//projects.go ./internal/stream//authz_iface.go ./internal/stream//publisher.go --ts --output ../webui/react/src/services/stream/wire.ts
mockery --config "./.mockery.yaml"
mkdir -p build
touch build/mock_gen.stamp
# Checking that committed, generated code is up-to-date by ensuring that
# git reports the files as unchanged after forcibly regenerating the files:
test -z "" || (git diff; false)
go mod tidy
git diff --quiet ../go.mod ../go.sum
golangci-lint --build-tags integration run --timeout 10m
WARN [linters_context] running gomodguard failed: unable to parse module file go.mod: go.mod:3: invalid go version '1.22.0': must match format 1.23: if you are not using go modules it is suggested to disable this linter
master/.mockery.yaml
Outdated
packages: | ||
github.com/determined-ai/determined/master/internal/db: | ||
interfaces: | ||
# mockery --quiet --name=DB --dir=internal/db --output internal/mocks --filename db.go |
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.
I don't think we need these comments
Ticket
RM-277
Description
We are transitioning to using a single mockery configuration file to streamline our mock generation process. Currently, we have 18 individual mockery commands, which are time-consuming. By consolidating these into a single configuration file, we can significantly reduce execution time and improve efficiency.
Test Plan
make -C master clean
to delete local mocksmake -C master check
to generate mocks (also sometimesmake -C master mocks
)make -C master test-intg
to make sure mocks are generated rightran with
devcluster -c ./.circleci/devcluster/elastic-base.devcluster.yaml
and confirmed if the devcluster ran fine -
curl -X GET "http://localhost:9200/_cluster/health?pretty"
Checklist
docs/release-notes/
.See Release Note for details.