From 260d69c21fba6d763d05dc5693689ddf7ce7bfe2 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 22 Jun 2021 09:54:53 +0300 Subject: - Temporary turn off CI - Remove old PHP tests Signed-off-by: Valery Piashchynski --- plugins/jobs/oooold/tests/.rr.yaml | 63 ----------- plugins/jobs/oooold/tests/Jobs/Amqp/BrokerTest.php | 20 ---- plugins/jobs/oooold/tests/Jobs/Amqp/ErrorJob.php | 22 ---- plugins/jobs/oooold/tests/Jobs/Amqp/Job.php | 26 ----- plugins/jobs/oooold/tests/Jobs/BaseTest.php | 115 --------------------- .../oooold/tests/Jobs/Beanstalk/BrokerTest.php | 20 ---- .../jobs/oooold/tests/Jobs/Beanstalk/ErrorJob.php | 22 ---- plugins/jobs/oooold/tests/Jobs/Beanstalk/Job.php | 26 ----- .../jobs/oooold/tests/Jobs/Local/BrokerTest.php | 20 ---- plugins/jobs/oooold/tests/Jobs/Local/ErrorJob.php | 22 ---- plugins/jobs/oooold/tests/Jobs/Local/Job.php | 26 ----- plugins/jobs/oooold/tests/Jobs/OptionsTest.php | 34 ------ plugins/jobs/oooold/tests/Jobs/RegistryTest.php | 43 -------- .../jobs/oooold/tests/Jobs/ShortCircuitTest.php | 90 ---------------- plugins/jobs/oooold/tests/Jobs/Sqs/BrokerTest.php | 20 ---- plugins/jobs/oooold/tests/Jobs/Sqs/ErrorJob.php | 22 ---- plugins/jobs/oooold/tests/Jobs/Sqs/Job.php | 26 ----- plugins/jobs/oooold/tests/bootstrap.php | 16 --- plugins/jobs/oooold/tests/consumer.php | 22 ---- plugins/jobs/oooold/tests/docker-compose.yml | 22 ---- 20 files changed, 677 deletions(-) delete mode 100644 plugins/jobs/oooold/tests/.rr.yaml delete mode 100644 plugins/jobs/oooold/tests/Jobs/Amqp/BrokerTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Amqp/ErrorJob.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Amqp/Job.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/BaseTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Beanstalk/BrokerTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Beanstalk/ErrorJob.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Beanstalk/Job.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Local/BrokerTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Local/ErrorJob.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Local/Job.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/OptionsTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/RegistryTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/ShortCircuitTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Sqs/BrokerTest.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Sqs/ErrorJob.php delete mode 100644 plugins/jobs/oooold/tests/Jobs/Sqs/Job.php delete mode 100644 plugins/jobs/oooold/tests/bootstrap.php delete mode 100644 plugins/jobs/oooold/tests/consumer.php delete mode 100644 plugins/jobs/oooold/tests/docker-compose.yml (limited to 'plugins') diff --git a/plugins/jobs/oooold/tests/.rr.yaml b/plugins/jobs/oooold/tests/.rr.yaml deleted file mode 100644 index 2fd323db..00000000 --- a/plugins/jobs/oooold/tests/.rr.yaml +++ /dev/null @@ -1,63 +0,0 @@ -jobs: - # worker pool configuration - workers: - command: "php consumer.php" - pool: - numWorkers: 4 - - # rabbitmq and similar servers - amqp: - addr: amqp://guest:guest@localhost:5672/ - - # beanstalk configuration - beanstalk: - addr: tcp://localhost:11300 - - # amazon sqs configuration - sqs: - key: api-key - secret: api-secret - region: us-west-1 - endpoint: http://localhost:9324 - - # job destinations and options - dispatch: - spiral-jobs-tests-amqp-*.pipeline: amqp - spiral-jobs-tests-local-*.pipeline: local - spiral-jobs-tests-beanstalk-*.pipeline: beanstalk - spiral-jobs-tests-sqs-*.pipeline: sqs - - # list of broker pipelines associated with endpoints - pipelines: - local: - broker: ephemeral - - amqp: - broker: amqp - queue: default - - beanstalk: - broker: beanstalk - tube: default - - sqs: - broker: sqs - queue: default - declare: - MessageRetentionPeriod: 86400 - - # list of pipelines to be consumed by the server, keep empty if you want to start consuming manually - consume: ["local", "amqp", "beanstalk", "sqs"] - -metrics: - address: localhost:2112 - -# monitors rr server(s) -limit: - interval: 1 - services: - jobs: - maxMemory: 100 - TTL: 0 - idleTTL: 0 - execTTL: 60 \ No newline at end of file diff --git a/plugins/jobs/oooold/tests/Jobs/Amqp/BrokerTest.php b/plugins/jobs/oooold/tests/Jobs/Amqp/BrokerTest.php deleted file mode 100644 index 637c14d6..00000000 --- a/plugins/jobs/oooold/tests/Jobs/Amqp/BrokerTest.php +++ /dev/null @@ -1,20 +0,0 @@ -job = static::JOB; - $this->errorJob = static::ERROR_JOB; - } - - protected function tearDown(): void - { - if (file_exists((static::JOB)::JOB_FILE)) { - unlink((static::JOB)::JOB_FILE); - } - } - - public function testJob(): void - { - $jobs = $this->makeJobs(); - - $id = $jobs->push($this->job, ['data' => 100]); - - $this->assertNotEmpty($id); - - $this->waitForJob(); - $this->assertFileExists($this->job::JOB_FILE); - - $data = json_decode(file_get_contents($this->job::JOB_FILE), true); - $this->assertSame($id, $data['id']); - $this->assertSame(100, $data['data']); - } - - public function testErrorJob(): void - { - $jobs = $this->makeJobs(); - - $id = $jobs->push($this->errorJob, ['data' => 100]); - $this->assertNotEmpty($id); - } - - public function testDelayJob(): void - { - $jobs = $this->makeJobs(); - - $id = $jobs->push($this->job, ['data' => 100], Options::delayed(1)); - - $this->assertNotEmpty($id); - - $this->assertTrue($this->waitForJob() > 1); - $this->assertFileExists($this->job::JOB_FILE); - - $data = json_decode(file_get_contents($this->job::JOB_FILE), true); - $this->assertSame($id, $data['id']); - $this->assertSame(100, $data['data']); - } - - /** - * @expectedException \Spiral\Jobs\Exception\JobException - */ - public function testConnectionException(): void - { - $jobs = new Queue( - new RPC(new SocketRelay('localhost', 6002)), - new ContainerRegistry(new Container()) - ); - - $jobs->push($this->job, ['data' => 100]); - } - - public function makeJobs(): Queue - { - return new Queue( - new RPC(new SocketRelay('localhost', 6001)), - new ContainerRegistry(new Container()) - ); - } - - private function waitForJob(): float - { - $start = microtime(true); - $try = 0; - while (!file_exists($this->job::JOB_FILE) && $try < 10) { - usleep(250000); - $try++; - } - - return microtime(true) - $start; - } -} diff --git a/plugins/jobs/oooold/tests/Jobs/Beanstalk/BrokerTest.php b/plugins/jobs/oooold/tests/Jobs/Beanstalk/BrokerTest.php deleted file mode 100644 index d1ea4682..00000000 --- a/plugins/jobs/oooold/tests/Jobs/Beanstalk/BrokerTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertNull($o->getDelay()); - $o = $o->withDelay(10); - $this->assertSame(10, $o->getDelay()); - } - - public function testPipeline(): void - { - $o = new Options(); - $this->assertNull($o->getPipeline()); - $o = $o->withPipeline('custom'); - $this->assertSame('custom', $o->getPipeline()); - } -} diff --git a/plugins/jobs/oooold/tests/Jobs/RegistryTest.php b/plugins/jobs/oooold/tests/Jobs/RegistryTest.php deleted file mode 100644 index 7abd75f7..00000000 --- a/plugins/jobs/oooold/tests/Jobs/RegistryTest.php +++ /dev/null @@ -1,43 +0,0 @@ -getHandler('spiral.jobs.tests.local.job'); - $this->assertInstanceOf(Job::class, $j); - - $this->assertSame(json_encode(['data' => 200]), $j->serialize( - 'spiral.jobs.tests.local.job', - ['data' => 200] - )); - } - - /** - * @expectedException \Spiral\Jobs\Exception\JobException - */ - public function testMakeUndefined(): void - { - $factory = new ContainerRegistry(new Container()); - - $factory->getHandler('spiral.jobs.undefined'); - } -} diff --git a/plugins/jobs/oooold/tests/Jobs/ShortCircuitTest.php b/plugins/jobs/oooold/tests/Jobs/ShortCircuitTest.php deleted file mode 100644 index c3306385..00000000 --- a/plugins/jobs/oooold/tests/Jobs/ShortCircuitTest.php +++ /dev/null @@ -1,90 +0,0 @@ -push(Job::class, ['data' => 100]); - - $this->assertNotEmpty($id); - - $this->assertFileExists(Job::JOB_FILE); - - $data = json_decode(file_get_contents(Job::JOB_FILE), true); - $this->assertSame($id, $data['id']); - $this->assertSame(100, $data['data']); - } - - public function testLocalDelayed(): void - { - $c = new ContainerRegistry(new Container()); - $jobs = new ShortCircuit($c, $c); - - $t = microtime(true); - $id = $jobs->push(Job::class, ['data' => 100], Options::delayed(1)); - - $this->assertTrue(microtime(true) - $t >= 1); - - $this->assertNotEmpty($id); - - $this->assertFileExists(Job::JOB_FILE); - - $data = json_decode(file_get_contents(Job::JOB_FILE), true); - $this->assertSame($id, $data['id']); - $this->assertSame(100, $data['data']); - } - - /** - * @expectedException \Spiral\Jobs\Exception\JobException - */ - public function testError(): void - { - $c = new ContainerRegistry(new Container()); - $jobs = new ShortCircuit($c, $c); - $jobs->push(ErrorJob::class); - } - - public function testLocalDelay(): void - { - $c = new ContainerRegistry(new Container()); - $jobs = new ShortCircuit($c, $c); - - $id = $jobs->push(Job::class, ['data' => 100], Options::delayed(1)); - $this->assertNotEmpty($id); - - $this->assertFileExists(Job::JOB_FILE); - - $data = json_decode(file_get_contents(Job::JOB_FILE), true); - $this->assertSame($id, $data['id']); - $this->assertSame(100, $data['data']); - } -} diff --git a/plugins/jobs/oooold/tests/Jobs/Sqs/BrokerTest.php b/plugins/jobs/oooold/tests/Jobs/Sqs/BrokerTest.php deleted file mode 100644 index ccaa96de..00000000 --- a/plugins/jobs/oooold/tests/Jobs/Sqs/BrokerTest.php +++ /dev/null @@ -1,20 +0,0 @@ -serve($rr); diff --git a/plugins/jobs/oooold/tests/docker-compose.yml b/plugins/jobs/oooold/tests/docker-compose.yml deleted file mode 100644 index 7b88c9cf..00000000 --- a/plugins/jobs/oooold/tests/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - beanstalk: - image: schickling/beanstalkd - ports: - - "11300:11300" - - sqs: - image: vsouza/sqs-local - ports: - - "9324:9324" - - rabbitmq: - image: rabbitmq:3-management - environment: - RABBITMQ_DEFAULT_USER: guest - RABBITMQ_DEFAULT_PASS: guest - RABBITMQ_DEFAULT_VHOST: / - ports: - - "15672:15672" - - "5672:5672" \ No newline at end of file -- cgit v1.2.3