From 26e43cac515f8dba87fcc6b3074e0df7f2fb3e09 Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 10 Nov 2023 10:40:23 +0100 Subject: [PATCH] moved assertions after "assume" call (#3045) --- .../io/sentry/uitest/android/EnvelopeTests.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/EnvelopeTests.kt b/sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/EnvelopeTests.kt index 9e490bb1e5..b1c1474b26 100644 --- a/sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/EnvelopeTests.kt +++ b/sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/EnvelopeTests.kt @@ -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] @@ -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)