Browse Source

Fix tests

Илья 1 year ago
parent
commit
1751ed2f40

+ 1 - 1
.github/workflows/tests.yml

@@ -61,5 +61,5 @@ jobs:
         run: ./vendor/bin/phpunit \
           --coverage-text \
           --whitelist src \
-          --colors=never  \
+          --testdox \
           tests

+ 3 - 1
tests/CheckParamsInRetryTransactionTest.php

@@ -11,7 +11,7 @@ use YdbPlatform\Ydb\YdbTable;
 
 class CheckParamsInRetryTransactionTest extends TestCase
 {
-    public function testRun()
+    public function testCheckThrowExceptionsInRetryTransaction()
     {
         $config = [
 
@@ -49,5 +49,7 @@ class CheckParamsInRetryTransactionTest extends TestCase
             self::assertEquals(1,1);
         }
 
+        $table->retryTransaction(function (Session $session){});
+
     }
 }

+ 1 - 1
tests/CheckRefreshTokenRatioTest.php

@@ -9,7 +9,7 @@ use YdbPlatform\Ydb\YdbTable;
 
 class CheckRefreshTokenRatioTest extends TestCase
 {
-    public function testAnonymousConnection()
+    public function testRefreshTokenRatio()
     {
         $awaitException = [0, 1];
         $awaitNormal = [0.05, 0.9];

+ 2 - 2
tests/CheckTypeTest.php

@@ -24,7 +24,7 @@ use YdbPlatform\Ydb\Types\Utf8Type;
 use YdbPlatform\Ydb\Ydb;
 
 class CheckTypeTest  extends TestCase{
-    public function test(){
+    public function testCheckTypesInDeclare(){
         $config = [
 
             // Database path
@@ -146,7 +146,7 @@ class CheckTypeTest  extends TestCase{
             "Timestamp" => [
                 "class"     => TimestampType::class,
                 "values"    => [
-                    "2023-06-14 17:12:15.023476", 
+                    "2023-06-14 17:12:15.023476",
                     "2023-06-14 17:12:15.000000"
                 ]
             ]

+ 1 - 1
tests/PreparedQueryTest.php

@@ -8,7 +8,7 @@ use YdbPlatform\Ydb\Ydb;
 
 class PreparedQueryTest extends TestCase
 {
-    public function test(){
+    public function testPreparedQuery(){
         $config = [
 
             // Database path

+ 1 - 1
tests/RefreshTokenTest.php

@@ -45,7 +45,7 @@ class MetaGetter extends \YdbPlatform\Ydb\Session{
 
 class RefreshTokenTest extends TestCase
 {
-    public function test(){
+    public function testRefreshToken(){
 
         $counter = 0;
 

+ 1 - 1
tests/RetryOnExceptionTest.php

@@ -27,7 +27,7 @@ class RetryOnExceptionTest extends TestCase
      */
     private $oldSessionId;
 
-    public function test(){
+    public function testRetryOnExceptionInRetry(){
 
         $config = [
 

+ 2 - 2
tests/RetryParamsTest.php

@@ -30,7 +30,7 @@ use YdbPlatform\Ydb\Ydb;
 use YdbPlatform\Ydb\Retry\Retry;
 
 class RetrySubclass extends Retry{
-    public function canRetry(Exception $e, bool $idempotent)
+    public function canRetry(\Exception $e, bool $idempotent)
     {
         return parent::canRetry($e, $idempotent);
     }
@@ -364,7 +364,7 @@ class RetryParamsTest extends \PHPUnit\Framework\TestCase
             ]
         ],
     ];
-    public function test(){
+    public function testBackoffTypesAndDeleteSessionOnException(){
 
         $retryParams = new RetryParams(1000, new Backoff(6,self::FAST),
             new Backoff(6,self::SLOW));

+ 3 - 3
tests/TestEnvTypes.php → tests/TestEnvTypesTest.php

@@ -6,15 +6,15 @@ use YdbPlatform\Ydb\Auth\EnvironCredentials;
 use YdbPlatform\Ydb\Ydb;
 use YdbPlatform\Ydb\YdbTable;
 
-class TestEnvTypes extends TestCase{
+class TestEnvTypesTest extends TestCase{
 
-    public function testEnvTypes(){
+    public function testEnvironCredentials(){
 
         $dataset = [
             [
                 "env"   => [
                     "name"  => "YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS",
-                    "value" => "./some.json"
+                    "value" => "./tests/some.json"
                 ],
                 "wait"  => "SA JSON key"
             ],