Skip to content

Commit

Permalink
moved assertions after "assume" call (#3045)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanosiano authored Nov 10, 2023
1 parent a73f0be commit 26e43ca
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ class EnvelopeTests : BaseUiTest() {
val profilingTraceData: ProfilingTraceData = it.assertProfile()
it.assertNoOtherItems()

assertEquals("profiledTransaction", transactionItem.transaction)
assertEquals(profilingTraceData.transactionId, transaction.eventId.toString())
assertEquals("profiledTransaction", profilingTraceData.transactionName)
assertTrue(profilingTraceData.environment.isNotEmpty())
assertTrue(profilingTraceData.cpuArchitecture.isNotEmpty())
assertTrue(profilingTraceData.transactions.isNotEmpty())
assertTrue(profilingTraceData.measurementsMap.isNotEmpty())

// We check the measurements have been collected with expected units
val slowFrames = profilingTraceData.measurementsMap[ProfileMeasurement.ID_SLOW_FRAME_RENDERS]
val frozenFrames = profilingTraceData.measurementsMap[ProfileMeasurement.ID_FROZEN_FRAME_RENDERS]
Expand All @@ -97,6 +89,14 @@ class EnvelopeTests : BaseUiTest() {
// Frame rate could be null in headless emulator tests (agp-matrix workflow)
assumeNotNull(frameRates)

assertEquals("profiledTransaction", transactionItem.transaction)
assertEquals(profilingTraceData.transactionId, transaction.eventId.toString())
assertEquals("profiledTransaction", profilingTraceData.transactionName)
assertTrue(profilingTraceData.environment.isNotEmpty())
assertTrue(profilingTraceData.cpuArchitecture.isNotEmpty())
assertTrue(profilingTraceData.transactions.isNotEmpty())
assertTrue(profilingTraceData.measurementsMap.isNotEmpty())

// Slow and frozen frames can be null (in case there were none)
if (slowFrames != null) {
assertEquals(ProfileMeasurement.UNIT_NANOSECONDS, slowFrames.unit)
Expand Down

0 comments on commit 26e43ca

Please sign in to comment.