Skip to content
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

Coverage for dataStoreInterfaces #5743

Merged
merged 9 commits into from
Mar 14, 2024
Merged

Conversation

Groxx
Copy link
Member

@Groxx Groxx commented Mar 6, 2024

This is... much more questionable code than I anticipated going in.
Not gonna change it in this commit though.

This is... much more questionable code than I anticipated going in.
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Merging #5743 (2907992) into master (6c1ca00) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Additional details and impacted files
Files Coverage Δ
common/persistence/data_store_interfaces.go 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c1ca00...2907992. Read the comment docs.

Comment on lines +55 to +58
// I'm not entirely sure why this behavior exists, but to nail it down:
assert.NotPanics(t, func() {
NewDataBlob([]byte(problematic), common.EncodingTypeThriftRW)
}, "only thriftrw data can start with Y without panicking")
Copy link
Member Author

Choose a reason for hiding this comment

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

no reason or comment about this in the original PR: #1176

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, sorry, no idea either

Comment on lines +124 to +125
// highly suspicious
unknown(common.EncodingTypeProto)
Copy link
Member Author

Choose a reason for hiding this comment

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

very strange.

also this entire func seems ridiculous to me. it converts EncodingType -> string -> EncodingType and loses data in the process. why in the world doesn't it just return the EncodingType

assert.EqualValues(t, internal, blob.ToInternal(), "thriftrw should encode to internal type")
assert.Equal(t, blob, NewDataBlobFromInternal(internal), "thriftrw should decode from internal type")

// all these panic
Copy link
Member Author

@Groxx Groxx Mar 6, 2024

Choose a reason for hiding this comment

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

we don't have enums for this in thrift/proto... beyond that I'm not sure why this is like this. not sure where it's serialized / where it would matter. (I have not really looked though)

panic(fmt.Sprintf("Invalid incoding: \"%v\"", encodingType))
if encodingType != common.EncodingTypeThriftRW && data[0] == 'Y' {
// original reason for this is not written down, but maybe for handling data prior to an encoding type?
panic(fmt.Sprintf("Invalid data blob encoding: \"%v\"", encodingType))
Copy link
Member

Choose a reason for hiding this comment

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

all these panics should be replaced by err returns ideally but the blast radius of changes might be too big

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

we should probably remove it at some point then too.
I'll leave that for another diff / let's make a task or something around it, and see if thrift/proto ever start with Y because what even

@coveralls
Copy link

coveralls commented Mar 7, 2024

Pull Request Test Coverage Report for Build 018e3e63-d019-4d4a-8f62-e1cf499a7e72

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • 52 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.03%) to 64.887%

Files with Coverage Reduction New Missed Lines %
service/matching/taskReader.go 2 84.88%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/history/task/transfer_active_task_executor.go 2 72.38%
service/matching/taskListManager.go 2 79.7%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
common/persistence/historyManager.go 2 66.67%
common/persistence/statsComputer.go 3 94.64%
service/history/task/fetcher.go 3 85.57%
service/history/execution/mutable_state_task_refresher.go 14 64.24%
service/history/task/task_util.go 20 70.57%
Totals Coverage Status
Change from base Build 018e3e1f-7237-4565-99da-b08c08f40c4f: 0.03%
Covered Lines: 94580
Relevant Lines: 145761

💛 - Coveralls

@Groxx Groxx merged commit 2a30afd into cadence-workflow:master Mar 14, 2024
20 checks passed
@Groxx Groxx deleted the coverdatastore branch March 14, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants