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

Update comparisons in test files from reflect to cmp #1875

Merged
merged 1 commit into from May 26, 2021

Conversation

sagar23sj
Copy link
Contributor

Replaced all reflect.DeepEqual comparisons in test files with cmp.Equal.

Fixes: #1851

@google-cla google-cla bot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label May 26, 2021
@sagar23sj
Copy link
Contributor Author

sagar23sj commented May 26, 2021

Can someone help me understand, why checks are failing?
I ran all 3 commands go generate, go test, and go vet on my local before pushing the changes, but still, these are somehow failing in checks.

@willnorris
Copy link
Collaborator

willnorris commented May 26, 2021

Looks like there is still a reference to the reflect package, but it's not imported any longer:

Error: github/orgs_members_test.go:835:6: undefined: reflect

https://github.com/google/go-github/pull/1875/checks?check_run_id=2677192197#step:8:9

@sagar23sj
Copy link
Contributor Author

Looks like there is still a reference to the reflect package, but it's not imported any longer:

Error: github/orgs_members_test.go:835:6: undefined: reflect

https://github.com/google/go-github/pull/1875/checks?check_run_id=2677192197#step:8:9

Thanks for replying, but I checked there is no "reflect" imported for that particular file in the branch I created PR with.

@willnorris
Copy link
Collaborator

It looks like you need to rebase onto the upstream master branch, as you're missing some commits that apparently are getting picked up by the CI jobs (notably d39b94d).

I don't entirely understand why it's not simply running the CI jobs against your branch, which should pass, but would then have problems come merge time. Maybe it's automatically trying to merge your changes with master, resulting in these errors?

@sagar23sj
Copy link
Contributor Author

It looks like you need to rebase onto the upstream master branch, as you're missing some commits that apparently are getting picked up by the CI jobs (notably d39b94d).

I don't entirely understand why it's not simply running the CI jobs against your branch, which should pass, but would then have problems come merge time. Maybe it's automatically trying to merge your changes with master, resulting in these errors?

Thanks @willnorris , I didn't realize my branch was not up to date.
Pushed again after rebasing, I hope checks pass now.

@willnorris
Copy link
Collaborator

okay, so now the error about the reflect reference in orgs_members_test.go is correct :) You'll need to switch that one to use the cmp package as well.

Replaced all reflect.DeepEqual comparisons in test files with cmp.Equal.

Fixes: google#1851
@codecov
Copy link

codecov bot commented May 26, 2021

Codecov Report

Merging #1875 (80fd6fc) into master (0318e77) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1875   +/-   ##
=======================================
  Coverage   97.65%   97.65%           
=======================================
  Files         105      105           
  Lines        6783     6783           
=======================================
  Hits         6624     6624           
  Misses         86       86           
  Partials       73       73           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0318e77...80fd6fc. Read the comment docs.

@sagar23sj
Copy link
Contributor Author

sagar23sj commented May 26, 2021

okay, so now the error about the reflect reference in orgs_members_test.go is correct :) You'll need to switch that one to use the cmp package as well.

Thanks for helping @willnorris . I have fixed the issue and seems like checks have also passed.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @sagar23sj and @willnorris !
LGTM.

Awaiting second LGTM before merging.

@gmlewis gmlewis requested a review from wesleimp May 26, 2021 18:47
@gmlewis gmlewis changed the title fix: Updated comparisons in test files Update comparisons in test files from reflect to cmp May 26, 2021
@willnorris willnorris merged commit 51e7595 into google:master May 26, 2021
@willnorris
Copy link
Collaborator

@gmlewis oops, looks like I missed catching your issue rename before merging :)

@gmlewis
Copy link
Collaborator

gmlewis commented May 26, 2021

😂 No problem, Will!

gmlewis added a commit to gmlewis/go-github that referenced this pull request Aug 21, 2021
gmlewis added a commit that referenced this pull request Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

switch tests to use github.com/google/go-cmp package
3 participants