-
Notifications
You must be signed in to change notification settings - Fork 119
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
feat: Save am instrument
logs to file & handle parsing error.
#2049
Conversation
Catch `am instrument` output parsing error. If `am instrument` logs paring failed, mark affected lines in error message. Close console connection right after receiving expected results or error without waiting for idle.
df48115
to
7e66bb9
Compare
7e66bb9
to
0ece007
Compare
Timestamp: 2021-06-29 16:03:28 |
maxShardsCount = 1, | ||
) | ||
|
||
private val dir = File(args.outputDir) |
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.
Instead of File
use TemporaryFolder
(JUnit). Current implementation does not guarantee clean up after failed tests/exception thrown
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.
Instead of
File
useTemporaryFolder
(JUnit). Current implementation does not guarantee clean up after failed tests/exception thrown
I do not agree. This is the first shot from duckduckgo for the phase JUnit After
: https://junit.org/junit4/javadoc/4.12/org/junit/After.html
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.
And this is the short from google (I do not use duckduckgo, maybe I should start to do so)
https://junit.org/junit4/javadoc/4.12/org/junit/rules/TemporaryFolder.html
@After
may throw an exception itself which will break i.e. recursive deletion.
Not saying your implementation will not work, most likely it will be working fine.
TemporaryFolder
is implemented to be used in exactly the same cases we have in this particular test.
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.
Ok, so according to documentation, the TemporaryFolder
is also not guaranteed deletion, similar to @After
. Unlike, it will not throw an exception on recursive deletion fail. This is bad because the test should always clean up its own garbages, if it is not possible that means probably some external process is reading the files created during the test. This situation is an edge case that should throw an exception.
import org.junit.Assert | ||
import org.junit.Test | ||
|
||
class ExecuteAndroidTestPlanKtTest { |
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.
Please add unmockkAll()
tear down method -- unmocked tests may interact between test suites (we had this issue couple of times in the past)
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.
Fixed
""" | ||
Error while parsing results from instance $id. | ||
For details check $logFile lines $lines. | ||
|
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.
Blank line left intentionally?
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.
Yup
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'm not giving the approval since I do not agree with some decisions in tests (personal preferences). But I don't want to block anything when it should work fine.
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'm not giving the approval since I do not agree with some decisions in tests (personal preferences). But I don't want to block anything when it should work fine.
ah, whatever
Thx 😄 👍 |
Fixes #2037
Improvements:
am instrument
logs to file inadb_log
output directory.am instrument
output parsing error and mark affected lines in the error message.Test Plan
flank corellium test android run
createsadb_log
inside output directory with dumpedam instrument
console outputs.am instrument
log fails the error message in the console will communicate file with lines where the error occurs.Checklist