-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After pushing, wait for MRs to stabilize
By stabililze we mean that the "changes_count" field of the MR has a value of "1". This ensures that by the time the "git lab" command terminates, MRs should be fully up-to-date. Note that this approach will have to be reevaluated if #16 is implemented (which would allow multiple commits to end up in a single MR). Also: unit_tests/merge_request_test.py: MergeRequestTest: Removed WAIT_TIME_BEFORE_VALIDATE, etc since create_merge_requests() now waits for the desired state before returning. Change-Id: Id20d9feb27076afe0603bee334badc815e5528a9
- Loading branch information
Showing
3 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,11 +20,6 @@ | |
EMAIL = "[email protected]" | ||
|
||
class MergeRequestTest(unittest.TestCase): | ||
# GitLab seems to need a little bit of time before the commits of the | ||
# MRs get updated, after new commits are pushed to the branches. This is | ||
# the time (in seconds) we'll wait before we validate the MRs. | ||
WAIT_TIME_BEFORE_VALIDATE = 10 | ||
|
||
def setUp(self): | ||
self._test_project_dir = os.path.join( | ||
repo_path, GITLAB_TEST_PROJECT_PATH) | ||
|
@@ -40,7 +35,6 @@ def setUp(self): | |
self._local_branch = LOCAL_BRANCH | ||
self._test_repo.git.checkout(self._local_branch) | ||
global_vars.ci_mode = True | ||
self._wait_before_validate = True | ||
self._mrs = [] | ||
|
||
def tearDown(self): | ||
|
@@ -116,12 +110,6 @@ def validate_mr(mr, commit, target_branch): | |
self._mrs.append( | ||
merge_request.get_merge_request(self._remote, source_branch)) | ||
|
||
# Wait some time before the validation, in order for GitLab to update | ||
# the MRs after seeing new commits. | ||
if self._wait_before_validate: | ||
time.sleep(MergeRequestTest.WAIT_TIME_BEFORE_VALIDATE) | ||
self._wait_before_validate = False | ||
|
||
for idx, (mr, commit) in enumerate(zip(self._mrs, commits)): | ||
validate_mr( | ||
mr, commit, global_vars.global_target_branch if idx == 0 else | ||
|