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 test for cassandra workflow utils part-3 #5506

Conversation

taylanisikdemir
Copy link
Member

What changed?
Continuing from where I left in #5480

},
deleteInfos: []string{"timer2"},
wantQueries: []string{
`UPDATE executions SET timer_map[ timer1 ] = {` +
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit unsure, but for me it looks like these tests are testing both updateTimerInfos and custom implementation of FakeBatcher.
I'm not sure we can guarantee that this queries are what will be executed by Cassandra, since this is a simplified stub.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's right and that's actually the scope of unit tests. Basically the function under test takes a gocql.Batch interface and calls it with certain parameters. Test is validating this part. What is out of scope for these unit tests is the actual queries generated by the concrete implementation of 3rd party cql package which should be a concern of integration test

Copy link
Contributor

@3vilhamster 3vilhamster left a comment

Choose a reason for hiding this comment

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

Overall this is an improval. Though, keeping fakeBatch up to date and mimic Cassandra could be messy.

@taylanisikdemir taylanisikdemir force-pushed the taylan/workflow_utils_test_part3 branch from 6b74d2f to 4d1297c Compare December 21, 2023 01:28
@taylanisikdemir taylanisikdemir enabled auto-merge (squash) December 21, 2023 01:28
@taylanisikdemir taylanisikdemir merged commit ed873b8 into cadence-workflow:master Dec 21, 2023
14 of 16 checks passed
@taylanisikdemir taylanisikdemir deleted the taylan/workflow_utils_test_part3 branch December 21, 2023 02:57
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.

2 participants