uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
339 stars 128 forks source link

Internal workflow client test improvements #1331

Closed Groxx closed 3 months ago

Groxx commented 3 months ago

Followups from #1327:

  1. simplifying the memo/search-attr encoding tests
  2. making sure the dataconverter tests can detect correct vs incorrect encoder use

1 is pretty simple: memos and search attrs are ALWAYS JSON because the server must interpret them, so the exact bytes should not change in the future. A hardcoded string is easy to verify, and strengthens the guarantee that "this should not change even if other encoding changes".

2 is more interesting: as originally written, the test would still pass if the custom dataconverter was not saved and used. The type-assertion to check the internal field somewhat prevents that, but it's unnecessary and a disjointed check. So it has been rewritten: now the serialized request bytes must clearly come from the test encoder, not the default encoder, and they must be detectably different.

codecov[bot] commented 3 months ago

Codecov Report

Merging #1331 (4ce7834) into master (08b284a) will not change coverage. The diff coverage is n/a.

Additional details and impacted files ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/uber-go/cadence-client/pull/1331?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/uber-go/cadence-client/pull/1331?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go). Last update [08b284a...4ce7834](https://app.codecov.io/gh/uber-go/cadence-client/pull/1331?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber-go).
coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 018ea615-a43f-4541-b127-5eb050337a74

Details


Files with Coverage Reduction New Missed Lines %
internal/compatibility/thrift/enum.go 4 21.2%
internal/compatibility/thrift/types.go 9 48.42%
<!-- Total: 13 -->
Totals Coverage Status
Change from base Build 018e9ff9-d8ed-403a-8c3a-5ffe0c57f644: -0.05%
Covered Lines: 13378
Relevant Lines: 20678

💛 - Coveralls