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

Add error case tests for pinot_visibility_store #5746

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

bowenxia
Copy link
Contributor

@bowenxia bowenxia commented Mar 7, 2024

What changed?
Added more unit tests to test error cases

Why?
To reach a higher code coverage (~95%)

How did you test it?
unti test

Potential risks

Release notes

Documentation Changes

@bowenxia bowenxia changed the title add test to test error cases Add error case tests for pinot_visibility_store Mar 7, 2024
@@ -604,7 +604,7 @@ func createVisibilityMessage(
for key, value := range rawSearchAttributes {
value, err = isTimeStruct(value)
if err != nil {
return nil, err
return nil, err // can't test because it's hard to create a scenario where this error happens
Copy link
Member

Choose a reason for hiding this comment

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

let's avoid adding these comments to actual code

@@ -763,7 +763,7 @@ func (v *pinotVisibilityStore) getCountWorkflowExecutionsQuery(tableName string,
comparExpr, err := v.pinotQueryValidator.ValidateQuery(comparExpr)
if err != nil {
v.logger.Error(fmt.Sprintf("pinot query validator error: %s", err))
}
} // can't test because it's hard to create a scenario where this error happens
Copy link
Member

Choose a reason for hiding this comment

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

we could mock some things inside ValidateQuery to mimic this failure but I don't think it's crucial

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Merging #5746 (29329c1) into master (3da6ce9) will increase coverage by 0.04%.
The diff coverage is n/a.

Additional details and impacted files

see 10 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 3da6ce9...29329c1. Read the comment docs.

@coveralls
Copy link

coveralls commented Mar 7, 2024

Pull Request Test Coverage Report for Build 018e165c-69ea-4fe2-bec4-e679416f98ba

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 42 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.05%) to 63.867%

Files with Coverage Reduction New Missed Lines %
common/persistence/pinot/pinot_visibility_store.go 2 94.9%
common/task/fifo_task_scheduler.go 2 85.57%
service/history/task/transfer_active_task_executor.go 2 72.38%
service/matching/matcher.go 2 90.72%
service/matching/taskListManager.go 2 80.2%
service/history/task/fetcher.go 5 85.57%
service/history/task/cross_cluster_task_processor.go 8 80.79%
common/persistence/sql/workflowStateMaps.go 19 83.84%
Totals Coverage Status
Change from base Build 018e1631-7df5-41c4-aa3c-783fa88e3719: 0.05%
Covered Lines: 93629
Relevant Lines: 146599

💛 - Coveralls

@bowenxia bowenxia merged commit bc5cc93 into master Mar 7, 2024
21 checks passed
@bowenxia bowenxia deleted the xbowen_PinotVisibilityStore_testErrors branch March 7, 2024 01:22
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.

4 participants