Skip to content

[sqs] Skip tests if no amazon credentinals present. #180

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

Merged
merged 1 commit into from
Aug 28, 2017
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
12 changes: 4 additions & 8 deletions pkg/sqs/Tests/Spec/SqsProducerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@

namespace Enqueue\Sqs\Tests\Spec;

use Enqueue\Sqs\SqsConnectionFactory;
use Enqueue\Test\SqsExtension;
use Interop\Queue\Spec\PsrProducerSpec;

/**
* @group functional
*/
class SqsProducerTest extends PsrProducerSpec
{
use SqsExtension;

/**
* {@inheritdoc}
*/
protected function createProducer()
{
$factory = new SqsConnectionFactory([
'key' => getenv('AWS__SQS__KEY'),
'secret' => getenv('AWS__SQS__SECRET'),
'region' => getenv('AWS__SQS__REGION'),
]);

return $factory->createContext()->createProducer();
return $this->buildSqsContext()->createProducer();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Enqueue\Sqs\Tests\Spec;

use Enqueue\Sqs\SqsConnectionFactory;
use Enqueue\Sqs\SqsContext;
use Enqueue\Sqs\SqsDestination;
use Enqueue\Test\RetryTrait;
use Enqueue\Test\SqsExtension;
use Interop\Queue\PsrContext;
use Interop\Queue\Spec\SendAndReceiveDelayedMessageFromQueueSpec;

Expand All @@ -16,6 +16,7 @@
class SqsSendAndReceiveDelayedMessageFromQueueTest extends SendAndReceiveDelayedMessageFromQueueSpec
{
use RetryTrait;
use SqsExtension;

/**
* @var SqsContext
Expand All @@ -41,13 +42,7 @@ protected function tearDown()
*/
protected function createContext()
{
$factory = new SqsConnectionFactory([
'key' => getenv('AWS__SQS__KEY'),
'secret' => getenv('AWS__SQS__SECRET'),
'region' => getenv('AWS__SQS__REGION'),
]);

return $this->context = $factory->createContext();
return $this->context = $this->buildSqsContext();
}

/**
Expand Down
12 changes: 4 additions & 8 deletions pkg/sqs/Tests/Spec/SqsSendToAndReceiveFromQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Enqueue\Sqs\Tests\Spec;

use Enqueue\Sqs\SqsConnectionFactory;
use Enqueue\Sqs\SqsContext;
use Enqueue\Sqs\SqsDestination;
use Enqueue\Test\SqsExtension;
use Interop\Queue\PsrContext;
use Interop\Queue\Spec\SendToAndReceiveFromQueueSpec;

Expand All @@ -13,6 +13,8 @@
*/
class SqsSendToAndReceiveFromQueueTest extends SendToAndReceiveFromQueueSpec
{
use SqsExtension;

/**
* @var SqsContext
*/
Expand All @@ -37,13 +39,7 @@ protected function tearDown()
*/
protected function createContext()
{
$factory = new SqsConnectionFactory([
'key' => getenv('AWS__SQS__KEY'),
'secret' => getenv('AWS__SQS__SECRET'),
'region' => getenv('AWS__SQS__REGION'),
]);

return $this->context = $factory->createContext();
return $this->context = $this->buildSqsContext();
}

/**
Expand Down
12 changes: 4 additions & 8 deletions pkg/sqs/Tests/Spec/SqsSendToAndReceiveFromTopicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Enqueue\Sqs\Tests\Spec;

use Enqueue\Sqs\SqsConnectionFactory;
use Enqueue\Sqs\SqsContext;
use Enqueue\Sqs\SqsDestination;
use Enqueue\Test\SqsExtension;
use Interop\Queue\PsrContext;
use Interop\Queue\Spec\SendToAndReceiveFromTopicSpec;

Expand All @@ -13,6 +13,8 @@
*/
class SqsSendToAndReceiveFromTopicTest extends SendToAndReceiveFromTopicSpec
{
use SqsExtension;

/**
* @var SqsContext
*/
Expand All @@ -37,13 +39,7 @@ protected function tearDown()
*/
protected function createContext()
{
$factory = new SqsConnectionFactory([
'key' => getenv('AWS__SQS__KEY'),
'secret' => getenv('AWS__SQS__SECRET'),
'region' => getenv('AWS__SQS__REGION'),
]);

return $this->context = $factory->createContext();
return $this->context = $this->buildSqsContext();
}

/**
Expand Down