ya2 · news · projects · code · about

external testing process
[pmachines.git] / tests / test_functional.py
index 09523b5127a22ebec47268d1e8e3354e28024bb1..3db67e030b30615c7946ffcaffa33a7169a22ad4 100644 (file)
@@ -89,8 +89,10 @@ class FunctionalTests(TestCase):
     def test_code(self):
         info('test_code')
         self.__test_template(
-            'timeout 720s ~/venv/bin/python main.py --functional-test 1 ; '
-            'timeout 720s ~/venv/bin/python main.py --functional-test 2',
+            'timeout 720s ~/venv/bin/python main.py --functional-test & '
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
+            'timeout 720s ~/venv/bin/python main.py --functional-test & '
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     def test_appimage(self):
@@ -98,8 +100,10 @@ class FunctionalTests(TestCase):
         bld_branch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[_branch()]
         bld_branch = '' if bld_branch == 'stable' else ('-' + bld_branch)
         self.__test_template(
-            'timeout 720s ./dist/Pmachines%s-x86_64.AppImage --functional-test 1 ;'
-            'timeout 720s ./dist/Pmachines%s-x86_64.AppImage --functional-test 2' % (bld_branch, bld_branch),
+            'timeout 720s ./dist/Pmachines%s-x86_64.AppImage --functional-test & '
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
+            'timeout 720s ./dist/Pmachines%s-x86_64.AppImage --functional-test & ' % (bld_branch, bld_branch) +
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
             str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
     def test_flatpak(self):
@@ -112,8 +116,10 @@ class FunctionalTests(TestCase):
         system(cmd)
         info('executed: %s' % cmd)
         self.__test_template(
-            'timeout 720s flatpak run it.ya2.Pmachines//%s --functional-test 1 ;'
-            'timeout 720s flatpak run it.ya2.Pmachines//%s --functional-test 2' % (bld_branch, bld_branch),
+            'timeout 720s flatpak run it.ya2.Pmachines//%s --functional-test & '
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
+            'timeout 720s flatpak run it.ya2.Pmachines//%s --functional-test & ' % (bld_branch, bld_branch) +
+            'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
             str(Path.home()) + '/.var/app/it.ya2.Pmachines/data/pmachines/tests/functional/')
 
     # def __update_itchio(self):
@@ -133,18 +139,22 @@ class FunctionalTests(TestCase):
     #         return
     #     self.__update_itchio()
     #     self.__test_template(
-    #         'timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --functional-test 1 ;'
-    #         'timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --functional-test 2',
+    #         'timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --functional-test & '
+    #         'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
+    #         'timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --functional-test & '
+    #         'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
     #         str(Path.home()) + '/.local/share/pmachines/tests/functional/')
 
-    # def test_windows(self):
-    #     info('test_windows')
-    #     system('pkill -f "pmachines.exe"')
-    #     abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
-    #     self.__test_template(
-    #         'timeout 720s wine %s --functional-test 1 ; '
-    #         'timeout 720s wine %s --functional-test 2' % (abspath, abspath),
-    #         str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
+    #def test_windows(self):
+    #    info('test_windows')
+    #    system('pkill -f "pmachines.exe"')
+    #    abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
+    #    self.__test_template(
+    #        'timeout 720s wine %s --functional-test & '
+    #        'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
+    #        'timeout 720s wine %s --functional-test & ' % (abspath, abspath) +
+    #        'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 2',
+    #        str(Path.home()) + '/.wine/drive_c/users/flavio/AppData/Local/pmachines/tests/functional/')
 
     def test_versions(self):
         info('test_versions')