Title: [270295] trunk/Tools
Revision
270295
Author
[email protected]
Date
2020-12-01 06:43:15 -0800 (Tue, 01 Dec 2020)

Log Message

Share runUnittests.py for ews-build and build.webkit.org unit-tests
https://bugs.webkit.org/show_bug.cgi?id=219374

Reviewed by Jonathan Bedard.

* CISupport/runUnittests.py: Moved from Tools/CISupport/ews-build/runUnittests.py.
* CISupport/ews-build/runUnittests.py: Removed.
* CISupport/ews-build/steps.py:
(RunEWSUnitTests): Updated ews configuration appropriately.
(RunEWSUnitTests.__init__):
* CISupport/ews-build/steps_unittest.py: Updated EWS unit-tests accordingly.

Modified Paths

Added Paths

Removed Paths

Diff

Deleted: trunk/Tools/CISupport/ews-build/runUnittests.py (270294 => 270295)


--- trunk/Tools/CISupport/ews-build/runUnittests.py	2020-12-01 12:34:23 UTC (rev 270294)
+++ trunk/Tools/CISupport/ews-build/runUnittests.py	2020-12-01 14:43:15 UTC (rev 270295)
@@ -1,30 +0,0 @@
-#!/usr/bin/python
-
-import os
-import sys
-import unittest
-
-"""
-This is the equivalent of running:
-    python -m unittest discover --start-directory {test_discovery_path} --pattern {UNIT_TEST_PATTERN}
-"""
-
-UNIT_TEST_PATTERN = '*_unittest.py'
-
-
-def run_unittests(test_discovery_path):
-    test_suite = unittest.defaultTestLoader.discover(test_discovery_path, pattern=UNIT_TEST_PATTERN)
-    results = unittest.TextTestRunner(buffer=True).run(test_suite)
-    if results.failures or results.errors:
-        raise RuntimeError('Test failures or errors were generated during this test run.')
-
-
-if __name__ == '__main__':
-    try:
-        relative_path = sys.argv[1]
-    except IndexError:
-        relative_path = os.path.dirname(__file__)
-
-    path = os.path.abspath(relative_path)
-    assert os.path.isdir(path), '{} is not a directory. Please specify a valid directory'.format(path)
-    run_unittests(path)

Modified: trunk/Tools/CISupport/ews-build/steps.py (270294 => 270295)


--- trunk/Tools/CISupport/ews-build/steps.py	2020-12-01 12:34:23 UTC (rev 270294)
+++ trunk/Tools/CISupport/ews-build/steps.py	2020-12-01 14:43:15 UTC (rev 270295)
@@ -1141,10 +1141,10 @@
 class RunEWSUnitTests(shell.ShellCommand):
     name = 'ews-unit-tests'
     description = ['ews-unit-tests running']
-    command = ['python', 'Tools/CISupport/ews-build/runUnittests.py']
+    command = ['python', 'runUnittests.py', 'ews-build']
 
     def __init__(self, **kwargs):
-        super(RunEWSUnitTests, self).__init__(timeout=2 * 60, logEnviron=False, **kwargs)
+        super(RunEWSUnitTests, self).__init__(workdir='build/Tools/CISupport', timeout=2 * 60, logEnviron=False, **kwargs)
 
     def getResultSummary(self):
         if self.results == SUCCESS:

Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (270294 => 270295)


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2020-12-01 12:34:23 UTC (rev 270294)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2020-12-01 14:43:15 UTC (rev 270295)
@@ -662,10 +662,10 @@
     def test_success(self):
         self.setupStep(RunEWSUnitTests())
         self.expectRemoteCommands(
-            ExpectShell(workdir='wkdir',
+            ExpectShell(workdir='build/Tools/CISupport',
                         timeout=120,
                         logEnviron=False,
-                        command=['python', 'Tools/CISupport/ews-build/runUnittests.py'],
+                        command=['python', 'runUnittests.py', 'ews-build'],
                         )
             + 0,
         )
@@ -675,10 +675,10 @@
     def test_failure(self):
         self.setupStep(RunEWSUnitTests())
         self.expectRemoteCommands(
-            ExpectShell(workdir='wkdir',
+            ExpectShell(workdir='build/Tools/CISupport',
                         timeout=120,
                         logEnviron=False,
-                        command=['python', 'Tools/CISupport/ews-build/runUnittests.py'],
+                        command=['python', 'runUnittests.py', 'ews-build'],
                         )
             + ExpectShell.log('stdio', stdout='Unhandled Error. Traceback (most recent call last): Keys in cmd missing from expectation: [logfiles.json]')
             + 2,

Copied: trunk/Tools/CISupport/runUnittests.py (from rev 270294, trunk/Tools/CISupport/ews-build/runUnittests.py) (0 => 270295)


--- trunk/Tools/CISupport/runUnittests.py	                        (rev 0)
+++ trunk/Tools/CISupport/runUnittests.py	2020-12-01 14:43:15 UTC (rev 270295)
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+
+import os
+import sys
+import unittest
+
+"""
+This is the equivalent of running:
+    python -m unittest discover --start-directory {test_discovery_path} --pattern {UNIT_TEST_PATTERN}
+"""
+
+UNIT_TEST_PATTERN = '*_unittest.py'
+
+
+def run_unittests(test_discovery_path):
+    test_suite = unittest.defaultTestLoader.discover(test_discovery_path, pattern=UNIT_TEST_PATTERN)
+    results = unittest.TextTestRunner(buffer=True).run(test_suite)
+    if results.failures or results.errors:
+        raise RuntimeError('Test failures or errors were generated during this test run.')
+
+
+if __name__ == '__main__':
+    try:
+        relative_path = sys.argv[1]
+    except IndexError:
+        relative_path = os.path.dirname(__file__)
+
+    path = os.path.abspath(relative_path)
+    assert os.path.isdir(path), '{} is not a directory. Please specify a valid directory'.format(path)
+    run_unittests(path)

Property changes: trunk/Tools/CISupport/runUnittests.py


Added: svn:executable

+* \ No newline at end of property

Modified: trunk/Tools/ChangeLog (270294 => 270295)


--- trunk/Tools/ChangeLog	2020-12-01 12:34:23 UTC (rev 270294)
+++ trunk/Tools/ChangeLog	2020-12-01 14:43:15 UTC (rev 270295)
@@ -1,3 +1,17 @@
+2020-12-01  Aakash Jain  <[email protected]>
+
+        Share runUnittests.py for ews-build and build.webkit.org unit-tests
+        https://bugs.webkit.org/show_bug.cgi?id=219374
+
+        Reviewed by Jonathan Bedard.
+
+        * CISupport/runUnittests.py: Moved from Tools/CISupport/ews-build/runUnittests.py.
+        * CISupport/ews-build/runUnittests.py: Removed.
+        * CISupport/ews-build/steps.py:
+        (RunEWSUnitTests): Updated ews configuration appropriately.
+        (RunEWSUnitTests.__init__):
+        * CISupport/ews-build/steps_unittest.py: Updated EWS unit-tests accordingly.
+
 2020-12-01  Youenn Fablet  <[email protected]>
 
         Add support for readable/writable to RTCRtpSFrameTransform
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to