AMBARI-21735 - Parameterize Maven Surefire Build argLine (jonathanhurley)

Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b428fb9b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b428fb9b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b428fb9b

Branch: refs/heads/feature-branch-AMBARI-21307
Commit: b428fb9be84af73e5931d6d81908c3372b711420
Parents: f2cc609
Author: Jonathan Hurley <jhur...@hortonworks.com>
Authored: Wed Aug 16 20:12:49 2017 -0400
Committer: Jonathan Hurley <jhur...@hortonworks.com>
Committed: Thu Aug 17 11:40:20 2017 -0400

----------------------------------------------------------------------
 ambari-project/pom.xml                          |  1 +
 ambari-server/pom.xml                           |  2 +-
 .../main/resources/Ambari-DDL-Derby-CREATE.sql  |  5 +++--
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  4 ++--
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  2 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |  2 +-
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |  2 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |  9 ++++----
 .../apache/ambari/server/orm/db/DDLTests.java   | 22 +++++++++-----------
 .../server/testing/DBInconsistencyTests.java    |  2 ++
 pom.xml                                         |  2 +-
 11 files changed, 27 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-project/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 524a8f7..00ba1bc 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -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>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 3c966f2..29a820a 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -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>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
index 89bc4a4..5fcb03e 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
@@ -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,
@@ -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));
@@ -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)
 );
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 22dad9b..7c0e8d3 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -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)
 );
 
 
@@ -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),

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index ea9de0f..f46e184 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -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)
 );
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 4f37438..a6f5cb7 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -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)
 );
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
index aa5242c..ef36507 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -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)
 );
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index 5008471..01ab8ee 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -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,
@@ -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)
 );
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/test/java/org/apache/ambari/server/orm/db/DDLTests.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/orm/db/DDLTests.java 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/db/DDLTests.java
index 8c20f4c..96cf64e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/db/DDLTests.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/db/DDLTests.java
@@ -23,6 +23,7 @@ import java.util.List;
 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;
@@ -55,11 +56,6 @@ public class DDLTests {
   }
 
   @Test
-  public void testVerifyPostgresEmbedded() throws Exception {
-    verifyDDL("Postgres-EMBEDDED");
-  }
-
-  @Test
   public void testVerifyMySQL() throws Exception {
     verifyDDL("MySQL");
   }
@@ -124,11 +120,6 @@ public class DDLTests {
   }
 
   @Test
-  public void testComparePostgresEmbedded() throws Exception {
-    compareAgainstPostgres("Postgres-EMBEDDED");
-  }
-
-  @Test
   public void testCompareDerby() throws Exception {
     compareAgainstPostgres("Derby");
   }
@@ -164,7 +155,12 @@ public class DDLTests {
     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());
     }
   }
 
@@ -176,7 +172,9 @@ public class DDLTests {
     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();
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/ambari-server/src/test/java/org/apache/ambari/server/testing/DBInconsistencyTests.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/testing/DBInconsistencyTests.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/testing/DBInconsistencyTests.java
index d70adad..fafeaff 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/testing/DBInconsistencyTests.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/testing/DBInconsistencyTests.java
@@ -98,6 +98,8 @@ public class DBInconsistencyTests {
 
     helper.addHost(clusters, cluster, "h1");
 
+    helper.initializeClusterWithStack(cluster);
+
     helper.installHdfsService(cluster, serviceFactory,
       serviceComponentFactory, serviceComponentHostFactory, "h1");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b428fb9b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a5aca94..37bb137 100644
--- a/pom.xml
+++ b/pom.xml
@@ -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>

Reply via email to