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 crash when starting without a config file #24

Merged
merged 2 commits into from
May 22, 2017

Conversation

mihaitodor
Copy link
Contributor

@mihaitodor mihaitodor commented May 17, 2017

  • Add unit test to cover this scenario (TestNewConfigFromFlagSet)
  • Refactor the code
    • let NewConfigFromFile return an error if the client name is not set. We don't care if addDefaultSubscription is called with an empty client name.
    • creating a dummyClient for each test which needs it is cleaner
    • goimports reflowed the files a bit

- Add unit test to cover this scenario
@mihaitodor
Copy link
Contributor Author

mihaitodor commented May 17, 2017

Looks like my new unit test didn't work because CircleCI executes go test -v -race ./... and ExtractFlags kills the client if it finds a flag that it doesn't recognise (-v in this case).

I pushed another commit to refactor ExtractFlags to allow me to mock the command line parser.

@AlexisMontagne
Copy link
Member

Sorry for the delay @mihaitodor, It looks good to me, i'll merge it now

@AlexisMontagne AlexisMontagne merged commit 4b57232 into upfluence:master May 22, 2017
@mihaitodor
Copy link
Contributor Author

Thanks @AlexisMontagne! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants