Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cappuc committed Mar 14, 2024
1 parent 511b65a commit 9092760
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
20 changes: 10 additions & 10 deletions tests/Unit/Builder/ActivityBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
expect($activityOptions)
->taskQueue->toBe(WorkerFactory::DEFAULT_TASK_QUEUE)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

return true;
Expand All @@ -33,9 +33,9 @@
expect($builder)
->taskQueue->toBe(WorkerFactory::DEFAULT_TASK_QUEUE)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

if ($typed) {
Expand All @@ -61,9 +61,9 @@
expect($activityOptions)
->taskQueue->toBe('test-queue')
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

return true;
Expand All @@ -78,9 +78,9 @@
expect($builder)
->taskQueue->toBe('test-queue')
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

if ($typed) {
Expand All @@ -97,7 +97,7 @@
$contextMock = mockTemporalContext(validateActivityOptions: function (ActivityOptions $activityOptions): bool {
expect($activityOptions)
->taskQueue->toBe('custom-queue')
->startToCloseTimeout->totalSeconds->toBe(10)
->startToCloseTimeout->totalSeconds->toEqual(10.0)
->retryOptions->not->toBeNull()
->retryOptions->maximumAttempts->toBe(5);

Expand All @@ -115,7 +115,7 @@

expect($builder)
->taskQueue->toBe('custom-queue')
->startToCloseTimeout->totalSeconds->toBe(10)
->startToCloseTimeout->totalSeconds->toEqual(10.0)
->retryOptions->not->toBeNull()
->retryOptions->maximumAttempts->toBe(5);

Expand Down
20 changes: 10 additions & 10 deletions tests/Unit/Builder/ChildWorkflowBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
->namespace->toBe(ClientOptions::DEFAULT_NAMESPACE)
->taskQueue->toBe(WorkerFactory::DEFAULT_TASK_QUEUE)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

return true;
Expand All @@ -36,9 +36,9 @@
->namespace->toBe(ClientOptions::DEFAULT_NAMESPACE)
->taskQueue->toBe(WorkerFactory::DEFAULT_TASK_QUEUE)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

if ($typed) {
Expand Down Expand Up @@ -66,9 +66,9 @@
->namespace->toBe('test-namespace')
->taskQueue->toBe('test-queue')
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

return true;
Expand All @@ -84,9 +84,9 @@
->namespace->toBe('test-namespace')
->taskQueue->toBe('test-queue')
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

if ($typed) {
Expand All @@ -104,7 +104,7 @@
expect($workflowOptions)
->namespace->toBe('custom-namespace')
->taskQueue->toBe('custom-queue')
->workflowExecutionTimeout->totalSeconds->toBe(10)
->workflowExecutionTimeout->totalSeconds->toEqual(10.0)
->retryOptions->not->toBeNull()
->retryOptions->maximumAttempts->toBe(5);

Expand All @@ -124,7 +124,7 @@
expect($builder)
->namespace->toBe('custom-namespace')
->taskQueue->toBe('custom-queue')
->workflowExecutionTimeout->totalSeconds->toBe(10)
->workflowExecutionTimeout->totalSeconds->toEqual(10.0)
->retryOptions->not->toBeNull()
->retryOptions->maximumAttempts->toBe(5);

Expand Down
20 changes: 10 additions & 10 deletions tests/Unit/Builder/LocalActivityBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
$contextMock = mockTemporalContext(validateActivityOptions: function (LocalActivityOptions $activityOptions): bool {
expect($activityOptions)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

return true;
Expand All @@ -30,9 +30,9 @@

expect($builder)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

if ($typed) {
Expand All @@ -56,9 +56,9 @@
$contextMock = mockTemporalContext(validateActivityOptions: function (LocalActivityOptions $activityOptions): bool {
expect($activityOptions)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

return true;
Expand All @@ -72,9 +72,9 @@

expect($builder)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

if ($typed) {
Expand All @@ -90,7 +90,7 @@
it('can build local activity with custom options', function (bool $typed) {
$contextMock = mockTemporalContext(validateActivityOptions: function (LocalActivityOptions $activityOptions): bool {
expect($activityOptions)
->startToCloseTimeout->totalSeconds->toBe(10)
->startToCloseTimeout->totalSeconds->toEqual(10.0)
->retryOptions->not->toBeNull()
->retryOptions->maximumAttempts->toBe(5);

Expand All @@ -106,7 +106,7 @@
->withRetryOptions(RetryOptions::new()->withMaximumAttempts(5));

expect($builder)
->startToCloseTimeout->totalSeconds->toBe(10)
->startToCloseTimeout->totalSeconds->toEqual(10.0)
->retryOptions->not->toBeNull()
->retryOptions->maximumAttempts->toBe(5);

Expand Down
20 changes: 10 additions & 10 deletions tests/Unit/Builder/WorkflowBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
expect($builder)
->taskQueue->toBe(WorkerFactory::DEFAULT_TASK_QUEUE)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

$workflow = match ($typed) {
Expand All @@ -55,9 +55,9 @@
expect($stub->getOptions())
->taskQueue->toBe(WorkerFactory::DEFAULT_TASK_QUEUE)
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->initialInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_INITIAL_INTERVAL)
->retryOptions->backoffCoefficient->toBe(RetryOptions::DEFAULT_BACKOFF_COEFFICIENT)
->retryOptions->maximumInterval->totalSeconds->toBe(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumInterval->totalSeconds->toEqual(RetryOptions::DEFAULT_MAXIMUM_INTERVAL)
->retryOptions->maximumAttempts->toBe(RetryOptions::DEFAULT_MAXIMUM_ATTEMPTS);

/** @var ClientOptions $clientOptions */
Expand Down Expand Up @@ -85,9 +85,9 @@
expect($builder)
->taskQueue->toBe('test-queue')
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

$workflow = match ($typed) {
Expand All @@ -104,9 +104,9 @@
expect($stub->getOptions())
->taskQueue->toBe('test-queue')
->retryOptions->not->toBeNull()
->retryOptions->initialInterval->totalSeconds->toBe(5)
->retryOptions->initialInterval->totalSeconds->toEqual(5.0)
->retryOptions->backoffCoefficient->toBe(6.0)
->retryOptions->maximumInterval->totalSeconds->toBe(500)
->retryOptions->maximumInterval->totalSeconds->toEqual(500.0)
->retryOptions->maximumAttempts->toBe(10);

/** @var ClientOptions $clientOptions */
Expand All @@ -128,7 +128,7 @@
expect($builder)
->taskQueue->toBe('custom-queue')
->retryOptions->maximumAttempts->toBe(5)
->workflowExecutionTimeout->totalSeconds->toBe(10);
->workflowExecutionTimeout->totalSeconds->toEqual(10.0);

$workflow = match ($typed) {
true => $builder->build(DemoWorkflow::class),
Expand All @@ -144,7 +144,7 @@
expect($stub->getOptions())
->taskQueue->toBe('custom-queue')
->retryOptions->maximumAttempts->toBe(5)
->workflowExecutionTimeout->totalSeconds->toBe(10);
->workflowExecutionTimeout->totalSeconds->toEqual(10.0);
})->with([
'typed' => true,
'untyped' => false,
Expand Down

0 comments on commit 9092760

Please sign in to comment.