File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
runner/android_junit_runner
javatests/androidx/test/runner
java/androidx/test/internal/runner/listener Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 88
99** New Features**
1010
11+ * Make perfetto trace sections for tests more identifiable by prefixing with "test:" and using fully qualified class name. (b/204992764)
12+
1113** Breaking Changes**
1214
1315** API Changes**
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public void testStarted(Description description) throws Exception {
3636 String testClassName =
3737 description .getTestClass () != null ? description .getTestClass ().getSimpleName () : "None" ;
3838 String methodName = description .getMethodName () != null ? description .getMethodName () : "None" ;
39- Trace .beginSection (sanitizeSpanName (testClassName + "#" + methodName ));
39+ Trace .beginSection (sanitizeSpanName ("test:" + testClassName + "#" + methodName ));
4040 }
4141
4242 @ Override
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ public void createsSection_withShortName() throws Exception {
5252 listener .testFinished (description );
5353
5454 assertThat (ShadowTrace .getCurrentSections ()).isEmpty ();
55- assertThat (ShadowTrace .getPreviousSections ()).containsExactly ("ClassUnderTest#theMethodName" );
55+ assertThat (ShadowTrace .getPreviousSections ())
56+ .containsExactly ("test:ClassUnderTest#theMethodName" );
5657 }
5758
5859 @ Test
@@ -72,7 +73,7 @@ public void createsSection_withLongName() throws Exception {
7273 assertThat (ShadowTrace .getCurrentSections ()).isEmpty ();
7374 assertThat (ShadowTrace .getPreviousSections ())
7475 .containsExactly (
75- "ClassUnderTest#anExcessivelyLongDescriptionStringWithLengthAboveThe127CharLimitWillBeTrimmedToAvoidThrowingAnExceptionFromBegin " );
76+ "test: ClassUnderTest#anExcessivelyLongDescriptionStringWithLengthAboveThe127CharLimitWillBeTrimmedToAvoidThrowingAnExceptionFrom " );
7677 }
7778
7879 private static final class ClassUnderTest {}
You can’t perform that action at this time.
0 commit comments