Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate version information to device.runtimeVersions #340

Merged
merged 2 commits into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Source/BugsnagKSCrashSysInfoParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@
BSGDictSetSafeObject(deviceState, report[@"machine"], @"model");
BSGDictSetSafeObject(deviceState, report[@"system_name"], @"osName");
BSGDictSetSafeObject(deviceState, report[@"system_version"], @"osVersion");
BSGDictSetSafeObject(deviceState, report[@"os_version"], @"osBuild");

NSString *osVersion = report[@"os_version"];

if (osVersion != nil) {
BSGDictSetSafeObject(deviceState, @{@"osBuild": osVersion}, @"runtimeVersions");
}

BSGDictSetSafeObject(deviceState, @(PLATFORM_WORD_SIZE), @"wordSize");
BSGDictSetSafeObject(deviceState, @"Apple", @"manufacturer");
BSGDictSetSafeObject(deviceState, report[@"jailbroken"], @"jailbroken");
Expand Down
2 changes: 1 addition & 1 deletion Tests/BugsnagSinkTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ - (void)testEventDevice {
XCTAssertEqualObjects(device[@"modelNumber"], @"MacBookPro11,3");
XCTAssertEqualObjects(device[@"osName"], @"iPhone OS");
XCTAssertEqualObjects(device[@"osVersion"], @"8.1");
XCTAssertEqualObjects(device[@"osBuild"], @"14B25");
XCTAssertEqualObjects(device[@"runtimeVersions"][@"osBuild"], @"14B25");
XCTAssertEqualObjects(device[@"totalMemory"], @15065522176);
XCTAssertNotNil(device[@"freeDisk"]);
XCTAssertEqualObjects(device[@"timezone"], @"PST");
Expand Down
14 changes: 14 additions & 0 deletions features/runtime_versions.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Feature: Runtime versions are included in all requests

Scenario: Runtime versions included in Cocoa error
When I run "HandledErrorScenario"
Then I should receive a request
And the request is valid for the error reporting API
And the payload field "events.0.device.runtimeVersions.osBuild" is not null

Scenario: Runtime versions included in Cocoa session
When I run "ManualSessionScenario"
And I wait for 10 seconds
Then I should receive a request
And the request is a valid for the session tracking API
And the payload field "device.runtimeVersions.osBuild" is not null