Skip to content

Commit

Permalink
Merge pull request #327 from bugsnag/next
Browse files Browse the repository at this point in the history
Next release
  • Loading branch information
fractalwrench committed Jun 18, 2018
2 parents 7ba6e2b + ba88ac4 commit 7cc8a23
Show file tree
Hide file tree
Showing 40 changed files with 330 additions and 167 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Expand Up @@ -14,6 +14,15 @@ android:
- sys-img-armeabi-v7a-android-19
- sys-img-armeabi-v7a-android-21

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache

env:
matrix:
- ANDROID_TARGET=android-16 ANDROID_ABI=armeabi-v7a
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog

## 4.5.0 (2018-06-18)

**IMPORTANT NOTE**: this release alters the behaviour of the notifier to track sessions automatically.
A session will be automatically captured on each app launch and sent to [https://sessions.bugsnag.com](https://sessions.bugsnag.com). If you
use Bugsnag On-Premise, it is now also recommended that you set your notify and session endpoints
via `config.setEndpoints(String notify, String sessions)`.

* Enable automatic session tracking by default [#314](https://github.com/bugsnag/bugsnag-android/pull/314)

### Bug fixes

* Trim long stacktraces to max limit of 200 [#324](https://github.com/bugsnag/bugsnag-android/pull/324)

## 4.4.1 (2018-05-30)

### Bug fixes
Expand Down Expand Up @@ -29,7 +42,6 @@ and [class documentation for `Delivery`](https://bugsnag.github.io/bugsnag-andro
* Use buffered streams for IO (perf improvement)
[#307](https://github.com/bugsnag/bugsnag-android/pull/307)


## 4.3.4 (2018-05-02)

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@
[![Build status](https://travis-ci.org/bugsnag/bugsnag-android.svg?branch=master)](https://travis-ci.org/bugsnag/bugsnag-android)
[![Coverage Status](https://coveralls.io/repos/github/bugsnag/bugsnag-android/badge.svg?branch=master)](https://coveralls.io/github/bugsnag/bugsnag-android?branch=master)
<!-- Auto-generated line below: -->
![Method count and size](https://img.shields.io/badge/Methods%20and%20size-79%20classes%20|%20629%20methods%20|%20311%20fields%20|%20112%20KB-e91e63.svg)
![Method count and size](https://img.shields.io/badge/Methods%20and%20size-79%20classes%20|%20630%20methods%20|%20312%20fields%20|%20112%20KB-e91e63.svg)

Get comprehensive [Android crash reports](https://www.bugsnag.com/platforms/android/) to quickly debug errors.

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
@@ -1,7 +1,7 @@
buildscript {
repositories {
jcenter()
google()
jcenter()
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions example/build.gradle
@@ -1,7 +1,7 @@
buildscript {
repositories {
jcenter()
google()
jcenter()
mavenLocal()
}
dependencies {
Expand All @@ -14,8 +14,8 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

repositories {
jcenter()
google()
jcenter()
}

android {
Expand Down
2 changes: 1 addition & 1 deletion examplelib/build.gradle
Expand Up @@ -2,9 +2,9 @@ apply plugin: 'com.android.library'

buildscript {
repositories {
jcenter()
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:3.1.0'
Expand Down
6 changes: 3 additions & 3 deletions features/startup_crash.feature
Expand Up @@ -8,7 +8,7 @@ Scenario: 1 startup crash and 1 regular crash persisted
And I configure the app to run in the "CrashOfflineAtStartup" state
And I relaunch the app

And I configure the app to run in the "No crash" state
And I relaunch the app
And I wait for 5 seconds
When I force stop the "com.bugsnag.android.mazerunner" Android app
And I set environment variable "EVENT_TYPE" to "Wait"
And I start the "com.bugsnag.android.mazerunner" Android app using the "com.bugsnag.android.mazerunner.MainActivity" activity
Then I should receive 2 requests
7 changes: 7 additions & 0 deletions features/trimmed_stacktrace.feature
@@ -0,0 +1,7 @@
Feature: Reporting large stacktrace

Scenario: A large stacktrace should have its frames trimmed to a reasonable number
When I run "TrimmedStacktraceScenario" with the defaults
Then I should receive a request
And the request is a valid for the error reporting API
And the payload field "events.0.exceptions.0.stacktrace" is an array with 200 elements
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -11,7 +11,7 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
VERSION_NAME=4.4.1
VERSION_NAME=4.5.0
GROUP=com.bugsnag
POM_SCM_URL=https://github.com/bugsnag/bugsnag-android
POM_SCM_CONNECTION=scm:git@github.com:bugsnag/bugsnag-android.git
Expand Down
2 changes: 1 addition & 1 deletion mazerunner/build.gradle
@@ -1,6 +1,6 @@
repositories {
jcenter()
google()
jcenter()
}

buildscript {
Expand Down
Expand Up @@ -42,8 +42,7 @@ class MainActivity : Activity() {
private fun prepareConfig(): Configuration {
val config = Configuration(intent.getStringExtra("BUGSNAG_API_KEY"))
val port = intent.getStringExtra("BUGSNAG_PORT")
config.endpoint = "${findHostname()}:$port"
config.sessionEndpoint = "${findHostname()}:$port"
config.setEndpoints("${findHostname()}:$port", "${findHostname()}:$port")
return config
}

Expand Down
Expand Up @@ -14,6 +14,7 @@ internal class AutoContextScenario(config: Configuration,
context: Context) : Scenario(config, context) {

override fun run() {
config.setAutoCaptureSessions(false)
super.run()
context.startActivity(Intent(context, SecondActivity::class.java))

Expand Down
Expand Up @@ -14,7 +14,6 @@ internal class AutoSessionScenario(config: Configuration,
context: Context) : Scenario(config, context) {

override fun run() {
config.setAutoCaptureSessions(true)
super.run()
Bugsnag.setUser("123", "user@example.com", "Joe Bloggs")
context.startActivity(Intent(context, SecondActivity::class.java))
Expand Down
@@ -0,0 +1,26 @@
package com.bugsnag.android.mazerunner.scenarios

import android.content.Context
import com.bugsnag.android.Bugsnag
import com.bugsnag.android.Configuration

/**
* Sends an exception with a long stacktrace to Bugsnag, which should trim the stack frames so that
* the request can be sent
*/
internal class TrimmedStacktraceScenario(config: Configuration,
context: Context) : Scenario(config, context) {

override fun run() {
super.run()
val stacktrace = mutableListOf<StackTraceElement>()

for (lineNumber in 1..100000) {
stacktrace.add(StackTraceElement("SomeClass",
"someRecursiveMethod", "Foo.kt", lineNumber))
}

Bugsnag.notify("CustomException", "foo", stacktrace.toTypedArray(), null)
}

}
2 changes: 1 addition & 1 deletion sdk/build.gradle
Expand Up @@ -5,8 +5,8 @@ apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.kt3k.coveralls'

repositories {
jcenter()
google()
jcenter()
}

android {
Expand Down
Expand Up @@ -8,6 +8,7 @@
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -33,6 +34,11 @@ public void setUp() throws Exception {
assertEquals(0, client.breadcrumbs.store.size());
}

@After
public void tearDown() throws Exception {
Async.cancelTasks();
}

@Test
public void noCallback() throws Exception {
client.leaveBreadcrumb("Hello");
Expand Down
Expand Up @@ -11,6 +11,7 @@
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -32,6 +33,11 @@ public void setUp() throws Exception {
breadcrumbs = new Breadcrumbs();
}

@After
public void tearDown() throws Exception {
Async.cancelTasks();
}

@Test
public void testSerialization() throws JSONException, IOException {
breadcrumbs.add(new Breadcrumb("Started app"));
Expand Down
Expand Up @@ -10,6 +10,7 @@
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -32,6 +33,11 @@ public void setUp() throws Exception {
client = new Client(context, config);
}

@After
public void tearDown() throws Exception {
Async.cancelTasks();
}

@Test
public void testSetReleaseStage() throws Exception {
client.setReleaseStage("beta");
Expand Down

This file was deleted.

Expand Up @@ -5,6 +5,7 @@
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -32,6 +33,11 @@ public void setUp() throws Exception {
client.setErrorReportApiClient(apiClient);
}

@After
public void tearDown() throws Exception {
Async.cancelTasks();
}

@Test
public void testNotifyBlockingDefaultSeverity() {
client.notifyBlocking(new RuntimeException("Testing"));
Expand Down
Expand Up @@ -50,6 +50,7 @@ public void setUp() throws Exception {
@After
public void tearDown() throws Exception {
clearSharedPrefs();
Async.cancelTasks();
}

private void clearSharedPrefs() {
Expand Down

0 comments on commit 7cc8a23

Please sign in to comment.