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

delete unstable tests and skip redis tests if the redis extension is not installed #78

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions tests/BatchSnowflakeIDTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ public function test_batch_for_same_instance_with_default_driver(): void
$this->assertCount($count, $ids);
}

public function test_batch_for_diff_instance_with_default_driver(): void
{
$ids = [];
$count = 100_000; // 100k

for ($i = 0; $i < $count; $i++) {
$ids[(new Snowflake())->id()] = 1;
}

// This pattern will result in generating duplicate IDs.
$this->assertGreaterThan(90000, count($ids));
}

/**
* @throws Throwable
*/
Expand Down
1 change: 1 addition & 0 deletions tests/FileLockResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
class FileLockResolverTest extends TestCase
{
private FileLockResolver $fileLocker;

/** @var callable */
private $defer;

Expand Down
11 changes: 7 additions & 4 deletions tests/RedisSequenceResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@

class RedisSequenceResolverTest extends TestCase
{
public function setUp(): void
{
if (! extension_loaded('redis')) {
$this->markTestSkipped('Redis extension is not installed');
}
}

public function test_invalid_redis_connect(): void
{
$redis = $this->createMock(\Redis::class);
Expand Down Expand Up @@ -57,10 +64,6 @@ public function test_set_cache_prefix(): void
*/
public function test_real_redis(): void
{
if (! extension_loaded('redis')) {
$this->markTestSkipped('Redis extension is not installed.');
}

if (! ($host = getenv('REDIS_HOST')) || ! ($port = getenv('REDIS_PORT'))) {
$this->markTestSkipped('Redis host or port is not set, skip real redis test.');
}
Expand Down
Loading