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

Add Localstack Docker container for SQS functional tests #473

Merged
merged 4 commits into from
Jul 16, 2018
Merged

Add Localstack Docker container for SQS functional tests #473

merged 4 commits into from
Jul 16, 2018

Conversation

elazar
Copy link
Contributor

@elazar elazar commented Jul 10, 2018

While testing my changes from #444, I noticed that the following tests are skipped in the build because there is presently no local SQS instance to test against.

1) Enqueue\Sqs\Tests\Functional\SqsCommonUseCasesTest::testWaitsForTwoSecondsAndReturnNullOnReceive
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Functional/SqsCommonUseCasesTest.php:34

2) Enqueue\Sqs\Tests\Functional\SqsCommonUseCasesTest::testReturnNullImmediatelyOnReceiveNoWait
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Functional/SqsCommonUseCasesTest.php:34

3) Enqueue\Sqs\Tests\Functional\SqsCommonUseCasesTest::testProduceAndReceiveOneMessageSentDirectlyToQueue
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Functional/SqsCommonUseCasesTest.php:34

4) Enqueue\Sqs\Tests\Functional\SqsCommonUseCasesTest::testProduceAndReceiveOneMessageSentDirectlyToTopic
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Functional/SqsCommonUseCasesTest.php:34

5) Enqueue\Sqs\Tests\Functional\SqsConsumptionUseCasesTest::testConsumeOneMessageAndExit
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Functional/SqsConsumptionUseCasesTest.php:33
/mqdev/pkg/test/RetryTrait.php:22

6) Enqueue\Sqs\Tests\Functional\SqsConsumptionUseCasesTest::testConsumeOneMessageAndSendReplyExit
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Functional/SqsConsumptionUseCasesTest.php:33
/mqdev/pkg/test/RetryTrait.php:22

7) Enqueue\Sqs\Tests\Spec\SqsProducerTest::testShouldImplementPsrContextInterface
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Spec/SqsProducerTest.php:20
/mqdev/vendor/queue-interop/queue-spec/src/PsrProducerSpec.php:14

8) Enqueue\Sqs\Tests\Spec\SqsSendAndReceiveDelayedMessageFromQueueTest::test
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Spec/SqsSendAndReceiveDelayedMessageFromQueueTest.php:45
/mqdev/vendor/queue-interop/queue-spec/src/SendAndReceiveDelayedMessageFromQueueSpec.php:31
/mqdev/pkg/test/RetryTrait.php:22

9) Enqueue\Sqs\Tests\Spec\SqsSendToAndReceiveFromQueueTest::test
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Spec/SqsSendToAndReceiveFromQueueTest.php:42
/mqdev/vendor/queue-interop/queue-spec/src/SendToAndReceiveFromQueueSpec.php:31

10) Enqueue\Sqs\Tests\Spec\SqsSendToAndReceiveFromTopicTest::test
Functional tests are not allowed in this environment

/mqdev/pkg/test/SqsExtension.php:16
/mqdev/pkg/sqs/Tests/Spec/SqsSendToAndReceiveFromTopicTest.php:45
/mqdev/vendor/queue-interop/queue-spec/src/SendToAndReceiveFromTopicSpec.php:31
/mqdev/pkg/test/RetryTrait.php:22

This PR adds a LocalStack Docker container that allows these tests to be run in the build.

@makasim
Copy link
Member

makasim commented Jul 10, 2018

We do not need a real sqs service, do we? This is great!

The check in tests could be removed and tests are adjusted to use local stack instance.

@elazar
Copy link
Contributor Author

elazar commented Jul 10, 2018

For some reason, the AWS env vars are going missing on Travis even though they work when I run the tests locally. Still trying to figure out why.

@makasim
Copy link
Member

makasim commented Jul 10, 2018

Because there are ones added by travis, they are encrypted. Travis removes them from a build if run by someone, not from enqueue organization.

@makasim
Copy link
Member

makasim commented Jul 10, 2018

I've removed them.

@elazar
Copy link
Contributor Author

elazar commented Jul 10, 2018

@makasim Are you able to kick off a build for this PR that passes?

@elazar
Copy link
Contributor Author

elazar commented Jul 13, 2018

@makasim Is there further action on my part that's needed to get this merged?

@@ -1,9 +1,6 @@
parameters:
locale: 'en'
secret: 'ThisTokenIsNotSoSecretChangeIt'
env(AWS_SQS_REGION): 'us-east-1'
env(AWS_SQS_KEY): 'key'
env(AWS_SQS_SECRET): 'secret'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add them back, and add AWS_SQS_ENDPOINT too.

@makasim
Copy link
Member

makasim commented Jul 13, 2018

@elazar are we good to go?

@elazar
Copy link
Contributor Author

elazar commented Jul 13, 2018

@makasim Appears so. I was trying to avoid duplicating the env vars in custom-config.yml since they were already being set in docker-compose.yml, and the test code could already see them. Not sure why also adding them in the Symfony config was necessary. At least it works? Maybe we should add comments in docker-compose.yml and custom-config.yml reminding the reader that the values have to be changed in both places?

@elazar
Copy link
Contributor Author

elazar commented Jul 16, 2018

@makasim Any else need changing on this PR, or is it good to merge?

@makasim makasim merged commit da52e3c into php-enqueue:master Jul 16, 2018
@makasim
Copy link
Member

makasim commented Jul 16, 2018

Sorry, forgot about it. merged.

@elazar
Copy link
Contributor Author

elazar commented Jul 16, 2018

Awesome, thanks! 😄

@elazar elazar deleted the feature/localstack-for-sqs branch July 16, 2018 15:08
ASKozienko pushed a commit that referenced this pull request Nov 2, 2018
Add Localstack Docker container for SQS functional tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants