Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1018)

Unified Diff: scripts/slave/recipe_modules/auto_bisect/resources/significantly_different_test.py

Issue 1610203003: Iteratively increase sample size for good/bad classification. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Rebasing Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/auto_bisect/resources/significantly_different_test.py
diff --git a/scripts/slave/recipe_modules/auto_bisect/resources/significantly_different_test.py b/scripts/slave/recipe_modules/auto_bisect/resources/significantly_different_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..2c8da3cc0c4404c9f442299ebf5a79b39449428e
--- /dev/null
+++ b/scripts/slave/recipe_modules/auto_bisect/resources/significantly_different_test.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+"""Tests for significantly_different."""
+
+import os
+import sys
+import unittest
+
+# pylint: disable=relative-import
+import significantly_different
+
+
+class SignificantlyDifferentTest(unittest.TestCase):
+
+ def setUp(self):
+ self.conda_path = None
+ try:
+ import scipy # pylint: disable=unused-variable
+ self.conda_path = sys.executable
+ except ImportError:
+ if os.path.exists(os.path.expanduser('~/conda-test/bin/python')):
+ self.conda_path = os.path.expanduser('~/conda-test/bin/python')
+
+ def test_basic_case(self):
+ try:
+ results = significantly_different.main(
+ ['', '[1, 2, 3, 3, 2, 1]', '[1, 2, 2, 2, 5, 0]', '0.05'],
+ self.conda_path)
+ except significantly_different.ScipyNotInstalledError:
+ # This is meant to let presubmit pass on CQ bots :( because they don't
+ # have scipy either directly or thorugh anaconda.
+ return
+
+ self.assertAlmostEqual(
+ 0.40073980338363635,
+ results['mann_p_value'])
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698