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

test: Add scenario that starts Bugsnag with no arguments #677

Merged
merged 3 commits into from
Jun 11, 2020

Conversation

bengourley
Copy link
Contributor

Spiking out automated tests for #676 – starting Bugsnag with no params/arguments, loading all config from the plist. Once the approach has been ratified I can add more assertions.

@twometresteve unfortunately this breaks your dynamic manual/automatic mode:

let config: BugsnagConfiguration
if (apiKeyField.text!.count > 0) {
// Manual testing mode - use the real dashboard and the API key provided
let apiKey = apiKeyField.text!
NSLog("Running in manual mode with API key: %@", apiKey)
UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
config = BugsnagConfiguration(apiKeyField.text!)
}
else {
// Automation mode
config = BugsnagConfiguration("12312312312312312312312312312312")
config.endpoints = BugsnagEndpointConfiguration(notify: "http://bs-local.com:9339", sessions: "http://bs-local.com:9339")
}

Since there's no place to change the values at runtime, I had to hardcode the bs local url directly in the plist. I'm not sure of a good way to resolve this.

@Cawllec
Copy link
Contributor

Cawllec commented Jun 5, 2020

Based on my knowledge of how the Android configuration loading worked, hard coding a URL into the plist shouldn't effect any configurations except those that load it explicitly or call Bugsnag.start with no configuration.

Is this not the case?

@Cawllec Cawllec marked this pull request as ready for review June 11, 2020 11:47
@Cawllec
Copy link
Contributor

Cawllec commented Jun 11, 2020

This should now be ready for a review

@Cawllec Cawllec requested a review from twometresteve June 11, 2020 11:57
Copy link
Contributor

@twometresteve twometresteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Cawllec Cawllec merged commit c08a1ad into v6 Jun 11, 2020
@Cawllec Cawllec deleted the bengourley/test-bugsnag-start-no-args branch June 11, 2020 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants