Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  Update git submodules
  Accept more than one endpoint from the same plugin
  mvn.py: Explicitly specify version in mvn deploy command
  Add missing 'Allow content merges' section title in project config documentation
  Allow to disable log file compression
  Allow to disable log file rotation
  SystemLog: Don't keep Config as a member
  AccountIT#deletePreferredEmail: Fix flakiness
  gerrit.sh: Fix PID definition
  Use Provider<PersonIdent> in CreateProject @Singleton
  AccountIT: Add test for deleting preferred email
  AccountIT: Add test coverage of adding an email and setting preferred

Change-Id: I56efcb5dcc09472b2c18e26be1feae62b9811eb9
This commit is contained in:
David Pursehouse
2019-06-05 12:03:04 +09:00
5 changed files with 62 additions and 5 deletions

View File

@@ -1038,6 +1038,23 @@ public class AccountIT extends AbstractDaemonTest {
gApi.accounts().id(user.id().get()).addEmail(newEmailInput(email, false));
}
@Test
public void addEmailAndSetPreferred() throws Exception {
String email = "foo.bar@example.com";
EmailInput input = new EmailInput();
input.email = email;
input.noConfirmation = true;
input.preferred = true;
gApi.accounts().self().addEmail(input);
// Account is reindexed twice; once on adding the new email,
// and then again on setting the email preferred.
accountIndexedCounter.assertReindexOf(admin, 2);
String preferred = gApi.accounts().self().get().email;
assertThat(preferred).isEqualTo(email);
}
@Test
public void deleteEmail() throws Exception {
String email = "foo.bar@example.com";
@@ -1055,6 +1072,29 @@ public class AccountIT extends AbstractDaemonTest {
assertThat(getEmails()).doesNotContain(email);
}
@Test
public void deletePreferredEmail() throws Exception {
String email = "foo.bar.baz@example.com";
EmailInput input = new EmailInput();
input.email = email;
input.noConfirmation = true;
input.preferred = true;
gApi.accounts().self().addEmail(input);
// Account is reindexed twice; once on adding the new email,
// and then again on setting the email preferred.
accountIndexedCounter.assertReindexOf(admin, 2);
assertThat(gApi.accounts().self().get().email).isEqualTo(email);
accountIndexedCounter.clear();
gApi.accounts().self().deleteEmail(input.email);
accountIndexedCounter.assertReindexOf(admin);
requestScopeOperations.resetCurrentApiUser();
assertThat(getEmails()).doesNotContain(email);
}
@Test
public void deleteEmailFromCustomExternalIdSchemes() throws Exception {
String email = "foo.bar@example.com";

View File

@@ -115,7 +115,8 @@
},
_initModule({moduleName, plugin, type, domHook}) {
if (this._initializedPlugins.get(plugin.getPluginName())) {
const name = plugin.getPluginName() + '.' + moduleName;
if (this._initializedPlugins.get(name)) {
return;
}
let initPromise;
@@ -128,10 +129,9 @@
break;
}
if (!initPromise) {
console.warn('Unable to initialize module' +
`${moduleName} from ${plugin.getPluginName()}`);
console.warn('Unable to initialize module ' + name);
}
this._initializedPlugins.set(plugin.getPluginName(), true);
this._initializedPlugins.set(name, true);
initPromise.then(el => {
domHook.handleInstanceAttached(el);
this._domHooks.set(el, domHook);

View File

@@ -127,6 +127,22 @@ limitations under the License.
});
});
test('two modules', done => {
plugin.registerCustomComponent('banana', 'mod-one');
plugin.registerCustomComponent('banana', 'mod-two');
flush(() => {
const element =
container.querySelector('gr-endpoint-decorator[name="banana"]');
const module1 = Polymer.dom(element.root).children.find(
element => element.nodeName === 'MOD-ONE');
assert.isOk(module1);
const module2 = Polymer.dom(element.root).children.find(
element => element.nodeName === 'MOD-TWO');
assert.isOk(module2);
done();
});
});
test('late param setup', done => {
const element =
container.querySelector('gr-endpoint-decorator[name="banana"]');

View File

@@ -434,8 +434,8 @@ case "$ACTION" in
fi
fi
PID=`cat "$GERRIT_PID"`
if test $UID = 0; then
PID=`cat "$GERRIT_PID"`
if test -f "/proc/${PID}/oom_score_adj" ; then
echo -1000 > "/proc/${PID}/oom_score_adj"
else

View File

@@ -46,6 +46,7 @@ elif 'deploy' == args.a:
cmd = [
'mvn',
'gpg:sign-and-deploy-file',
'-Dversion=%s' % args.v,
'-DrepositoryId=%s' % args.repository,
'-Durl=%s' % args.url,
]