-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from bugsnag/v5-auto-update-build-uuid
Add autoUpdateBuildUuid flag to prevent manifest UUID generation
- Loading branch information
Showing
17 changed files
with
138 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "bugsnag-maze-runner", git: 'https://github.com/bugsnag/maze-runner', :tag => 'v1.2.0' | ||
gem "bugsnag-maze-runner", git: 'https://github.com/bugsnag/maze-runner', :branch => 'v1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Feature: Auto update build UUID flag | ||
|
||
Scenario: Build UUID excluded from request when set to false | ||
When I build "default_app" using the "auto_update_build_uuid" bugsnag config | ||
Then I should receive 2 requests | ||
|
||
And the request 0 is valid for the Android Mapping API | ||
And the field "apiKey" for multipart request 0 equals "TEST_API_KEY" | ||
And the field "versionCode" for multipart request 0 equals "1" | ||
And the field "versionName" for multipart request 0 equals "1.0" | ||
And the field "appId" for multipart request 0 equals "com.bugsnag.android.example" | ||
And the field "overwrite" for multipart request 0 is null | ||
And the field "buildUuid" for multipart request 0 is null | ||
|
||
And the request 1 is valid for the Build API | ||
And the payload field "appVersion" equals "1.0" for request 1 | ||
And the payload field "apiKey" equals "TEST_API_KEY" for request 1 | ||
And the payload field "builderName" is not null for request 1 | ||
And the payload field "buildTool" equals "gradle-android" for request 1 | ||
And the payload field "appVersionCode" equals "1" for request 1 | ||
And the payload field "buildUuid" is null for request 1 | ||
|
||
And the payload field "sourceControl.provider" equals "github" for request 1 | ||
And the payload field "sourceControl.repository" equals "https://github.com/bugsnag/bugsnag-android-gradle-plugin.git" for request 1 | ||
And the payload field "sourceControl.revision" is not null for request 1 | ||
And the payload field "metadata.os_arch" is not null for request 1 | ||
And the payload field "metadata.os_name" is not null for request 1 | ||
And the payload field "metadata.os_version" is not null for request 1 | ||
And the payload field "metadata.java_version" is not null for request 1 | ||
And the payload field "metadata.gradle_version" is not null for request 1 | ||
And the payload field "metadata.git_version" is not null for request 1 |
5 changes: 5 additions & 0 deletions
5
features/fixtures/config/bugsnag/auto_update_build_uuid.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.autoUpdateBuildUuid = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/test/kotlin/com/bugsnag/android/gradle/AndroidManifestParseNoUuidTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.bugsnag.android.gradle | ||
|
||
import org.gradle.api.logging.Logger | ||
import org.junit.After | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Before | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.mockito.Mock | ||
import org.mockito.junit.MockitoJUnitRunner | ||
import java.io.File | ||
|
||
@RunWith(MockitoJUnitRunner::class) | ||
class AndroidManifestParseNoUuidTest { | ||
|
||
private val info = AndroidManifestInfo( | ||
"api-key", | ||
"12", | ||
null, | ||
"5.2", | ||
"com.example" | ||
) | ||
|
||
@Mock | ||
lateinit var logger: Logger | ||
|
||
private lateinit var manifestFile: File | ||
|
||
@Before | ||
fun setUp() { | ||
manifestFile = File.createTempFile("manifest_no_uuid", ".xml") | ||
val classLoader = AndroidManifestParseNoUuidTest::class.java.classLoader | ||
val res = classLoader.getResource("manifest_no_uuid.xml")!! | ||
File(res.file).copyTo(manifestFile, true) | ||
} | ||
|
||
@After | ||
fun tearDown() { | ||
manifestFile.delete() | ||
} | ||
|
||
@Test | ||
fun readManifest() { | ||
val read = AndroidManifestParser().readManifest(manifestFile, logger) | ||
assertEquals(info, read) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example" | ||
android:versionCode="12" | ||
android:versionName="5.2"> | ||
<manifest package="com.example" android:versionCode="12" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="5.2"> | ||
<application android:name="com.example.android.gradle.plugin.FooApp"> | ||
|
||
<meta-data | ||
android:name="com.bugsnag.android.API_KEY" | ||
android:value="api-key"/> | ||
<meta-data android:name="com.bugsnag.android.API_KEY" android:value="api-key"/> | ||
</application> | ||
</manifest> |