ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-21004. Supprt boot2docker & docker-machine in Log Search integration test module (oleewere)
Date Sat, 13 May 2017 12:14:38 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d83f733b0 -> 7ccb6dcaf


AMBARI-21004. Supprt boot2docker & docker-machine in Log Search integration test module
(oleewere)


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

Branch: refs/heads/trunk
Commit: 7ccb6dcafe3c24bd80be84cf9aa0f30353c889f4
Parents: d83f733
Author: oleewere <oleewere@gmail.com>
Authored: Fri May 12 15:52:30 2017 +0200
Committer: oleewere <oleewere@gmail.com>
Committed: Sat May 13 14:09:25 2017 +0200

----------------------------------------------------------------------
 ambari-logsearch/README.md                      |  2 +-
 ambari-logsearch/ambari-logsearch-it/pom.xml    |  4 ++++
 .../logsearch/steps/AbstractLogSearchSteps.java |  3 +--
 .../logsearch/story/LogSearchUIStories.java     |  5 ++---
 .../backend/log_search_api_query_story.story    | 17 -----------------
 .../stories/backend/log_search_api_tests.story  | 17 +++++++++++++++++
 .../backend/logfeeder_parsing_story.story       | 20 --------------------
 .../backend/logfeeder_parsing_tests.story       | 20 ++++++++++++++++++++
 8 files changed, 45 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/README.md b/ambari-logsearch/README.md
index 4123a52..92b98f9 100644
--- a/ambari-logsearch/README.md
+++ b/ambari-logsearch/README.md
@@ -36,7 +36,7 @@ mvn -Dbuild-deb clean package
 
 ## Running Integration Tests
 
-By default integration tests are not a part of the build process, you need to set -Dbackend-tests
or -Dselenium-tests (or you can use -Dall-tests to run both). To running the tests you will
need docker here as well (right now docker-for-mac and unix are supported only).
+By default integration tests are not a part of the build process, you need to set -Dbackend-tests
or -Dselenium-tests (or you can use -Dall-tests to run both). To running the tests you will
need docker here as well (right now docker-for-mac and unix are supported by default, for
boot2docker you need to pass -Ddocker.host parameter to the build).
 
 ```bash
 # from ambari-logsearch folder

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/ambari-logsearch-it/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/pom.xml b/ambari-logsearch/ambari-logsearch-it/pom.xml
index cdb76a5..0058c80 100644
--- a/ambari-logsearch/ambari-logsearch-it/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-it/pom.xml
@@ -38,6 +38,7 @@
     <jackson-jaxrs.version>2.6.4</jackson-jaxrs.version>
     <failsafe-plugin.version>2.20</failsafe-plugin.version>
     <forkCount>1</forkCount>
+    <docker.host>localhost</docker.host>
   </properties>
 
   <dependencies>
@@ -160,6 +161,7 @@
                   </includes>
                   <systemPropertyVariables>
                     <log4j.configuration>file:${project.build.testOutputDirectory}/log4j.properties</log4j.configuration>
+                    <docker.host>${docker.host}</docker.host>
                   </systemPropertyVariables>
                 </configuration>
               </execution>
@@ -201,6 +203,7 @@
                   </includes>
                   <systemPropertyVariables>
                     <log4j.configuration>file:${project.build.testOutputDirectory}/log4j.properties</log4j.configuration>
+                    <docker.host>${docker.host}</docker.host>
                   </systemPropertyVariables>
                 </configuration>
               </execution>
@@ -242,6 +245,7 @@
                   </includes>
                   <systemPropertyVariables>
                     <log4j.configuration>file:${project.build.testOutputDirectory}/log4j.properties</log4j.configuration>
+                    <docker.host>${docker.host}</docker.host>
                   </systemPropertyVariables>
                 </configuration>
               </execution>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
index a7dd409..a0027ae 100644
--- a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
+++ b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
@@ -55,8 +55,7 @@ public class AbstractLogSearchSteps {
       LOG.info("Command output: {}", output);
       StoryDataRegistry.INSTANCE.setLogsearchContainerStarted(true);
 
-      // TODO: create a script which returns the proper host for docker, use: runCommand
or an env variable
-      String dockerHostFromUri = "localhost";
+      String dockerHostFromUri = System.getProperty("docker.host") != null ? System.getProperty("docker.host")
: "localhost";;
 
       StoryDataRegistry.INSTANCE.setDockerHost(dockerHostFromUri);
       checkHostAndPortReachable(dockerHostFromUri, StoryDataRegistry.INSTANCE.getLogsearchPort(),
"LogSearch");

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/story/LogSearchUIStories.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/story/LogSearchUIStories.java
b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/story/LogSearchUIStories.java
index eb2a180..217c50f 100644
--- a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/story/LogSearchUIStories.java
+++ b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/story/LogSearchUIStories.java
@@ -53,9 +53,8 @@ public class LogSearchUIStories extends JUnitStories {
   private SeleniumContext context;
 
   public LogSearchUIStories() {
-    // TODO: get docker host from a runCommand funtion
-    String hubUrl = "http://localhost:4444/wd/hub";
-    System.setProperty("REMOTE_WEBDRIVER_URL", hubUrl);
+    String dockerHost = System.getProperty("docker.host") != null ? System.getProperty("docker.host")
: "localhost";
+    System.setProperty("REMOTE_WEBDRIVER_URL", String.format("http://%s:4444/wd/hub", dockerHost));
     DesiredCapabilities capability = DesiredCapabilities.firefox();
     capability.setPlatform(Platform.LINUX);
     capability.setVersion("45.8.0");

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_query_story.story
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_query_story.story
b/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_query_story.story
deleted file mode 100644
index 0af00f5..0000000
--- a/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_query_story.story
+++ /dev/null
@@ -1,17 +0,0 @@
-Meta:
-
-Narrative:
-As a user
-I want to perform queries against Log Search api
-So that I can validate the json outputs
-
-Scenario: Log Search API JSON responses
-
-Given logsearch docker container
-When LogSearch api query sent: <apiQuery>
-Then The api query result is <jsonResult>
-
-Examples:
-|apiQuery|jsonResult|
-|/api/v1/service/logs/schema/fields|service-log-schema.json|
-|/api/v1/service/logs/levels/counts?page=0&pageSize=25&startIndex=0&q=*%3A*|service-log-level-counts-values.json|
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_tests.story
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_tests.story
b/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_tests.story
new file mode 100644
index 0000000..0af00f5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/log_search_api_tests.story
@@ -0,0 +1,17 @@
+Meta:
+
+Narrative:
+As a user
+I want to perform queries against Log Search api
+So that I can validate the json outputs
+
+Scenario: Log Search API JSON responses
+
+Given logsearch docker container
+When LogSearch api query sent: <apiQuery>
+Then The api query result is <jsonResult>
+
+Examples:
+|apiQuery|jsonResult|
+|/api/v1/service/logs/schema/fields|service-log-schema.json|
+|/api/v1/service/logs/levels/counts?page=0&pageSize=25&startIndex=0&q=*%3A*|service-log-level-counts-values.json|
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_story.story
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_story.story
b/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_story.story
deleted file mode 100644
index 388e624..0000000
--- a/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_story.story
+++ /dev/null
@@ -1,20 +0,0 @@
-Story Service logs are parsed and stored into Solr
-
-Narrative:
-As a user
-I want to start logsearch/logfeeder/solr components in a docker container with test logs
-So that I can parse and store the logs into Solr
-
-Scenario: Number of logs for components
-
-Given logsearch docker container
-When logfeeder started (parse logs & send data to solr)
-Then the number of <component> docs is: <docSize>
-
-Examples:
-|component|docSize|
-|logsearch_app|1|
-|zookeeper|3|
-|hst_agent|4|
-|secure_log|11|
-|system_message|17|

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ccb6dca/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_tests.story
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_tests.story
b/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_tests.story
new file mode 100644
index 0000000..388e624
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-it/src/test/resources/stories/backend/logfeeder_parsing_tests.story
@@ -0,0 +1,20 @@
+Story Service logs are parsed and stored into Solr
+
+Narrative:
+As a user
+I want to start logsearch/logfeeder/solr components in a docker container with test logs
+So that I can parse and store the logs into Solr
+
+Scenario: Number of logs for components
+
+Given logsearch docker container
+When logfeeder started (parse logs & send data to solr)
+Then the number of <component> docs is: <docSize>
+
+Examples:
+|component|docSize|
+|logsearch_app|1|
+|zookeeper|3|
+|hst_agent|4|
+|secure_log|11|
+|system_message|17|


Mime
View raw message