Skip to content

Commit

Permalink
Merge pull request #98 from bugsnag/add-config-scenario
Browse files Browse the repository at this point in the history
Add scenario for plugin extension overrides
  • Loading branch information
fractalwrench authored Apr 10, 2018
2 parents c771d82 + 148e77c commit ae19950
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 4 deletions.
9 changes: 5 additions & 4 deletions features/default_app.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Scenario: Single-module default app builds successfully
And the payload field "metadata.git_version" is not null for request 0

And the request 1 is valid for the Android Mapping API
And the part "apiKey" for request 1 equals "TEST_API_KEY"
And the part "versionCode" for request 1 equals "1"
And the part "versionName" for request 1 equals "1.0"
And the part "appId" for request 1 equals "com.bugsnag.android.example"
And the field "apiKey" for multipart request 1 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 1 equals "1"
And the field "versionName" for multipart request 1 equals "1.0"
And the field "appId" for multipart request 1 equals "com.bugsnag.android.example"
And the field "overwrite" for multipart request 1 is null
31 changes: 31 additions & 0 deletions features/extension_properties.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Feature: Extension properties control plugin behaviour

Scenario: Disable autoReportBuilds
When I build "default_app" using the "auto_report_builds_disabled" bugsnag config
Then I should receive 1 request
And the request 0 is valid for the Android Mapping API

Scenario: Enable debug mapping upload
When I build "debug_proguard" using the "upload_debug_enabled" bugsnag config
Then I should receive 4 requests
And the request 0 is valid for the Build API
And the request 1 is valid for the Build API
And the request 2 is valid for the Android Mapping API
And the request 3 is valid for the Android Mapping API

Scenario: Enable overwrite
When I build "default_app" using the "overwrite_enabled" bugsnag config
Then I should receive 1 request
And the request 0 is valid for the Android Mapping API
And the field "overwrite" for multipart request 0 equals "true"

Scenario: Alter build API values
When I build "default_app" using the "custom_build_info" bugsnag config
Then I should receive 1 request
And the payload field "builderName" equals "Mark Twain" for request 0
And the payload field "buildTool" equals "gradle-android" for request 0
And the payload field "sourceControl.provider" equals "bitbucket" for request 0
And the payload field "sourceControl.repository" equals "https://example.com/bar/foo.git" for request 0
And the payload field "sourceControl.revision" equals "fab8721" for request 0
And the payload field "metadata.MyKey" equals "MyValue"
And the payload field "metadata.os_version" equals "BeOS"
24 changes: 24 additions & 0 deletions features/fixtures/app/module/config/android/debug_proguard.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion Integer.parseInt(project.ANDROID_COMPILE_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

defaultConfig {
applicationId 'com.bugsnag.android.example'
minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)
versionCode Integer.parseInt(project.SAMPLE_VERSION_CODE)
versionName project.SAMPLE_VERSION_NAME
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project.afterEvaluate {
project.bugsnag.endpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.releasesEndpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.autoReportBuilds = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project.afterEvaluate {
project.bugsnag.endpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.releasesEndpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.autoUpload = false

project.bugsnag.builderName = "Mark Twain"
project.bugsnag.sourceControl.provider = "bitbucket"
project.bugsnag.sourceControl.repository = "https://example.com/bar/foo.git"
project.bugsnag.sourceControl.revision = "fab8721"

def map = new HashMap()
map.put("MyKey", "MyValue")
map.put("os_version", "BeOS")
project.bugsnag.metadata = map

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project.afterEvaluate {
project.bugsnag.endpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.releasesEndpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.autoReportBuilds = false
project.bugsnag.overwrite = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project.afterEvaluate {
project.bugsnag.endpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.releasesEndpoint = "http://localhost:${System.env.MOCK_API_PORT}"
project.bugsnag.uploadDebugBuildMappings = true
}

0 comments on commit ae19950

Please sign in to comment.