Skip to content

Update module github.com/vektra/mockery/v2 to v3 #7051

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

Merged
merged 4 commits into from
Apr 20, 2025

Conversation

AnmolxSingh
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

Checklist

Signed-off-by: anmol7344 <[email protected]>
@AnmolxSingh AnmolxSingh requested a review from a team as a code owner April 19, 2025 18:28
@AnmolxSingh AnmolxSingh requested a review from jkowall April 19, 2025 18:28
@AnmolxSingh
Copy link
Contributor Author

@yurishkuro I have tried to resolve some of the failing unit tests but I was unable to resolve some of the unit tests as I was unable to understand what was failing

Copy link

codecov bot commented Apr 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.03%. Comparing base (5873d1f) to head (160e973).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7051      +/-   ##
==========================================
- Coverage   96.04%   96.03%   -0.02%     
==========================================
  Files         352      355       +3     
  Lines       20821    20973     +152     
==========================================
+ Hits        19998    20141     +143     
- Misses        620      626       +6     
- Partials      203      206       +3     
Flag Coverage Δ
badger_v1 9.97% <ø> (-0.01%) ⬇️
badger_v2 2.07% <ø> (-0.01%) ⬇️
cassandra-4.x-v1-manual 15.00% <ø> (-0.01%) ⬇️
cassandra-4.x-v2-auto 2.06% <ø> (-0.01%) ⬇️
cassandra-4.x-v2-manual 2.06% <ø> (-0.01%) ⬇️
cassandra-5.x-v1-manual 15.00% <ø> (-0.01%) ⬇️
cassandra-5.x-v2-auto 2.06% <ø> (-0.01%) ⬇️
cassandra-5.x-v2-manual 2.06% <ø> (-0.01%) ⬇️
elasticsearch-6.x-v1 19.95% <ø> (-0.01%) ⬇️
elasticsearch-7.x-v1 20.02% <ø> (-0.01%) ⬇️
elasticsearch-8.x-v1 20.19% <ø> (-0.01%) ⬇️
elasticsearch-8.x-v2 2.07% <ø> (-0.01%) ⬇️
grpc_v1 11.52% <ø> (+<0.01%) ⬆️
grpc_v2 2.07% <ø> (-7.08%) ⬇️
kafka-3.x-v1 10.24% <ø> (-0.01%) ⬇️
kafka-3.x-v2 2.07% <ø> (-0.01%) ⬇️
memory_v2 2.07% <ø> (-0.01%) ⬇️
opensearch-1.x-v1 20.07% <ø> (-0.01%) ⬇️
opensearch-2.x-v1 20.07% <ø> (-0.01%) ⬇️
opensearch-2.x-v2 2.07% <ø> (-0.01%) ⬇️
query 2.07% <ø> (?)
tailsampling-processor 0.56% <ø> (-0.01%) ⬇️
unittests 94.80% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yurishkuro
Copy link
Member

a couple of mismatched expectations are failing, look rather straightforward to fix.

Signed-off-by: anmol7344 <[email protected]>
@AnmolxSingh
Copy link
Contributor Author

I had a doubt that now we want to migrate to v3 which is more strict than v2 so would that not make writing or maintaining unit tests more difficult?

gw.reader.
On("GetTraces", matchContext, query).
On("GetTraces", matchContext, mock.AnythingOfType("[]tracestore.GetTraceParams")).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why match in string name? The error was that the function was expecting an array, so this should've worked:

	query := []tracestore.GetTraceParams{{TraceID: traceID}}
	gw.reader.
		On("GetTraces", matchContext, query).

@@ -127,7 +127,7 @@ func TestGetTrace(t *testing.T) {

func TestGetTraceStorageError(t *testing.T) {
tsc := newTestServerClient(t)
tsc.reader.On("GetTraces", matchContext, tracestore.GetTraceParams{TraceID: traceID}).
tsc.reader.On("GetTraces", matchContext, mock.AnythingOfType("[]tracestore.GetTraceParams")).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass actual array with trace ID

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your changes are making the tests less strict. There is no reason to do that. The errors were about expecting arrays when we were passing a single value, so just pass arrays. Basically our old tests were not adhering to the actual APIs of the mocks and we should fix that, not water down the tests.

Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro
Copy link
Member

please see b0c5d04 for a sample of how tests can be fixed, without watering them down by any-matchers.

@yurishkuro yurishkuro added the changelog:ci Change related to continuous integration / testing label Apr 19, 2025
Signed-off-by: anmol7344 <[email protected]>
@yurishkuro yurishkuro added this pull request to the merge queue Apr 20, 2025
@yurishkuro
Copy link
Member

Thanks!

Merged via the queue into jaegertracing:main with commit 628164e Apr 20, 2025
57 checks passed
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
## Which problem is this PR solving?
- Resolves jaegertracing#7008 

## Description of the changes
- Continuation of pr jaegertracing#7042 

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: anmol7344 <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
## Which problem is this PR solving?
- Resolves jaegertracing#7008

## Description of the changes
- Continuation of pr jaegertracing#7042

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: anmol7344 <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Signed-off-by: amol-verma-allen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:ci Change related to continuous integration / testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade mockery to v3
2 participants