Skip to content

[testing]: add custom serDes support#320

Merged
zhongkechen merged 4 commits intomainfrom
testing
Apr 7, 2026
Merged

[testing]: add custom serDes support#320
zhongkechen merged 4 commits intomainfrom
testing

Conversation

@zhongkechen
Copy link
Copy Markdown
Contributor

@zhongkechen zhongkechen commented Apr 7, 2026

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#22

Description

  • added CloudDurableTestRunner:withSerDes to configure custom SerDes config for cloud runners. This will be used to serialize input and deserialize output
  • added LocalDurableTestRunner::withOutputType to configure the output type for local runners
  • added TestResult::getResult() method for the cases where the result type is known
  • merged completeCallback, failCallback and timeoutCallback into one completeCallback method
  • added TypeToken::fromGenericSuperClass for extracting real type info from base class.

Demo/Screenshots

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes?

Integration Tests

Have integration tests been written for these changes?

Examples

Has a new example been added for the change? (if applicable)

@zhongkechen zhongkechen changed the title add custom serDes support [testing]: add custom serDes support Apr 7, 2026
@zhongkechen zhongkechen marked this pull request as ready for review April 7, 2026 20:46
@zhongkechen zhongkechen requested a review from a team April 7, 2026 20:46
* @return true if any operations were advanced, false otherwise
*/
public boolean advanceReadyOperations() {
public boolean advanceTime() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: why did we rename this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The name isn't accurate. It transitions not only PENDING -> READY for STEP but also STARTED -> SUCCEEDED for WAIT.

this.pollInterval = pollInterval;
this.timeout = timeout;
this.invocationType = invocationType;
this.serDes = Objects.requireNonNullElseGet(serDes, JacksonSerDes::new);
Copy link
Copy Markdown
Contributor

@SilanHe SilanHe Apr 7, 2026

Choose a reason for hiding this comment

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

nit: is this now the preferable pattern to overriding the constructor?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We use overloaded factory methods and the constructor is private in this class. It's nicer than we overload both constructors and factory methods

@zhongkechen zhongkechen merged commit 7678056 into main Apr 7, 2026
11 checks passed
@zhongkechen zhongkechen deleted the testing branch April 7, 2026 21:59
@zhongkechen zhongkechen self-assigned this Apr 7, 2026
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