How to parse `test-result.pb`?
bartekpacia opened this issue · comments
Description
I run tests of my app with ./gradlew :app:connectedDebugAndroidTest
. After the test suite finishes running, several test artifacts are generated, one of which is the test-result.pb
file at app/build/outputs/androidTest-results/connected/test-result.pb
(at least in my case).
I want to parse that file in the command line using the protoc
tool. Unfortunately, there's no documentation about the .proto
where the schema for test-resuls.pb
is defined, so I went on searching.
Searching
The only tool that parses that file (that I know of) is Android Studio, and knowing it's open-source, I went searching there. I found the piece of code responsible for loading test-result.pb
into Android Studio – it's the UtpTestResultAdapter
class. That class reads the test-result.pb
file and creates a TestSuiteResultProto
out of it... but that's where the trail ends. TesetSuiteResultProto
is imported from com.google.testing.platform.proto.api.core.TestSuiteResultProto
, and I cannot find the source code of it anywhere.
That artifact exists on Google's Maven repo, with the following description: The AndroidX Test Library provides an extensive framework for testing Android apps
. But I couldn't find it in this repository.
In fact, searching for TestSuiteResultProto
in the whole AOSP codebase still didn't reveal the original .proto
file where it's defined
Question
Where can I see the original .proto
file for test-result.pb
?
Hi @brettchabot, I see you're an active maintainer of this repo, I thought I'll ping you about this.
That's a mistake in the maven description. The com.google.testing.platform. artifacts reuse some of androidx.test's maven publishing tooling but looks like they should be providing their own description. AFAIK the source for TestSuiteResultProto isn't available at the moment but you'd have to ask the Android Studio team for the authoritative answer.
If you are just looking for parseable test results there might be another way to get them but you'd have to talk to Studio team
Thanks!
What's the best way to "talk to the Studio team"?
File a bug to issuetracker.google.com under App Development > Android Studio > Testing
@bartekpacia Have you found the original .proto
file?
No, unfortunately I haven't had time to do that. If you will create the request on Google's Issue Tracker, please post link here 🙏
I found the proto here: https://mvnrepository.com/artifact/com.google.testing.platform/core-proto
@edsion1107 That's an interesting find, thanks for sharing. But I only see compiled .class
files in that jar – no .proto
file is present. Maybe I do something wrong?
I found this promising folder but it's not there: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:utp/ this project also just imports the JAR.
I tried many different queries on https://cs.android.com/ and https://cs.opensource.google/, but no luck yet.
@brettchabot I tried to file a bug request on issuetracker.google.com (per your suggestion), but I don't have permission:
Put it in "Android Studio", they'll triage it. I usually just try "Recommended component: ..." in text.
Thanks @TWiStErRob – reported as https://issuetracker.google.com/issues/337538011