-
Notifications
You must be signed in to change notification settings - Fork 310
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
Improve Test Coverage Even More #385
Comments
Okay, so #384 turns out to not be an issue after all. But I'm still worried something like this could happen in the future. |
Travis CI is supposed to catch these failures. |
Travis would miss something like...
...unless that branch actually gets taken on Travis. So Travis can miss non-supported language features if they're in very rarely taken branches that aren't fully covered by test cases. So to really resolve this we either need near-100% code coverage in our tests or some sort of static analysis tool that identifies unsupported language features (but such a tool probably can't exist, or will false positive like crazy, since it can't determine if the thing that's missing will be polyfilled at runtime). |
Googling lead me to a php compatibility checker. Let's see how many false positives this gives. |
That thing doesn't do what I want either. If I replace all occurrences of |
We're now measuring code coverage! https://codecov.io/gh/defuse/php-encryption |
Looking through these coverage results, branches that are feasible to test (e.g. excluding things like code paths that require the CSPRNG to be unavailable, since those are hard to test) but aren't being tested are... Core.php
Crypto.php
Encoding.php
File.php
Key.php
KeyOrPassword.php
KeyProtectedByPassword.php
RuntimeTests.php
|
Working on this in #398. |
Now that #398 landed, I'm satisfied we have enough test coverage for v2.2. There's still room for improvement, but it can wait until later. |
We have pretty good coverage, and we get diminishing returns for the effort required to bring it higher. Let's just be careful about code review and make sure new features/code come with good tests. |
We need this to avoid problems like #384. Maybe there's some static analysis tool we can add to travis that makes sure everything is fine for a given version of PHP?
The text was updated successfully, but these errors were encountered: