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

Committer Finder should attempt to resolve all users before reporting failure for one #46

Open
sehaswell opened this issue Mar 2, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@sehaswell
Copy link
Contributor

sehaswell commented Mar 2, 2020

Committer finder returns early upon finding a user with no e-mail, without attempting to resolve the e-mails of other users.
This proposed unit test for committerFinder shows this:

// TODO: do we need to get info on both users at once?
// committerFinder exits after finding a missing e-mail  - is missing e-mail likely, or even possible?
it("will inform us about multiple unresolved users if they are unresolvable in different ways", async function() {
   let unresolvableMocks = {};
   unresolvableMocks.gitlabRequest = gitlabApiMocks.gitlabRequest;
   unresolvableMocks.getCommits = function(projectId, mergeRequestId) {
     return [noEmailBobCommit, unmappedEmailCommit];
   };
   unresolvableMocks.getUserInfo = gitlabApiMocks.getUserInfo;

   mock("../src/gitlabApi", unresolvableMocks);
   const committerFinder = mock.reRequire("../src/committerFinder");
   let response = await committerFinder(
     goodProjectId,
     goodMergeRequestId,
     goodGitlabToken
  );

  let expectedResponse = {
    unresolvedLoginNames: [noEmailBobCommit.author_name, unmappedEmailCommit.author_name],
    distinctUsersToVerify: []
   };

   expect(response).toEqual(expectedResponse);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant