|
8 | 8 | use Keboola\JobQueueInternalClient\Exception\ClientException; |
9 | 9 | use Keboola\JobQueueInternalClient\Exception\ConfigurationDisabledException; |
10 | 10 | use Keboola\JobQueueInternalClient\JobFactory; |
11 | | -use Keboola\JobQueueInternalClient\JobFactory\JobInterface; |
12 | 11 | use Keboola\JobQueueInternalClient\JobFactory\JobRuntimeResolver; |
13 | 12 | use Keboola\JobQueueInternalClient\JobFactory\JobType; |
14 | 13 | use Keboola\StorageApi\BranchAwareClient; |
15 | | -use Keboola\StorageApi\Client; |
16 | 14 | use Keboola\StorageApi\ClientException as StorageClientException; |
17 | 15 | use Keboola\StorageApiBranch\ClientWrapper; |
18 | 16 | use Keboola\StorageApiBranch\Factory\ClientOptions; |
|
21 | 19 |
|
22 | 20 | class JobRuntimeResolverTest extends TestCase |
23 | 21 | { |
| 22 | + private const DEFAULT_BRANCH_ID = '9999'; |
| 23 | + |
24 | 24 | /** @var array */ |
25 | 25 | private const JOB_DATA = [ |
26 | 26 | 'id' => '123456456', |
@@ -195,7 +195,7 @@ public function testResolveRuntimeSettingsInJob(): void |
195 | 195 | 'containerType' => 'custom', |
196 | 196 | 'context' => 'wml', |
197 | 197 | ], |
198 | | - 'branchId' => 'default', |
| 198 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
199 | 199 | 'tag' => '1.2.3', |
200 | 200 | 'variableValuesData' => [ |
201 | 201 | 'values' => [ |
@@ -268,7 +268,7 @@ public function testResolveRuntimeSettingsInConfigData(): void |
268 | 268 | 'containerType' => 'mass-produced', |
269 | 269 | 'context' => 'wml', |
270 | 270 | ], |
271 | | - 'branchId' => 'default', |
| 271 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
272 | 272 | 'configData' => [ |
273 | 273 | 'variableValuesId' => '123', |
274 | 274 | 'runtime' => [ |
@@ -362,7 +362,7 @@ public function testResolveRuntimeSettingsInConfiguration(): void |
362 | 362 | 'containerType' => 'stereotyped', |
363 | 363 | 'context' => 'wml', |
364 | 364 | ], |
365 | | - 'branchId' => 'default', |
| 365 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
366 | 366 | 'tag' => '4.5.6', |
367 | 367 | 'parallelism' => '5', |
368 | 368 | 'executor' => 'dind', |
@@ -437,7 +437,7 @@ public function testResolveRuntimeSettingsInConfigurationOfTransformations(): vo |
437 | 437 | 'containerType' => null, |
438 | 438 | 'context' => 'wml', |
439 | 439 | ], |
440 | | - 'branchId' => 'default', |
| 440 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
441 | 441 | 'tag' => '4.5.6', |
442 | 442 | 'parallelism' => '5', |
443 | 443 | 'executor' => 'dind', |
@@ -514,7 +514,7 @@ public function testResolveRuntimeSettingsPriority(): void |
514 | 514 | 'containerType' => 'stereotyped', |
515 | 515 | 'context' => '123-extractor', |
516 | 516 | ], |
517 | | - 'branchId' => 'default', |
| 517 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
518 | 518 | 'variableValuesId' => '123', |
519 | 519 | 'configData' => [ |
520 | 520 | 'variableValuesId' => '456', |
@@ -578,7 +578,7 @@ public function testResolveRuntimeSettingsNowhere(): void |
578 | 578 | 'containerType' => null, |
579 | 579 | 'context' => '123-extractor', |
580 | 580 | ], |
581 | | - 'branchId' => 'default', |
| 581 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
582 | 582 | 'tag' => '9.9.9', |
583 | 583 | 'parallelism' => null, |
584 | 584 | 'executor' => 'dind', |
@@ -627,7 +627,7 @@ public function testResolveExecutor( |
627 | 627 | 'id' => '123456456', |
628 | 628 | 'runId' => '123456456', |
629 | 629 | 'configId' => '454124290', |
630 | | - 'branchId' => 'default', |
| 630 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
631 | 631 | 'branchType' => 'default', |
632 | 632 | 'componentId' => 'keboola.ex-db-snowflake', |
633 | 633 | 'mode' => 'run', |
@@ -800,7 +800,7 @@ public function testResolveNoConfiguration(): void |
800 | 800 | 'containerType' => null, |
801 | 801 | 'context' => '123-extractor', |
802 | 802 | ], |
803 | | - 'branchId' => 'default', |
| 803 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
804 | 804 | 'tag' => '9.9.9', |
805 | 805 | 'parallelism' => null, |
806 | 806 | 'executor' => 'dind', |
@@ -844,7 +844,7 @@ public function testResolveEmptyConfiguration(): void |
844 | 844 | 'containerType' => null, |
845 | 845 | 'context' => '123-extractor', |
846 | 846 | ], |
847 | | - 'branchId' => 'default', |
| 847 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
848 | 848 | 'tag' => '9.9.9', |
849 | 849 | 'parallelism' => null, |
850 | 850 | 'executor' => 'dind', |
@@ -893,7 +893,7 @@ public function testResolveEmptyConfigurationData(): void |
893 | 893 | 'containerType' => null, |
894 | 894 | 'context' => '123-extractor', |
895 | 895 | ], |
896 | | - 'branchId' => 'default', |
| 896 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
897 | 897 | 'tag' => '9.9.9', |
898 | 898 | 'parallelism' => null, |
899 | 899 | 'executor' => 'dind', |
@@ -1145,7 +1145,7 @@ public function testResolveBackend( |
1145 | 1145 | 'containerType' => $expectedContainerType, |
1146 | 1146 | 'context' => $expectedContext, |
1147 | 1147 | ], |
1148 | | - 'branchId' => 'default', |
| 1148 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
1149 | 1149 | 'tag' => '1.2.3', |
1150 | 1150 | 'variableValuesData' => [ |
1151 | 1151 | 'values' => [ |
@@ -1688,7 +1688,7 @@ public function testMergeJobDataBackendWithBackendFromConfig( |
1688 | 1688 | 'tokenId' => '456', |
1689 | 1689 | '#tokenString' => 'KBC::ProjectSecure::token', |
1690 | 1690 | 'backend' => $expectedBackend, |
1691 | | - 'branchId' => 'default', |
| 1691 | + 'branchId' => self::DEFAULT_BRANCH_ID, |
1692 | 1692 | 'tag' => '1.2.3', |
1693 | 1693 | 'configData' => $jobData['configData'], |
1694 | 1694 | 'parallelism' => null, |
@@ -1789,7 +1789,7 @@ private function prepareStorageClientFactoryMock( |
1789 | 1789 | BranchAwareClient $storageClient, |
1790 | 1790 | int $expectedInvocationCount = 1, |
1791 | 1791 | ?string $expectedBranchId = 'default', |
1792 | | - string $actualBranchId = 'default', |
| 1792 | + string $actualBranchId = self::DEFAULT_BRANCH_ID, |
1793 | 1793 | bool $actualBranchIsDefault = true, |
1794 | 1794 | ): StorageClientPlainFactory { |
1795 | 1795 | $clientWrapper = self::createMock(ClientWrapper::class); |
|
0 commit comments