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 unit tests for cassandra workflow utils part-1 #5476

Merged

Conversation

taylanisikdemir
Copy link
Contributor

@taylanisikdemir taylanisikdemir commented Dec 13, 2023

What changed?
workflowUtils.go encapsulates helper functions to generate cassandra queries against execution table. It had 0% code coverage so decided to write some unit tests for it. The file has 1.3k lines so there will be follow up PR to cover the rest. New tests are written following table driven approach without any test suite or mock library (used fakes instead).

Also did some refactoring in the same common/persistence/nosql/nosqlplugin/cassandra folder:

  • Detach utility functions from cdb struct because they don't use anything from struct.
  • Replace camelCase file names with snake_case
  • Remove unnecessary import aliasing
  • Move cassandra query templates to corresponding *_cql.go files

Why?
Improve code coverage and quality.

How did you test it?
make test

"github.com/google/go-cmp/cmp"
"github.com/pborman/uuid"
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file has the new unit tests. Rest of the diff is about refactoring mentioned in the PR description.

@taylanisikdemir taylanisikdemir force-pushed the taylan/workflow_utils_tests_part_1 branch from f6178f9 to 31e6bdd Compare December 14, 2023 00:29
@Shaddoll Shaddoll merged commit 532da78 into uber:master Dec 14, 2023
16 checks passed
@taylanisikdemir taylanisikdemir deleted the taylan/workflow_utils_tests_part_1 branch December 15, 2023 00:08
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.

None yet

2 participants