Title: [244550] trunk/Tools
Revision
244550
Author
[email protected]
Date
2019-04-23 10:58:21 -0700 (Tue, 23 Apr 2019)

Log Message

[ews-build] Add unit tests for CleanWorkingDirectory
https://bugs.webkit.org/show_bug.cgi?id=197195

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps_unittest.py:
(TestCleanWorkingDirectory):
(TestCleanWorkingDirectory.test_success):
(TestCleanWorkingDirectory.test_failure):

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py (244549 => 244550)


--- trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py	2019-04-23 17:54:35 UTC (rev 244549)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py	2019-04-23 17:58:21 UTC (rev 244550)
@@ -834,6 +834,38 @@
         return self.runStep()
 
 
+class TestCleanWorkingDirectory(BuildStepMixinAdditions, unittest.TestCase):
+    def setUp(self):
+        self.longMessage = True
+        return self.setUpBuildStep()
+
+    def tearDown(self):
+        return self.tearDownBuildStep()
+
+    def test_success(self):
+        self.setupStep(CleanWorkingDirectory())
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['Tools/Scripts/clean-webkit'],
+                        )
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Cleaned working directory')
+        return self.runStep()
+
+    def test_failure(self):
+        self.setupStep(CleanWorkingDirectory())
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        command=['Tools/Scripts/clean-webkit'],
+                        )
+            + ExpectShell.log('stdio', stdout='Unexpected failure.')
+            + 2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='Cleaned working directory (failure)')
+        return self.runStep()
+
+
 class TestArchiveBuiltProduct(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True

Modified: trunk/Tools/ChangeLog (244549 => 244550)


--- trunk/Tools/ChangeLog	2019-04-23 17:54:35 UTC (rev 244549)
+++ trunk/Tools/ChangeLog	2019-04-23 17:58:21 UTC (rev 244550)
@@ -1,5 +1,17 @@
 2019-04-23  Aakash Jain  <[email protected]>
 
+        [ews-build] Add unit tests for CleanWorkingDirectory
+        https://bugs.webkit.org/show_bug.cgi?id=197195
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/steps_unittest.py:
+        (TestCleanWorkingDirectory):
+        (TestCleanWorkingDirectory.test_success):
+        (TestCleanWorkingDirectory.test_failure):
+
+2019-04-23  Aakash Jain  <[email protected]>
+
         [ews-build] Use explicit imports instead of wildcard imports
         https://bugs.webkit.org/show_bug.cgi?id=197194
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to