superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] 01/01: Fix tests
Date Wed, 26 Jul 2017 21:59:01 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch hive_support
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 6ea1804b5792101967f173ae819b599c18f58094
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Wed Jul 26 21:33:34 2017 +0000

    Fix tests
---
 .../javascripts/SqlLab/components/ResultSet.jsx    |  5 ++-
 tests/db_engine_specs_test.py                      | 40 ++++++++++++----------
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/superset/assets/javascripts/SqlLab/components/ResultSet.jsx b/superset/assets/javascripts/SqlLab/components/ResultSet.jsx
index c04c3c9..f306050 100644
--- a/superset/assets/javascripts/SqlLab/components/ResultSet.jsx
+++ b/superset/assets/javascripts/SqlLab/components/ResultSet.jsx
@@ -166,7 +166,10 @@ export default class ResultSet extends React.PureComponent {
       }
       if (query.trackingUrl) {
         trackingUrl = (
-          <Button bsSize="small" onClick={() => {window.open(query.trackingUrl)}}>
+          <Button
+            bsSize="small"
+            onClick={() => { window.open(query.trackingUrl); }}
+          >
               Track Job
           </Button>
         );
diff --git a/tests/db_engine_specs_test.py b/tests/db_engine_specs_test.py
index 626a97b..a303813 100644
--- a/tests/db_engine_specs_test.py
+++ b/tests/db_engine_specs_test.py
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
 
 import unittest
 
-from superset import db_engine_specs
+from superset.db_engine_specs import HiveEngineSpec
 
 
 class DbEngineSpecsTestCase(unittest.TestCase):
@@ -13,36 +13,38 @@ class DbEngineSpecsTestCase(unittest.TestCase):
         log  = """
             17/02/07 18:26:27 INFO log.PerfLogger: <PERFLOG method=compile from=org.apache.hadoop.hive.ql.Driver>
             17/02/07 18:26:27 INFO log.PerfLogger: <PERFLOG method=parse from=org.apache.hadoop.hive.ql.Driver>
-        """
-        self.assertEquals(0, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(
+            0, HiveEngineSpec.progress(log))
 
     def test_0_progress(self):
         log = """
             17/02/07 18:26:27 INFO log.PerfLogger: <PERFLOG method=compile from=org.apache.hadoop.hive.ql.Driver>
             17/02/07 18:26:27 INFO log.PerfLogger: <PERFLOG method=parse from=org.apache.hadoop.hive.ql.Driver>
-        """
-        self.assertEquals(0, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(
+            0, HiveEngineSpec.progress(log))
 
     def test_number_of_jobs_progress(self):
         log = """
             17/02/07 19:15:55 INFO ql.Driver: Total jobs = 2
-        """
-        self.assertEquals(0, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(0, HiveEngineSpec.progress(log))
 
     def test_job_1_launched_progress(self):
         log = """
             17/02/07 19:15:55 INFO ql.Driver: Total jobs = 2
             17/02/07 19:15:55 INFO ql.Driver: Launching Job 1 out of 2
-        """
-        self.assertEquals(0, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(0, HiveEngineSpec.progress(log))
 
     def test_job_1_launched_stage_1_0_progress(self):
         log = """
             17/02/07 19:15:55 INFO ql.Driver: Total jobs = 2
             17/02/07 19:15:55 INFO ql.Driver: Launching Job 1 out of 2
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 0%, 
reduce = 0%
-        """
-        self.assertEquals(0, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(0, HiveEngineSpec.progress(log))
 
     def test_job_1_launched_stage_1_map_40_progress(self):
         log = """
@@ -50,8 +52,8 @@ class DbEngineSpecsTestCase(unittest.TestCase):
             17/02/07 19:15:55 INFO ql.Driver: Launching Job 1 out of 2
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 0%, 
reduce = 0%
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 40%,
 reduce = 0%
-        """
-        self.assertEquals(10, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(10, HiveEngineSpec.progress(log))
 
     def test_job_1_launched_stage_1_map_80_reduce_40_progress(self):
         log = """
@@ -60,8 +62,8 @@ class DbEngineSpecsTestCase(unittest.TestCase):
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 0%, 
reduce = 0%
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 40%,
 reduce = 0%
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 80%,
 reduce = 40%
-        """
-        self.assertEquals(30, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(30, HiveEngineSpec.progress(log))
 
     def test_job_1_launched_stage_2_stages_progress(self):
         log = """
@@ -72,8 +74,8 @@ class DbEngineSpecsTestCase(unittest.TestCase):
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 80%,
 reduce = 40%
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-2 map = 0%, 
reduce = 0%
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 100%,
 reduce = 0%
-        """
-        self.assertEquals(12, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(12, HiveEngineSpec.progress(log))
 
     def test_job_2_launched_stage_2_stages_progress(self):
         log = """
@@ -83,5 +85,5 @@ class DbEngineSpecsTestCase(unittest.TestCase):
             17/02/07 19:15:55 INFO ql.Driver: Launching Job 2 out of 2
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 0%, 
reduce = 0%
             17/02/07 19:16:09 INFO exec.Task: 2017-02-07 19:16:09,173 Stage-1 map = 40%,
 reduce = 0%
-        """
-        self.assertEquals(60, db_engine_specs.HiveEngineSpec.progress(log))
+        """.split('\n')
+        self.assertEquals(60, HiveEngineSpec.progress(log))

-- 
To stop receiving notification emails like this one, please contact
"commits@superset.apache.org" <commits@superset.apache.org>.

Mime
View raw message