Fix branch deletion after failed reconfig
Normally when a branch is deleted, we delete the cached data for
that branch and perform a partial ("tenant") reconfiguration. However,
there are two caches of configuration for each project -- the full
cache, and the per-branch cache. We were not deleting the per-branch
cache, so if the tenant reconfiguration failed, the per-branch cache
would still contain the deleted branch.
Also, on full reconfiguration, we update the per-branch cache, however,
we never deleted branches from the cache in that case, so even a full
reconfiguration would be unable to clear that cache. This is fixed
as well.
Change-Id: Ia9c17238ef0e42609e3de304af9c0c4588c72995
diff --git a/tests/base.py b/tests/base.py
index 0f2df35..45afdcc 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -529,6 +529,24 @@
}
return event
+ def getFakeBranchDeletedEvent(self, project, branch):
+ oldrev = '4abd38457c2da2a72d4d030219ab180ecdb04bf0'
+ newrev = 40 * '0'
+
+ event = {
+ "type": "ref-updated",
+ "submitter": {
+ "name": "User Name",
+ },
+ "refUpdate": {
+ "oldRev": oldrev,
+ "newRev": newrev,
+ "refName": 'refs/heads/' + branch,
+ "project": project,
+ }
+ }
+ return event
+
def review(self, project, changeid, message, action):
number, ps = changeid.split(',')
change = self.changes[int(number)]