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 missing proto to thrift enum mappings and unit tests for EnumMapper #924

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

natemort
Copy link
Member

What changed?
Add a suite of tests that will automatically fail if new enum types are added in IDL but the mappers aren't updated. This was done in a few ways:

  • For enums that have mappers both directions, we roundtrip all thrift values and assert that they're equal.
  • For enums that are identical across thrift/proto, we generate a mapping based on the value names and assert that the mapper matches it.
  • For enums that aren't identical, we explicitly assert that our mapping contains all values.

Why?

  • Increase test coverage and GRPC compatibility

How did you test it?

  • Unit tests

Potential risks

Release notes

Documentation Changes

…mMappers

Add a suite of tests that will automatically fail if new enum types are added in IDL but the mappers aren't updated. This was done in a few ways:
- For enums that have mappers both directions, we roundtrip all thrift values and assert that they're equal.
- For enums that are identical across thrift/proto, we generate a mapping based on the value names and assert that the mapper matches it.
- For enums that aren't identical, we explicitly assert that our mapping contains all values.
@natemort natemort changed the title Add missing proto to thrift enum mappings and unit tests for both Enu… Add missing proto to thrift enum mappings and unit tests for EnumMapper Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@760f880). Learn more about missing BASE report.

Additional details and impacted files
Files with missing lines Coverage Δ
...dence/internal/compatibility/proto/EnumMapper.java 75.70% <ø> (ø)
...ence/internal/compatibility/thrift/EnumMapper.java 71.87% <100.00%> (ø)

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 760f880...58b9bc5. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2541

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 8 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.8%) to 66.108%

Files with Coverage Reduction New Missed Lines %
src/main/java/com/uber/cadence/internal/sync/WorkflowThreadContext.java 1 81.58%
src/main/java/com/uber/cadence/internal/sync/CancellationScopeImpl.java 1 92.65%
src/main/java/com/uber/cadence/internal/worker/Poller.java 1 78.13%
src/main/java/com/uber/cadence/internal/replay/ReplayDecider.java 5 80.27%
Totals Coverage Status
Change from base Build 2537: 0.8%
Covered Lines: 12893
Relevant Lines: 19503

💛 - Coveralls

@natemort natemort merged commit 405c755 into cadence-workflow:master Oct 23, 2024
13 checks passed
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.

3 participants