Skip to content

Update GitHubRepositories Tests and Refactor Get-GitHubRepository Function - #233

Merged
Howard Wolosky (HowardWolosky) merged 10 commits into
microsoft:masterfrom
X-Guardian:GitHubRepositories-Test-Additions
Jun 28, 2020
Merged

Update GitHubRepositories Tests and Refactor Get-GitHubRepository Function#233
Howard Wolosky (HowardWolosky) merged 10 commits into
microsoft:masterfrom
X-Guardian:GitHubRepositories-Test-Additions

Conversation

@X-Guardian

@X-GuardianSimon Heather (X-Guardian) commented Jun 12, 2020

Copy link
Copy Markdown
Contributor

Description

This PR updates the Pester tests for the GitHubRepositories module to increase the code coverage. This then exposed a code path in the Get-GithubRepository that could never be taken, so the function was refactored to remove this path and simplify the function logic.

A missing ValidateSet was also added to the Affiliation parameter of the Get-GitHubRepository function and incorrect Comment Based Help descriptions for the Get-GitHubRepositoryCollaborator and Move-GitHubRepositoryOwnership functions were fixed.

Issues Fixed

None

References

N/A

Checklist

  • You actually ran the code that you just wrote, especially if you did just "one last quick change".
  • Comment-based help added/updated, including examples.
  • Static analysis is reporting back clean.
  • New/changed code adheres to our coding guidelines.
  • Changes to the manifest file follow the manifest guidance.
  • Unit tests were added/updated and are all passing. See testing guidelines.
  • Relevant usage examples have been added/updated in USAGE.md.
  • If desired, ensure your name is added to our Contributors list

Comment threadGitHubRepositories.ps1 Outdated
@HowardWolosky

Copy link
Copy Markdown
Contributor

Thanks for this. Conflicts abound in the tests between this and the work going on for pipelining (which is nearly completed), so I'm going to hold off on this one until early next week if you don't mind....

@HowardWoloskyHoward Wolosky (HowardWolosky) added the bug This relates to a bug in the existing module. label Jun 12, 2020
@X-Guardian

Copy link
Copy Markdown
ContributorAuthor

Yep no problem Howard. I'll leave it in Draft state for now.

@HowardWoloskyHoward Wolosky (HowardWolosky) added the api-repositories Work to complete the API's defined here: https://developer.github.com/v3/repos/ label Jun 18, 2020
@X-Guardian
Simon Heather (X-Guardian) marked this pull request as ready for review June 20, 2020 10:56

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks so much for doing this. Increased code coverage in tests is always good, especially if it catches a dead block of code.

Looks like there are a few minor formatting issues and one bug introduced by this.

Otherwise, there may be some duplicative tests within here (especially around topics, collaborators and contributors) with the advent of the tests added for #242.

Comment threadGitHubRepositories.ps1
Comment threadGitHubRepositories.ps1
Comment threadGitHubRepositories.ps1
Comment threadGitHubRepositories.ps1
Comment threadTests/GitHubRepositories.tests.ps1 Outdated
@HowardWoloskyHoward Wolosky (HowardWolosky) added the waiting for update Waiting for an update to the PR before the next review label Jun 20, 2020
@X-Guardian

Copy link
Copy Markdown
ContributorAuthor

Can we trigger the CI for this PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update looks great -- we just need to resolve the duplicative tests.

Comment threadTests/GitHubRepositories.tests.ps1
Comment threadTests/GitHubRepositories.tests.ps1
@X-Guardian

Copy link
Copy Markdown
ContributorAuthor

Howard Wolosky (@HowardWolosky) Can we trigger the CI for this PR?

@HowardWolosky

Copy link
Copy Markdown
Contributor

/azp run PowerShellForGitHub-CI

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment threadTests/GitHubRepositories.tests.ps1 Outdated
Comment threadTests/GitHubRepositories.tests.ps1 Outdated
Comment threadTests/GitHubRepositories.tests.ps1 Outdated
Comment threadTests/GitHubRepositories.tests.ps1 Outdated
Comment threadTests/GitHubRepositories.tests.ps1
Comment threadTests/GitHubRepositories.tests.ps1 Outdated
@HowardWolosky

Copy link
Copy Markdown
Contributor

Now that #205 is in, you have some expected merge conflicts to deal with.

@HowardWolosky

Copy link
Copy Markdown
Contributor

/azp run PowerShellForGitHub-CI

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@HowardWolosky
Howard Wolosky (HowardWolosky) merged commit eedfaa3 into microsoft:masterJun 28, 2020
@HowardWoloskyHoward Wolosky (HowardWolosky) removed the waiting for update Waiting for an update to the PR before the next review label Jun 29, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-repositoriesWork to complete the API's defined here: https://developer.github.com/v3/repos/bugThis relates to a bug in the existing module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@X-Guardian@HowardWolosky