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

Fix logger initialization error in unit tests #204

Merged
merged 1 commit into from
Sep 20, 2019

Conversation

victorkifer
Copy link
Contributor

Environment.getExternalStorageState() returns null in Unit Tests. Which causes and error in the logger initialization. This pull request fixes the issue.
Screen Shot 2019-09-17 at 13 25 05

@tony19
Copy link
Owner

tony19 commented Sep 17, 2019

Hmm. This shouldn't be occurring. Are you using Robolectric as your test runner?

@tony19
Copy link
Owner

tony19 commented Sep 17, 2019

The fix seems reasonable, so I'll certainly accept the PR. Looking forward to your response for clarity.

@tony19 tony19 changed the base branch from master to wip/2.0.2 September 17, 2019 21:19
@victorkifer
Copy link
Contributor Author

No, the error occurs in regular unit tests which cover the business logic without dependencies on Android components. So I don't want to use Robolectric in this case, cause it significantly slows down the test initialization.

@victorkifer
Copy link
Contributor Author

I'm using unitTests.returnDefaultValues = true. And Logback is configured to use ConsoleAppender for such tests.

@victorkifer victorkifer reopened this Sep 18, 2019
@tony19 tony19 merged commit 558034b into tony19:wip/2.0.2 Sep 20, 2019
@lock
Copy link

lock bot commented Oct 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the archived label Oct 20, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants