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

Included tests for internal/collector/github/factory #286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nathannaveen
Copy link
Contributor

@nathannaveen nathannaveen commented Dec 16, 2022

  • Included tests for internal/collector/github/factory
  • Included mocks for query
  • Added interface for query

Signed-off-by: nathannaveen 42319948+nathannaveen@users.noreply.github.com

- Included tests for internal/collector/github/factory

Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
@nathannaveen
Copy link
Contributor Author

I removed:

if r.BasicData != nil {
// Already finished. Don't init() more than once.
return nil
}

I removed this because r.BasicData is never going to be nil. The New function in the factory.go file is the only place init is called. r.BasicData is never set when the code calls r.init()because r is initialized without BasicData:

r := &repo{
    client:  f.client,
    origURL: u,
    logger:  f.logger.With(zap.String("url", u.String())),
}

@nathannaveen
Copy link
Contributor Author

@calebbrown A friendly ping!

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.

None yet

1 participant