Skip to content

#371 grade-school: remote test pollution - #382

Closed
rado-radoev wants to merge 0 commit into
exercism:masterfrom
rado-radoev:GradeSchoolTests
Closed

rado-radoev wants to merge 0 commit into
exercism:masterfrom
rado-radoev:GradeSchoolTests

Conversation

@rado-radoev

Copy link
Copy Markdown
Contributor

Removed the instantiated School object at the beginning and replaced it with a setUp() method that initializes it for every test.

@jtigger jtigger left a comment

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.

Well played, @superklamer.

// Such as UnsupportedOperationException when an unmodifiableMap is used
}

assertThat(school.studentsByGradeAlphabetical().get(grade),

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.

Hey, thanks for the lagniappe! :)


private School school;

@Before

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.

Perfect!

@jtigger

jtigger commented Mar 10, 2017

Copy link
Copy Markdown
Contributor

So, this PR includes the commit from your prior PR.

The way to avoid this is to make sure that each branch you create that fuels a PR should be based on this repo's current HEAD of "master". That's the very terse version, please feel free to ask questions if I didn't explain that clearly.

Could you rebase your GradeSchoolTests branch on upstream/master (where upstream is your reference to this repo)?

@rado-radoev

Copy link
Copy Markdown
Contributor Author

I got what you said, but I didn't know how to rebase my branch and I googled it.
I messed it up so much that I just deleted my branch and started over. :)
I created a new branch with the same name. If I commit it now, would it appear as an update here, or it will be considered a new commit?

@jtigger

jtigger commented Mar 20, 2017

Copy link
Copy Markdown
Contributor

Sorry for the radio silence (insert personal life events here)!

Okay, here's what I see on your repo:

$ git log --graph --oneline --all --decorate=short
...
* | 6dd6ed6 isogram : add to track (#311)
|/
*   d3a9ce0 (superklamer/master, superklamer/HEAD, master) Merge pull request #381 from superklamer/FlattenerTest
|\
| | * 298485b (HEAD -> GradeSchoolTests, superklamer/GradeSchoolTests) #371 grade-school: remote test pollution
| |/
| * 4c56f86 flatten-array: add @Ignore to tests - @Ignore added to all test cases but the first one
|/
* 99f4a1d pangram: add starter implementation and make object-based (#344)

Right now, the GradeSchoolTests branch is "based" on 99f4a1d. Which means it also includes 4c56f86. We'd like 298485b all alone.

One way there is through a rebase.

$ git checkout GradeSchoolTests
$ git rebase d3a9ce0
First, rewinding head to replay your work on top of it...
Applying: #371 grade-school: remote test pollution
$ git log --graph --oneline --all --decorate=short
* fdc7b1f (HEAD -> GradeSchoolTests) #371 grade-school: remote test pollution
| *   6203367 (exercism/master) Merge pull request #387 from vasouv/wordy-extract-setup
| |\
... (a bunch of work that has happened and merged in the last 10 days.
|/|
| * 6dd6ed6 isogram : add to track (#311)
|/
*   d3a9ce0 (superklamer/master, superklamer/HEAD, master) Merge pull request #381 from superklamer/FlattenerTest
|\
| | * 298485b (superklamer/GradeSchoolTests) #371 grade-school: remote test pollution
| |/
| * 4c56f86 flatten-array: add @Ignore to tests - @Ignore added to all test cases but the first one
|/
* 99f4a1d pangram: add starter implementation and make object-based (#344)

On close examination, we see fdc7b1f is the contents of 298485b based off of your master (currently d3a9ce0). You can verify this with git show fdc7b1f.

Now, you've effectively discarded commits since your last push, so you'll need to force-push to update the branch. So long as you are the only person work on a branch and you're happy with the state of branch as you're pushing, this is fine. More on that topic here: https://developer.atlassian.com/blog/2015/04/force-with-lease/

In this case, you are the only contributor to this branch, so you can force push away!

$ git branch
* GradeSchoolTests
  master
$ git push -f

GitHub will detect the change across the PR (this is one of the reasons to do your work on a branch!) and it will update automagically!

Is this helpful?

@jtigger jtigger self-assigned this Mar 20, 2017
@rado-radoev
rado-radoev deleted the GradeSchoolTests branch March 20, 2017 16:02
@rado-radoev
rado-radoev restored the GradeSchoolTests branch March 20, 2017 16:07
@jtigger

jtigger commented Mar 20, 2017

Copy link
Copy Markdown
Contributor

@superklamer did you mean to close this PR? You can leave this one open while you do your work on the branch, that will work. But if you know that and want to start over, knock yourself out.

@jtigger

jtigger commented Mar 20, 2017

Copy link
Copy Markdown
Contributor

Ah! I see the other PR (i.e. #390).

@rado-radoev

Copy link
Copy Markdown
Contributor Author

Yes. I submitted a new PR. I messed this one up quite badly, so it was easier to start fresh.

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.

2 participants