ya2 · news · projects · code · about

fix: windows builds
authorFlavio Calva <f.calva@gmail.com>
Sat, 8 Apr 2023 07:12:08 +0000 (09:12 +0200)
committerFlavio Calva <f.calva@gmail.com>
Sat, 8 Apr 2023 07:12:08 +0000 (09:12 +0200)
tests/functional_test.py
tests/test_functional.py
ya2/utils/functional.py
ya2/utils/logics.py

index a4e68153f9647c389d12ef85092b55175c6ace84..338eebb96742e4bc61bfa5bc767215a7e676cee5 100644 (file)
@@ -39,7 +39,8 @@ class FunctionalTest:
 
         info('test idx: %s' % idx)
         self._offset = offset
-        sleep(12)
+        info(str(sys.argv))
+        sleep(int(sys.argv[2]) if len(sys.argv) >= 3 else 12)
         self._proxy = ServerProxy('http://localhost:7000')
         self._curr_time = 0
         self._tasks = []
index dbb72aaf1911a7aa21b22d6d9da34f8f22fa904d..e2e6b3c51ab4c48dcdcb5dcb1e989ee62343602d 100644 (file)
@@ -194,9 +194,9 @@ class FunctionalTests(TestCase):
         abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
         self.__test_template(
             'timeout 7200s wine %s --functional-test' % abspath,
-            ['timeout 7200s ~/venv/bin/python -m tests.functional_test.py 1',
-             'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 2',
-             'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 3'],
+            ['timeout 7200s ~/venv/bin/python -m tests.functional_test.py 1 120',
+             'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 2 120',
+             'timeout 7200s ~/venv/bin/python -m tests.functional_test.py 3 120'],
             str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
 
     def test_versions(self):
index 6babb3950be4205c62c1fe6a7e15b95377b0a469..621331d2ee38ae3c5712bb902524ad2f7b6752b4 100644 (file)
@@ -97,7 +97,7 @@ class FunctionalTest:
         self.__path += f'tests/functional{"_ref" if self.__creating_references else ""}/'
 
     def __set_path_wine(self):
-        home = Path.home()
+        home = str(Path.home())
         if self.__path.startswith('/c/users/') and exists(home + '/.wine/'):
             self.__path = home + '/.wine/drive_' + self.__path[1:]
 
index baf951bddf6b76b2d8672e7bd56e08bf22a674f1..f03080eaa36ce595b7016f6e04d41c64106a0907 100755 (executable)
@@ -55,7 +55,7 @@ class LogicsTools:
     @staticmethod
     def __is_windows_not_wine():
         home = str(Path.home())
-        return platform == 'win32' and not exists(home + '/.wine/')
+        return platform.startswith('win') and not exists(home + '/.wine/')
 
     @staticmethod
     def __linux2windows_path(path):