Merge branch 'stable-2.15' into stable-2.16
* stable-2.15: Init: Increase severity log level to error on exceptions Bazel: Fix genrule2 to clean up temporary folder content AbstractIndexTests: Inline constant assertChangeQuery string parameter AbstractIndexTests: Align assertChangeQuery method access with its use Change-Id: Ifcd40ccd0acdf923d57281e9e01e3e5be8583345
This commit is contained in:
@@ -146,7 +146,7 @@ public class BaseInit extends SiteProgram {
|
||||
} catch (OrmException e) {
|
||||
String msg = "Couldn't upgrade schema. Expected if slave and read-only database";
|
||||
System.err.println(msg);
|
||||
logger.atWarning().withCause(e).log(msg);
|
||||
logger.atSevere().withCause(e).log(msg);
|
||||
}
|
||||
|
||||
init.initializer.postRun(sysInjector);
|
||||
|
@@ -73,7 +73,7 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
|
||||
disableChangeIndexWrites();
|
||||
amendChange(changeId, "second test", "test2.txt", "test2");
|
||||
|
||||
assertChangeQuery("message:second", change.getChange(), false);
|
||||
assertChangeQuery(change.getChange(), false);
|
||||
enableChangeIndexWrites();
|
||||
|
||||
changeIndexedCounter.clear();
|
||||
@@ -83,7 +83,7 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
|
||||
|
||||
changeIndexedCounter.assertReindexOf(changeInfo, 1);
|
||||
|
||||
assertChangeQuery("message:second", change.getChange(), true);
|
||||
assertChangeQuery(change.getChange(), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -98,7 +98,7 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
|
||||
disableChangeIndexWrites();
|
||||
amendChange(changeId, "second test", "test2.txt", "test2");
|
||||
|
||||
assertChangeQuery("message:second", change.getChange(), false);
|
||||
assertChangeQuery(change.getChange(), false);
|
||||
enableChangeIndexWrites();
|
||||
|
||||
changeIndexedCounter.clear();
|
||||
@@ -115,12 +115,11 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
|
||||
|
||||
changeIndexedCounter.assertReindexOf(changeInfo, 1);
|
||||
|
||||
assertChangeQuery("message:second", change.getChange(), true);
|
||||
assertChangeQuery(change.getChange(), true);
|
||||
}
|
||||
|
||||
protected void assertChangeQuery(String q, ChangeData change, boolean assertTrue)
|
||||
throws Exception {
|
||||
List<Integer> ids = query(q).stream().map(c -> c._number).collect(toList());
|
||||
private void assertChangeQuery(ChangeData change, boolean assertTrue) throws Exception {
|
||||
List<Integer> ids = query("message:second").stream().map(c -> c._number).collect(toList());
|
||||
if (assertTrue) {
|
||||
assertThat(ids).contains(change.getId().get());
|
||||
} else {
|
||||
|
@@ -21,6 +21,7 @@ def genrule2(cmd, **kwargs):
|
||||
"ROOT=$$PWD",
|
||||
"TMP=$$(mktemp -d || mktemp -d -t bazel-tmp)",
|
||||
"(" + cmd + ")",
|
||||
"rm -rf $$TMP",
|
||||
])
|
||||
native.genrule(
|
||||
cmd = cmd,
|
||||
|
Reference in New Issue
Block a user