ProjectIT: Add tests for ref-updated events on project creation
When a new project is created its refs/meta/config branch is created with the project's initial config. This should result in a ref-updated event being emitted. These tests don't create the project with an initial empty commit, so there should therefore be no corresponding ref-updated event for the refs/heads/master branch. Change-Id: I5fadc4b8221637807aaa3275783cbb1228c6bbc9
This commit is contained in:
		| @@ -867,6 +867,11 @@ public abstract class AbstractDaemonTest { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   protected RevCommit getRemoteHead(String project, String branch) | ||||||
|  |       throws Exception { | ||||||
|  |     return getRemoteHead(new Project.NameKey(project), branch); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   protected RevCommit getRemoteHead() throws Exception { |   protected RevCommit getRemoteHead() throws Exception { | ||||||
|     return getRemoteHead(project, "master"); |     return getRemoteHead(project, "master"); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -43,6 +43,13 @@ public class ProjectIT extends AbstractDaemonTest  { | |||||||
|             .create(name) |             .create(name) | ||||||
|             .get() |             .get() | ||||||
|             .name); |             .name); | ||||||
|  |  | ||||||
|  |     RevCommit head = getRemoteHead(name, "refs/meta/config"); | ||||||
|  |     eventRecorder.assertRefUpdatedEvents(name, "refs/meta/config", | ||||||
|  |         null, head); | ||||||
|  |  | ||||||
|  |     eventRecorder.assertRefUpdatedEvents(name, "refs/heads/master", | ||||||
|  |         new String[]{}); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Test |   @Test | ||||||
| @@ -53,6 +60,13 @@ public class ProjectIT extends AbstractDaemonTest  { | |||||||
|             .create(name + ".git") |             .create(name + ".git") | ||||||
|             .get() |             .get() | ||||||
|             .name); |             .name); | ||||||
|  |  | ||||||
|  |     RevCommit head = getRemoteHead(name, "refs/meta/config"); | ||||||
|  |     eventRecorder.assertRefUpdatedEvents(name, "refs/meta/config", | ||||||
|  |         null, head); | ||||||
|  |  | ||||||
|  |     eventRecorder.assertRefUpdatedEvents(name, "refs/heads/master", | ||||||
|  |         new String[]{}); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @Test |   @Test | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 David Pursehouse
					David Pursehouse