Skip to content

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
@idunbarh idunbarh deleted the 179-fetch-unit-tests branch November 7, 2024 18:27
Sign up for free to join this conversation 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

4 participants