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

Refactor package main to enable testing of CLI interface #98

Merged
merged 1 commit into from
Nov 13, 2022

Conversation

mccutchen
Copy link
Owner

I may come to regret the brittleness and busywork this might add to this project's test suite, but: I didn't like how much untested argument/env parsing logic lived inside the main function, so I factored it out into a testable package.

One thing missing from fully testing the app is the ability to actually run it and test graceful server shutdown. Maybe later.

@codecov-commenter
Copy link

Codecov Report

Merging #98 (d440d9f) into main (aaf674e) will decrease coverage by 0.61%.
The diff coverage is 93.45%.

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
- Coverage   99.34%   98.72%   -0.62%     
==========================================
  Files           6        7       +1     
  Lines         911     1018     +107     
==========================================
+ Hits          905     1005     +100     
- Misses          3        8       +5     
- Partials        3        5       +2     
Impacted Files Coverage Δ
httpbin/cmd/cmd.go 93.45% <93.45%> (ø)

@mccutchen
Copy link
Owner Author

Overall test coverage has dropped, but this adds test coverage to a previously untested bit of complex logic.

@mccutchen mccutchen merged commit 00323fa into main Nov 13, 2022
@mccutchen mccutchen deleted the test-main branch November 13, 2022 15:26
@mccutchen mccutchen mentioned this pull request Nov 13, 2022
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.

2 participants