8000 test: client fetch unit tests by jhoward-lm · Pull Request #205 · bomctl/bomctl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

test: client fetch unit tests #205 8000

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

Merged
merged 7 commits into from
Nov 7, 2024
Merged

test: client fetch unit tests #205

merged 7 commits into from
Nov 7, 2024

Conversation

jhoward-lm
Copy link
Contributor
@jhoward-lm jhoward-lm commented Nov 6, 2024

Description

This PR adds unit tests for fetching from Git, HTTP, and OCI URLs using ephemeral test servers.

Fixes #179

Miscellaneous

  • Extract duplicated test suite setup code into new testutil package (e.g. populating a database backend)
  • Embed the BasicAuth struct from go-git into netutil.BasicAuth and remove unnecessary overridden methods. Now created by using the new netutil.NewBasicAuth(username, password string) function
  • Replace generic //nolint:revive directives with explicit revive ignores, e.g. //revive:disable:defer

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
…h-unit-tests

Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
…h-unit-tests

Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
@jhoward-lm jhoward-lm self-assigned this Nov 6, 2024
@jhoward-lm jhoward-lm requested a review from a team as a code owner November 6, 2024 20:29
@jhoward-lm jhoward-lm linked an issue Nov 6, 2024 that may be closed by this pull request
Signed-off-by: Jonathan Howard <jonathan.w.howard@lmco.com>
Copy link
Member
@ashearin ashearin left a comment

Choose a reason for hiding this comment

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

Awesome stuff! Great improvement on our testing infrastructure!

One future improvement I'd like to see is a more robust set of testing files. More formats, different encodings where appropriate. You mentioned counterfeiter. I can make an issue to explore.

@idunbarh idunbarh merged commit 3a4da54 into main Nov 7, 2024
10 checks passed
@idunbarh idunbarh deleted the 179-fetch-unit-tests branch November 7, 2024 18:27
Sign up for free to join this convers 881B ation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Implement client fetch unit tests
3 participants
0