Skip to content

Commit

Permalink
Merge branch 'next' into integration/deliver-on-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
lemnik authored Oct 6, 2022
2 parents 75646d1 + 14cef4e commit db2aa9f
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ steps:
- "--exclude=features/full_tests/[^a-k].*.feature"
- "--app=/app/build/fixture-r19.apk"
- "--farm=bs"
- "--device=ANDROID_7_1_SAMSUNG_GALAXY_NOTE_8"
- "--device=ANDROID_7_1"
- "--fail-fast"
env:
TEST_FIXTURE_SYMBOL_DIR: "build/fixture-r19"
Expand All @@ -176,7 +176,7 @@ steps:
- "--exclude=features/full_tests/[^l-z].*.feature"
- "--app=/app/build/fixture-r19.apk"
- "--farm=bs"
- "--device=ANDROID_7_1_SAMSUNG_GALAXY_NOTE_8"
- "--device=ANDROID_7_1"
- "--fail-fast"
env:
TEST_FIXTURE_SYMBOL_DIR: "build/fixture-r19"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ steps:
- "features/smoke_tests"
- "--app=/app/build/fixture-r19.apk"
- "--farm=bs"
- "--device=ANDROID_7_1_SAMSUNG_GALAXY_NOTE_8"
- "--device=ANDROID_7_1"
- "--fail-fast"
concurrency: 24
concurrency_group: 'browserstack-app'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ public DeliveryStatus deliver(@NonNull Session payload,
}
};
}

@NonNull
public static Delivery createDefaultDelivery() {
return new DefaultDelivery(null, NoopLogger.INSTANCE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,7 @@ internal fun createCustomHeaderDelivery(): Delivery {
}
}

fun createDefaultDelivery(): Delivery { // use reflection as DefaultDelivery is internal
val clz = Class.forName("com.bugsnag.android.DefaultDelivery")
return clz.constructors[0].newInstance(
null,
object : Logger {
override fun e(msg: String) = Unit
override fun e(msg: String, throwable: Throwable) = Unit
override fun w(msg: String) = Unit
override fun w(msg: String, throwable: Throwable) = Unit
override fun i(msg: String) = Unit
override fun i(msg: String, throwable: Throwable) = Unit
override fun d(msg: String) = Unit
override fun d(msg: String, throwable: Throwable) = Unit
}
) as Delivery
}
fun createDefaultDelivery(): Delivery = JavaHooks.createDefaultDelivery()

internal fun writeErrorToStore(client: Client, event: Event) {
client.eventStore.write(event)
Expand Down
19 changes: 19 additions & 0 deletions features/full_tests/native_crash_handling.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Feature: Native crash reporting
Background:
Given I clear all persistent data

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Dereference a null pointer
When I run "CXXDereferenceNullScenario" and relaunch the crashed app
And I configure Bugsnag for "CXXDereferenceNullScenario"
Expand All @@ -21,6 +23,9 @@ Feature: Native crash reporting
| get_the_null_value() | CXXDereferenceNullScenario.cpp | 7 |
And the "codeIdentifier" of stack frame 0 is not null


# TODO: Several scenarios skipped on Android 7.1 (Google Pixel) do to additional stack frames. See PLAT-9011

# This scenario will not pass on API levels < 18, as stack corruption
# is handled without calling atexit handlers, etc.
# In the device logs you will see:
Expand All @@ -30,6 +35,8 @@ Feature: Native crash reporting
# Refactored here to use abort() on newer versions:
# https://android.googlesource.com/platform/bionic/+/fb7eb5e07f43587c2bedf2aaa53b21fa002417bb
@skip_below_api18
# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Stack buffer overflow
When I run "CXXStackoverflowScenario" and relaunch the crashed app
And I configure Bugsnag for "CXXStackoverflowScenario"
Expand All @@ -43,6 +50,8 @@ Feature: Native crash reporting
| crash_stack_overflow | CXXStackoverflowScenario.cpp |
And the "codeIdentifier" of stack frame 0 is not null

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Program trap()
When I run "CXXTrapScenario" and relaunch the crashed app
And I configure Bugsnag for "CXXTrapScenario"
Expand All @@ -61,6 +70,8 @@ Feature: Native crash reporting
| trap_it() | CXXTrapScenario.cpp | 12 |
And the "codeIdentifier" of stack frame 0 is not null

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Write to read-only memory
When I run "CXXWriteReadOnlyMemoryScenario" and relaunch the crashed app
And I configure Bugsnag for "CXXWriteReadOnlyMemoryScenario"
Expand All @@ -75,6 +86,8 @@ Feature: Native crash reporting
| Java_com_bugsnag_android_mazerunner_scenarios_CXXWriteReadOnlyMemoryScenario_crash | CXXWriteReadOnlyMemoryScenario.cpp | 22 |
And the "codeIdentifier" of stack frame 0 is not null

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Improper object type cast
When I run "CXXImproperTypecastScenario" and relaunch the crashed app
And I configure Bugsnag for "CXXImproperTypecastScenario"
Expand All @@ -89,6 +102,8 @@ Feature: Native crash reporting
| Java_com_bugsnag_android_mazerunner_scenarios_CXXImproperTypecastScenario_crash | CXXImproperTypecastScenario.cpp | 20 |
And the "codeIdentifier" of stack frame 0 is not null

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Program abort()
When I run "CXXAbortScenario" and relaunch the crashed app
And I configure Bugsnag for "CXXAbortScenario"
Expand Down Expand Up @@ -121,6 +136,8 @@ Feature: Native crash reporting
# Android 6 dladdr does report .so files that are not extracted from their .apk file
# this test cannot pass on these devices with extractNativeLibs=false
@skip_android_6
# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Causing a crash in a separate library
When I run "CXXExternalStackElementScenario" and relaunch the crashed app
And I configure Bugsnag for "CXXExternalStackElementScenario"
Expand All @@ -140,6 +157,8 @@ Feature: Native crash reporting
| Java_com_bugsnag_android_mazerunner_scenarios_CXXExternalStackElementScenario_crash | CXXExternalStackElementScenario.cpp | 20 |
And the "codeIdentifier" of stack frame 0 is not null

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Call null function pointer
A null pointer should be the first element of a stack trace,
followed by the calling function
Expand Down
4 changes: 4 additions & 0 deletions features/full_tests/native_throw_crash.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Feature: Native crash reporting with thrown objects
And the exception "errorClass" equals "SIGABRT"
And the exception "message" equals "Abort program"

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Rethrow in C++ without initial exception
When I run "CXXInvalidRethrow" and relaunch the crashed app
And I configure Bugsnag for "CXXInvalidRethrow"
Expand All @@ -35,6 +37,8 @@ Feature: Native crash reporting with thrown objects
And the first significant stack frames match:
| print_last_exception() | CXXInvalidRethrow.cpp | 7 |

# TODO: Pending PLAT-9011
@skip_android_7
Scenario: Throw from C++ noexcept function
When I run "CXXThrowFromNoexcept" and relaunch the crashed app
And I configure Bugsnag for "CXXThrowFromNoexcept"
Expand Down
2 changes: 2 additions & 0 deletions features/smoke_tests/04_unhandled.feature
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Feature: Unhandled smoke tests
And the event "metaData.opaque.nestedList.2" equals "two"
And the event "metaData.opaque.nestedList.3" equals "three"

# TODO: Pending PLAT-9011
@skip_android_7
@debug-safe
Scenario: C++ exception thrown with overwritten config
When I run "CXXExceptionSmokeScenario" and relaunch the crashed app
Expand Down
10 changes: 7 additions & 3 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@
end

Before('@skip_android_13') do |scenario|
skip_this_scenario("Skipping scenario") if Maze.config.os_version == 13
skip_this_scenario("Skipping scenario") if Maze.config.os_version.floor == 13
end

Before('@skip_android_10') do |scenario|
skip_this_scenario("Skipping scenario") if Maze.config.os_version == 10
skip_this_scenario("Skipping scenario") if Maze.config.os_version.floor == 10
end

Before('@skip_android_7') do |scenario|
skip_this_scenario("Skipping scenario") if Maze.config.os_version.floor == 7
end

Before('@skip_android_6') do |scenario|
skip_this_scenario("Skipping scenario") if Maze.config.os_version == 6
skip_this_scenario("Skipping scenario") if Maze.config.os_version.floor == 6
end

Before('@skip_samsung') do |scenario|
Expand Down

0 comments on commit db2aa9f

Please sign in to comment.