-
Notifications
You must be signed in to change notification settings - Fork 397
Small improvements #829
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
Small improvements #829
Conversation
Although I couldn't reproduce the original error. I followed the method documentation and moved the close action to process() from process(int) since process(int) should never close the resource under any circumstances anyhow. Also went out of scope a little and verified that the underlying InputStream was open and closed at appropriate steps. Used streams to reduce complexity of a double nested for loop.(If that's frowned upon I'll change it back) Tweaked documentation to use links when refering to library classes.
heuermh
left a comment
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.
minor code style suggestions
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReader.java
Outdated
Show resolved
Hide resolved
biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/GenbankReaderTest.java
Outdated
Show resolved
Hide resolved
biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/GenbankReaderTest.java
Outdated
Show resolved
Hide resolved
biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankReader.java
Outdated
Show resolved
Hide resolved
Added braces to if statement Removed main method
Made style change to isClosed() method
|
Looks like the failing test is in TestUncompressInputStream.java. Which is also failing in master. I compared the original input and the processed array to file and they appear identical at first glance. I'll poke around and see if I can't find out wha't causing the issue. `java.lang.AssertionError: array lengths differed, expected.length=9068 actual.length=9257 |
|
It's the line breaks in 'org/biojava/nbio/core/util/build.xml': they're set to windows line breaks instead of linux ones. I'll put in a pull request. |
…putStream test pass
|
That test now passes... however we got 429 (too many requests) response codes in other tests. |
|
Good catch @lee-mcfaul ! Thanks for fixing the test. It might have broken when re-formatting all code with an automated script in a recent release. I did go through the same fix before that (see e78ea4c) |
josemduarte
left a comment
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.
Looks good to me, thank you! Special thanks for improving docs
Normally I would have opened a new branch. but this issue was causing this pull to fail it's build so I'm doing both in one fel swoop. I put the target files in the resource directory and manually copy them over before each test into the temporary working directory which is scanned before calling out in case the file is already there. this should fix the 429 errors in this class specifically.
Fixing missing slash on the travis build server (works without fix on windows but added check for backslash anyhow)
|
Unit tests passing now. Integration tests failed with a closed ssh connection https://travis-ci.org/biojava/biojava/jobs/496850065 |
josemduarte
left a comment
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.
Thank you again. I think the extra commons-io library is not necessary here.
...core/src/test/java/org/biojava/nbio/core/sequence/loader/GenbankProxySequenceReaderTest.java
Outdated
Show resolved
Hide resolved
|
I've restarted the build. That ssl connection is another external resource that's flaky |
Removed use of apache io library
typo
|
This is turning into a rabbit hole. Any objections to me going through the integration tests, adding any quick fixes to this pull request and setting more complex issues to ignore and creating issues for them? |
josemduarte
left a comment
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.
Thanks, the test changes are great to avoid using the external resource.
I have just one more comment about where to store the new resource files.
...core/src/test/java/org/biojava/nbio/core/sequence/loader/GenbankProxySequenceReaderTest.java
Outdated
Show resolved
Hide resolved
...re/src/test/resources/org/biojava/nbio/core/sequence/GenbankProxySequenceReader/152970917.gb
Show resolved
Hide resolved
|
Regarding fixing other tests: it'd be great if you could help there and remove as many dependencies on external resources as possible. But it'd be better to do that in separate PRs. The issue that should be referenced is #606 |
|
alright, build succeeded. backing away from this pr slowly. I'll have a peek at #606 next |
josemduarte
left a comment
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.
Looks great, thanks again!
|
@heuermh could you give this another look and see if you are happy with it? |
|
I will merge this in tomorrow, unless someone says something against it. |
Although I couldn't reproduce the original error in #800 (I suspect that maybe the user didn't have a version of the libraries that included the fix in #666 ) I followed the method documentation and moved the close action to process() from process(int) since process(int) should never close the resource under any circumstances.
Also verified that the underlying InputStream was open and closed at appropriate steps.
Used streams to reduce complexity of a double nested for loop.(If that's frowned upon I'll change it back)
Tweaked documentation to use links when referring to library classes.