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

more reliable and readable unittest for force push #537

Closed
extrawurst opened this issue Feb 23, 2021 · 4 comments
Closed

more reliable and readable unittest for force push #537

extrawurst opened this issue Feb 23, 2021 · 4 comments
Labels
bug Something isn't working dormant Marked by stale bot on close good first issue Good for newcomers

Comments

@extrawurst
Copy link
Owner

based off of #534 (and #535):

Currently

@WizardOhio24 it looks like the internals of repo_init were unclear: it creates independent temporary test repositories (including an empty commit).

the current unittests both test essentially the same thing:

create **new** repo (a), add empty commit to (a)
create **new** repo (b), add empty commit to (b)
create bare repo (c)

now we commit some temp file to (a)
now we push from (a) to (c)

now we commit some temp file to (b)
test that we cannot push (b) to (c)

now force push (b) to (c) doing a history rewrite

only difference is that the second unittest test_force_push_rewrites_history does some additional checks that the right commit IDs are in (c) at the end.

Desired

  1. test_force_push can be simplified to just test that we can overwrite (c) with (b) - no additional file need to be committed

  2. a real life use case would be nice where we actually create a repo (a), clone (a) to (b) and then have two commits that collide and test that force does what it should

@extrawurst extrawurst added the bug Something isn't working label Feb 23, 2021
@extrawurst extrawurst added this to the v0.12 milestone Feb 24, 2021
@extrawurst extrawurst removed this from the v0.12 milestone Mar 3, 2021
@extrawurst extrawurst added the good first issue Good for newcomers label Jun 1, 2021
@amalik18
Copy link

I can try this

@amalik18
Copy link

How do I assign it to myself?

@extrawurst
Copy link
Owner Author

How do I assign it to myself?

Just open a PR when you are ready and mention this issue in it 👍

@stale
Copy link

stale bot commented Dec 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Dec 2, 2021
@stale stale bot closed this as completed Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dormant Marked by stale bot on close good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants