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

A few fixes + increased robustness of tests #127

Merged
merged 5 commits into from
Oct 1, 2018
Merged

A few fixes + increased robustness of tests #127

merged 5 commits into from
Oct 1, 2018

Conversation

JaimeLennox
Copy link
Contributor

@JaimeLennox JaimeLennox commented Sep 1, 2018

Fix a few issues, and increases the robustness of the tests by providing specs for mocks. Details are available in individual commit messages.

By default the tests run on a mock merge request with the same source
and target project. This leaves us without much coverage for cases where
we want to merge as a fork.

This change also restructures the tests to make better use of fixtures,
as this make's writing the code to test both types of merge request
easier.

Finally, we make sure that all mocks used have `autospec` set so that
we don't accidentally miss bugs where wrong methods are called, or wrong
arguments are passed.
This is now caught by the tests.

Fixes: #122
Handle the case where GitLab skips CI (due to a `[ci skip]` present in
the commit message.

Also add some tests for CI being canceled/failed.

Fixes: #95
When rewriting commits, we need to push the updates to the original
branch. If the branch is protected, then Marge will be unable to do so,
and should return an appropriate error message.

Fixes: #128
Fixes an issue uncovered by #124 where Marge throws an assertion error
if the source/target branches are from the same project and the source
branch is master. We assume that merges will always be into master,
which is obviously not always the case; you may have a workflow
requiring you to merge from master into another branch (e.g. a
staging/production branch).
@aschmolck aschmolck merged commit 73487b6 into master Oct 1, 2018
@JaimeLennox JaimeLennox deleted the fixes branch October 13, 2018 07:51
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