-
Notifications
You must be signed in to change notification settings - Fork 48
add integration tests to CircleCI build #53
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
Closed
abacaphiliac
wants to merge
1
commit into
launchdarkly:master
from
abacaphiliac:circle-integration-tests
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| } | ||
| ], | ||
| "require": { | ||
| "monolog/monolog": "1.21.0", | ||
| "php": ">=5.3", | ||
| "predis/predis": "1.0.*" | ||
| }, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?php | ||
| namespace LaunchDarkly; | ||
|
|
||
|
|
||
| /** | ||
| * Feature requester from an LDD-populated redis, with APC caching | ||
| * | ||
| * @package LaunchDarkly | ||
| */ | ||
| class ApcuLDDFeatureRequester extends ApcLDDFeatureRequester | ||
| { | ||
| /** | ||
| * @param $key | ||
| * @param null $success | ||
| * @return mixed | ||
| */ | ||
| protected function fetch($key, &$success = null) | ||
| { | ||
| return \apcu_fetch($key, $success); | ||
| } | ||
|
|
||
| /** | ||
| * @param $key | ||
| * @param $var | ||
| * @param int $ttl | ||
| * @return bool | ||
| */ | ||
| protected function add($key, $var, $ttl = 0) | ||
| { | ||
| return \apcu_add($key, $var, $ttl); | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intention for having this class vs ApcLDDFeatureRequester? Their phpdoc is the same. Adding use cases and examples to the Readme would also be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APC and APCU are different extensions. please correct me if i'm wrong; APC is only available up to php54. beyond that, the docs recommend usage of the built-in op-code cache. so a compatible APCU extension was created for >=php56. my change will allow integrations to choose APC or APCU based on which extension they have installed and should cover a wider range of PHP versions. i felt i needed to do this as a part of this merge request because i'm trying to get the integration tests to run on CircleCI for the default php56 version, which does not support APC (i think). the integration tests that run in the Vagrant VM switch the PHP version to php54, which is fine, but i think we should be able to run integration tests on other php versions.
i'd be happy to update the docs with use cases and examples. didn't know if this was a welcome proposal. also, the integration tests are failing the build, for a couple of reasons. one is that monolog needs to be installed (addressed here #55) and the other (i think) is that the feature-generator function in the integration tests needs to be updated. i took a crack at it in another pull request, but i felt it was getting bloated. thoughts on how to proceed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged #55 so that should be be ok now. Yes please update the docs regarding apc vs. apcu. Your changes are definitely welcome.
Thanks!