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

Leverage "options.parameters" config in PhpredisClientFactory::create() #505

Merged
merged 1 commit into from
Mar 26, 2019

Conversation

phansys
Copy link
Contributor

@phansys phansys commented Mar 13, 2019

Q A
Branch master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

@phansys
Copy link
Contributor Author

phansys commented Mar 13, 2019

Without these changes, parameters provided at snc_redis.clients.{name}.options.parameters are completely ignored within "phpredis". If this was the desired behavior, I think the current branch is right; otherwise, this must be considered a fix and the base should be updated to target 2.1.
Thank you in advance.

@B-Galati
Copy link
Collaborator

Thanks @phansys! Could you target 2.1 please?

@phansys phansys changed the base branch from master to 2.1 March 14, 2019 10:06
@phansys phansys force-pushed the phpredis_parameters branch from d49049b to 8cedf3e Compare March 14, 2019 10:08
@phansys
Copy link
Contributor Author

phansys commented Mar 14, 2019

Updated target to 2.1. I'm working on the tests in order to fix them.

@phansys phansys changed the title Leverage "options.parameters" config in PhpredisClientFactory::create() [WIP] Leverage "options.parameters" config in PhpredisClientFactory::create() Mar 14, 2019
@phansys
Copy link
Contributor Author

phansys commented Mar 14, 2019

I had to use the full service definition in tests ("snc_redis.phpredis.default") instead of the short alias ("snc_redis.default" ) in tests since it seems to be unavailable in tests for phpredis. Do you have any clue about this?

$container->setAlias(sprintf('snc_redis.%s', $client['alias']), new Alias($phpredisId, true));

@phansys
Copy link
Contributor Author

phansys commented Mar 14, 2019

Given my last comment, I think this PR should wait for #506 in order to fix the service definition.

@B-Galati
Copy link
Collaborator

It's ok if you just use snc_redis.phpredis.default service id for tests, this will be fixed in future 3.0.0 where only short id will be kept.

@phansys phansys changed the title [WIP] Leverage "options.parameters" config in PhpredisClientFactory::create() Leverage "options.parameters" config in PhpredisClientFactory::create() Mar 14, 2019
@phansys phansys force-pushed the phpredis_parameters branch from 3f64274 to a82b01f Compare March 14, 2019 14:56
@phansys
Copy link
Contributor Author

phansys commented Mar 14, 2019

This PR should wait #507 to fix the usage of phpredis through Client class.

@B-Galati
Copy link
Collaborator

I don't get why we did not have this error before 🤔

@B-Galati
Copy link
Collaborator

I get it, the test was not executed at all before 😅
Thank you for moving it 👍

@B-Galati B-Galati added the bug Not working as intended label Mar 14, 2019
@phansys phansys force-pushed the phpredis_parameters branch 2 times, most recently from f8b7ece to a733e03 Compare March 15, 2019 15:29
@phansys phansys changed the title Leverage "options.parameters" config in PhpredisClientFactory::create() [WIP] Leverage "options.parameters" config in PhpredisClientFactory::create() Mar 15, 2019
@phansys phansys force-pushed the phpredis_parameters branch from a733e03 to cd0d853 Compare March 15, 2019 16:19
@phansys
Copy link
Contributor Author

phansys commented Mar 15, 2019

@B-Galati, in order to get this PR merged and separated concerns, I've restored PhpredisClientFactoryTest to its original path (keeping the changes related to this PR). I've created #508 in order to address the location change.
Thank you in advance.

@phansys phansys changed the title [WIP] Leverage "options.parameters" config in PhpredisClientFactory::create() Leverage "options.parameters" config in PhpredisClientFactory::create() Mar 15, 2019
@B-Galati
Copy link
Collaborator

@phansys Please keep everything in this one as it is related in some way IMHO.

Also tests that depends on a specific phpredis version are usually handled like so:

if (!extension_loaded('redis')) {
$this->markTestSkipped('This test needs the PHP Redis extension to work');
} elseif (version_compare(phpversion('redis'), '4.0.0') >= 0) {
$this->markTestSkipped('This test cannot be executed on Redis extension version ' . phpversion('redis'));
}

No need to bother with redis4 group or something like this.

@phansys phansys force-pushed the phpredis_parameters branch from cd0d853 to 3f5d108 Compare March 15, 2019 18:16
@phansys
Copy link
Contributor Author

phansys commented Mar 15, 2019

Done @B-Galati.

@B-Galati
Copy link
Collaborator

@phansys Awesome! Thanks a lot!

@B-Galati B-Galati merged commit a98f08a into snc:2.1 Mar 26, 2019
@phansys phansys deleted the phpredis_parameters branch March 26, 2019 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants