Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] Add more tests around the AMQP transport #27206

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
May 10, 2018

Conversation

sroze
Copy link
Contributor

@sroze sroze commented May 8, 2018

Q A
Branch? 4.1
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets ø
License MIT
Doc PR ø

Adding more tests to the AMQP transport/factory. These should have captured the following 3 bugs: #27198, #27197, #27196.

@sroze sroze force-pushed the add-more-tests-around-the-amqp-transport branch from 092b559 to 022c47f Compare May 8, 2018 21:27
@sroze sroze added this to the 4.1 milestone May 8, 2018
@sroze sroze force-pushed the add-more-tests-around-the-amqp-transport branch from 022c47f to 4b8a655 Compare May 8, 2018 21:28
@@ -34,7 +34,13 @@ public function __construct(EncoderInterface $encoder, DecoderInterface $decoder

public function createTransport(string $dsn, array $options): TransportInterface
{
return new AmqpTransport($this->encoder, $this->decoder, $dsn, $options, $this->debug);
return new AmqpTransport(
Copy link
Member

@yceruto yceruto May 8, 2018

Choose a reason for hiding this comment

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

shouldn't it be in one line?

Copy link
Member

Choose a reason for hiding this comment

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

yes, it should

new AmqpTransport($encoder, $decoder, Connection::fromDsn('amqp://localhost', array('foo' => 'bar'), true), array('foo' => 'bar'), true),
$transport
);
}
Copy link
Member

Choose a reason for hiding this comment

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

should be on one line

$connection,
$options,
$debug
);
Copy link
Member

Choose a reason for hiding this comment

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

one line as well

@@ -22,18 +22,17 @@ class AmqpTransport implements TransportInterface
{
private $encoder;
private $decoder;
private $dsn;
private $connection;
private $options;
Copy link
Contributor

Choose a reason for hiding this comment

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

$options and $debug are not used anymore

@sroze sroze force-pushed the add-more-tests-around-the-amqp-transport branch from 4b8a655 to 1c0bb0e Compare May 9, 2018 07:44
@sroze
Copy link
Contributor Author

sroze commented May 9, 2018

@fabpot @yceruto @ogizanagi good catches, updated.

use Symfony\Component\Messenger\Transport\Serialization\EncoderInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;

class AmqpTransportTest extends TestCase
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should requires amqp extension

@sroze sroze force-pushed the add-more-tests-around-the-amqp-transport branch from 1c0bb0e to faf9382 Compare May 9, 2018 08:04
$this->dsn = $dsn;
$this->options = $options;
$this->debug = $debug;
$this->connection = $connection;
Copy link
Member

Choose a reason for hiding this comment

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

This removes laziness. I'd suggest to try harder keeping feature. The factory could validate the dsn itself if that's the goal here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non. The laziness is already within the Connection object. There is no point of making a class creation lazy 😄 (and even that is already lazy as behind service locators)

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Got it :)

@sroze sroze merged commit faf9382 into symfony:4.1 May 10, 2018
sroze added a commit that referenced this pull request May 10, 2018
…oze)

This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Add more tests around the AMQP transport

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ø
| License       | MIT
| Doc PR        | ø

Adding more tests to the AMQP transport/factory. These should have captured the following 3 bugs: #27198, #27197, #27196.

Commits
-------

faf9382 Add more tests around the AMQP transport
@sroze sroze deleted the add-more-tests-around-the-amqp-transport branch May 10, 2018 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.