Skip to content

Commit

Permalink
AMBARI-21735 - Parameterize Maven Surefire Build argLine (jonathanhur…
Browse files Browse the repository at this point in the history
…ley)
  • Loading branch information
Jonathan Hurley committed Aug 17, 2017
1 parent f2cc609 commit b428fb9
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 26 deletions.
1 change: 1 addition & 0 deletions ambari-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<slf4j.version>1.7.20</slf4j.version>
<forkCount>4</forkCount>
<reuseForks>false</reuseForks>
<surefire.argLine>-Xmx1024m -Xms512m</surefire.argLine>
</properties>
<profiles>
<profile>
Expand Down
2 changes: 1 addition & 1 deletion ambari-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>${skipSurefireTests}</skip>
<argLine>-Xmx1024m -Xms512m</argLine>
<argLine>${surefire.argLine}</argLine>

<!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
<groups>${testcase.groups}</groups>
Expand Down
5 changes: 3 additions & 2 deletions ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ CREATE TABLE host_version (
CONSTRAINT PK_host_version PRIMARY KEY (id),
CONSTRAINT FK_host_version_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id),
CONSTRAINT FK_host_version_repovers_id FOREIGN KEY (repo_version_id) REFERENCES repo_version (repo_version_id),
CONSTRAINT UQ_host_repo UNIQUE(host_id, repo_version_id, state));
CONSTRAINT UQ_host_repo UNIQUE(host_id, repo_version_id));

CREATE TABLE servicedesiredstate (
cluster_id BIGINT NOT NULL,
Expand Down Expand Up @@ -272,6 +272,7 @@ CREATE TABLE groups (
principal_id BIGINT NOT NULL,
group_name VARCHAR(255) NOT NULL,
ldap_group INTEGER NOT NULL DEFAULT 0,
group_type VARCHAR(255) NOT NULL DEFAULT 'LOCAL',
CONSTRAINT PK_groups PRIMARY KEY (group_id),
UNIQUE (ldap_group, group_name),
CONSTRAINT FK_groups_principal_id FOREIGN KEY (principal_id) REFERENCES adminprincipal(principal_id));
Expand Down Expand Up @@ -553,7 +554,7 @@ CREATE table viewurl(
url_id BIGINT ,
url_name VARCHAR(255) NOT NULL ,
url_suffix VARCHAR(255) NOT NULL,
PRIMARY KEY(url_id)
CONSTRAINT PK_viewurl PRIMARY KEY(url_id)
);


Expand Down
4 changes: 2 additions & 2 deletions ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ CREATE table viewurl(
url_id BIGINT ,
url_name VARCHAR(255) NOT NULL ,
url_suffix VARCHAR(255) NOT NULL,
PRIMARY KEY(url_id)
CONSTRAINT PK_viewurl PRIMARY KEY(url_id)
);


Expand Down Expand Up @@ -1101,7 +1101,7 @@ INSERT INTO ambari_sequences(sequence_name, sequence_value) VALUES
('setting_id_seq', 0),
('hostcomponentstate_id_seq', 0),
('servicecomponentdesiredstate_id_seq', 0),
('servicecomponent_history_id_seq', 0),
('upgrade_history_id_seq', 0),
('blueprint_setting_id_seq', 0),
('ambari_operation_history_id_seq', 0),
('remote_cluster_id_seq', 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ CREATE table viewurl(
url_id NUMBER ,
url_name VARCHAR(255) NOT NULL ,
url_suffix VARCHAR(255) NOT NULL,
PRIMARY KEY(url_id)
CONSTRAINT PK_viewurl PRIMARY KEY(url_id)
);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ CREATE table viewurl(
url_id BIGINT ,
url_name VARCHAR(255) NOT NULL ,
url_suffix VARCHAR(255) NOT NULL,
PRIMARY KEY(url_id)
CONSTRAINT PK_viewurl PRIMARY KEY(url_id)
);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ CREATE table viewurl(
url_id NUMERIC ,
url_name VARCHAR(255) NOT NULL ,
url_suffix VARCHAR(255) NOT NULL,
PRIMARY KEY(url_id)
CONSTRAINT PK_viewurl PRIMARY KEY(url_id)
);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,9 @@ CREATE TABLE hostcomponentdesiredstate (
maintenance_state VARCHAR(32) NOT NULL,
restart_required BIT NOT NULL DEFAULT 0,
CONSTRAINT PK_hostcomponentdesiredstate PRIMARY KEY CLUSTERED (id),
CONSTRAINT UQ_hcdesiredstate_name UNIQUE NONCLUSTERED (component_name, service_name, host_id, cluster_id),
CONSTRAINT hstcmpnntdesiredstatecmpnntnme FOREIGN KEY (component_name, service_name, cluster_id) REFERENCES servicecomponentdesiredstate (component_name, service_name, cluster_id),
CONSTRAINT hstcmponentdesiredstatehstid FOREIGN KEY (host_id) REFERENCES hosts (host_id));

CONSTRAINT UQ_hcdesiredstate_name UNIQUE (component_name, service_name, host_id, cluster_id),
CONSTRAINT FK_hcdesiredstate_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id),
CONSTRAINT hstcmpnntdesiredstatecmpnntnme FOREIGN KEY (component_name, service_name, cluster_id) REFERENCES servicecomponentdesiredstate (component_name, service_name, cluster_id));

CREATE TABLE hostcomponentstate (
id BIGINT NOT NULL,
Expand Down Expand Up @@ -559,7 +558,7 @@ CREATE table viewurl(
url_id BIGINT ,
url_name VARCHAR(255) NOT NULL ,
url_suffix VARCHAR(255) NOT NULL,
PRIMARY KEY CLUSTERED (url_id)
CONSTRAINT PK_viewurl PRIMARY KEY CLUSTERED (url_id)
);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
Expand Down Expand Up @@ -54,11 +55,6 @@ public void testVerifyPostgres() throws Exception {
verifyDDL("Postgres");
}

@Test
public void testVerifyPostgresEmbedded() throws Exception {
verifyDDL("Postgres-EMBEDDED");
}

@Test
public void testVerifyMySQL() throws Exception {
verifyDDL("MySQL");
Expand Down Expand Up @@ -123,11 +119,6 @@ private void verifyDDL(String dbType) throws Exception {

}

@Test
public void testComparePostgresEmbedded() throws Exception {
compareAgainstPostgres("Postgres-EMBEDDED");
}

@Test
public void testCompareDerby() throws Exception {
compareAgainstPostgres("Derby");
Expand Down Expand Up @@ -164,7 +155,12 @@ static void compareAgainstPostgres(String dbType) throws Exception {
else {
LOG.info("{} differences found:", diffs.size());
for (String diff: diffs) { LOG.info(diff); }
Assert.fail("Found " + diffs.size() + " differences when comparing " + other + " against Postgres.");
StringBuilder buffer = new StringBuilder();
buffer.append("Found ").append(diffs.size()).append(" differences when comparing ").append(
other).append(" against Postgres:").append(System.lineSeparator()).append(
StringUtils.join(diffs, System.lineSeparator()));

Assert.fail(buffer.toString());
}
}

Expand All @@ -176,7 +172,9 @@ static void printDDLMetrics(DDL ddl) {
int uqCount = 0;
for (Table t: ddl.tables.values()) {
colCount += t.columns.size();
if (t.primaryKey.isPresent()) pkCount ++;
if (t.primaryKey.isPresent()) {
pkCount ++;
}
fkCount += t.foreignKeys.size();
uqCount += t.uniqueConstraints.size();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public void testOrphanedSCHDesiredEntityReAdd() throws Exception {

helper.addHost(clusters, cluster, "h1");

helper.initializeClusterWithStack(cluster);

helper.installHdfsService(cluster, serviceFactory,
serviceComponentFactory, serviceComponentHostFactory, "h1");

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<version>2.20</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down

0 comments on commit b428fb9

Please sign in to comment.