Skip to content

Commit df44da0

Browse files
Merge pull request #2224 from bugsnag/tms/fixture-version
Use the Buildkite build number for the test fixture app version
2 parents b08fcad + 841d005 commit df44da0

9 files changed

Lines changed: 23 additions & 9 deletions

File tree

features/fixtures/mazerunner/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
minSdkVersion 17
1212
targetSdkVersion 34
1313
versionCode 1
14-
versionName "1.1.14"
14+
versionName System.getenv("BUILDKITE_BUILD_NUMBER") ?: "1.1.14"
1515
manifestPlaceholders = [
1616
// omit any of the following placeholders to use the default values
1717
bugsnagApiKey: "abc12312312312312312312312312312",

features/full_tests/internal_error_reports.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Feature: Cached Error Reports
3939
And the event "app.id" equals "com.bugsnag.android.mazerunner"
4040
And the event "app.releaseStage" equals "mazerunner"
4141
And the event "app.type" equals "android"
42-
And the event "app.version" equals "1.1.14"
42+
And the event app version matches the built app version
4343
And the event "app.versionCode" equals 1
4444
And the error payload field "events.0.app.duration" is an integer
4545
And the error payload field "events.0.app.durationInForeground" is an integer

features/full_tests/load_configuration.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Feature: Loading values into the configuration
4545
And the event "metaData.test.filter_me" equals "foobar"
4646
And the event "app.versionCode" equals 1
4747
And the event "app.buildUUID" is not null
48-
And the event "app.version" equals "1.1.14"
48+
And the event app version matches the built app version
4949
And the event "app.type" is null
5050
And the event "user.id" is not null
5151
And the event "user.name" is null

features/smoke_tests/01_anr.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Feature: ANR smoke test
3939
And the event "app.id" equals "com.bugsnag.android.mazerunner"
4040
And the event "app.releaseStage" equals "mazerunner"
4141
And the event "app.type" equals "android"
42-
And the event "app.version" equals "1.1.14"
42+
And the event app version matches the built app version
4343
And the event "app.versionCode" equals 1
4444
And the error payload field "events.0.app.duration" is an integer
4545
And the error payload field "events.0.app.durationInForeground" is an integer

features/smoke_tests/02_handled.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Feature: Handled smoke tests
3939
And the event "app.id" equals "com.bugsnag.android.mazerunner"
4040
And the event "app.releaseStage" equals "mazerunner"
4141
And the event "app.type" equals "android"
42-
And the event "app.version" equals "1.1.14"
42+
And the event app version matches the built app version
43+
4344
And the event "app.versionCode" equals 1
4445
And the error payload field "events.0.app.duration" is an integer
4546
And the error payload field "events.0.app.durationInForeground" is an integer
@@ -195,7 +196,7 @@ Feature: Handled smoke tests
195196
And the event "app.id" equals "com.bugsnag.android.mazerunner"
196197
And the event "app.releaseStage" equals "mazerunner"
197198
And the event "app.type" equals "android"
198-
And the event "app.version" equals "1.1.14"
199+
And the event app version matches the built app version
199200
And the event "app.versionCode" equals 1
200201
And the error payload field "events.0.app.duration" is an integer
201202
And the error payload field "events.0.app.durationInForeground" is an integer

features/smoke_tests/03_sessions.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Feature: Session functionality smoke tests
2323
And the session payload field "app.id" equals "com.bugsnag.android.mazerunner"
2424
And the session payload field "app.releaseStage" equals "mazerunner"
2525
And the session payload field "app.type" equals "android"
26-
And the session payload field "app.version" equals "1.1.14"
26+
And the session app version matches the built app version
2727
And the session payload field "app.versionCode" equals 1
2828

2929
# Device data

features/smoke_tests/04_unhandled.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Feature: Unhandled smoke tests
4040
And the event "app.id" equals "com.bugsnag.android.mazerunner"
4141
And the event "app.releaseStage" equals "mazerunner"
4242
And the event "app.type" equals "android"
43-
And the event "app.version" equals "1.1.14"
43+
And the event app version matches the built app version
4444
And the event "app.versionCode" equals 1
4545
And the error payload field "events.0.app.duration" is an integer
4646
And the error payload field "events.0.app.durationInForeground" is an integer

features/steps/android_steps.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,15 @@ def click_if_present(element)
304304
regex = Regexp.new pattern
305305
Maze.check.match regex, lastBreadcrumbName
306306
end
307+
308+
def expected_app_version
309+
ENV['BUILDKITE_BUILD_NUMBER'] || '1.1.14'
310+
end
311+
312+
Then("the session app version matches the built app version") do
313+
step "the session payload field \"app.version\" equals \"#{expected_app_version}\""
314+
end
315+
316+
Then("the event app version matches the built app version") do
317+
step "the event \"app.version\" equals \"#{expected_app_version}\""
318+
end

scripts/build-test-fixture.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
def upload_files(api_key, dest)
22
Dir.chdir('features/fixtures/mazerunner') do
33
upload = "bugsnag-cli upload"
4-
options = "--api-key=#{api_key} --overwrite --version-code=1"
4+
version_code = ENV['BUILDKITE_BUILD_NUMBER']
5+
options = "--api-key=#{api_key} --version-code=#{version_code}"
56
puts "Uploading symbol files to #{dest}"
67
puts `#{upload} android-ndk #{options}`
78
puts "Uploading mapping file to #{dest}"

0 commit comments

Comments
 (0)