ya2 · news · projects · code · about

refinements (building) master
authorFlavio Calva <f.calva@gmail.com>
Thu, 4 Aug 2022 18:32:52 +0000 (19:32 +0100)
committerFlavio Calva <f.calva@gmail.com>
Thu, 4 Aug 2022 18:32:52 +0000 (19:32 +0100)
tests/test_functional.py

index 73a0c9e85bc9483b5139858316cf7134d81c7d67..def76b5c6c0003efabc5f2c601580d922f1467bc 100644 (file)
@@ -18,6 +18,10 @@ from ya2.build.build import exec_cmd, _branch, _version
 
 class FunctionalTests(TestCase):
 
 
 class FunctionalTests(TestCase):
 
+    def __init__(self, *args, **kwargs):
+        super(FunctionalTests, self).__init__(*args, **kwargs)
+        self.__itchio_updated = False
+
     def __clean(self):
         paths = [
             'tests/functional',
     def __clean(self):
         paths = [
             'tests/functional',
@@ -114,6 +118,8 @@ class FunctionalTests(TestCase):
 
     def test_code(self):
         info('test_code')
 
     def test_code(self):
         info('test_code')
+        if environ.get('FUNCTIONALPOST') == '1':
+            self.skipTest('skipped functional-post test: test_code')
         self.__test_template(
             '/home/flavio/venv/bin/python main.py --functional-test',
             ['/home/flavio/venv/bin/python -m tests.functional_test.py 1',
         self.__test_template(
             '/home/flavio/venv/bin/python main.py --functional-test',
             ['/home/flavio/venv/bin/python -m tests.functional_test.py 1',
@@ -122,6 +128,8 @@ class FunctionalTests(TestCase):
 
     def test_appimage(self):
         info('test_appimage')
 
     def test_appimage(self):
         info('test_appimage')
+        if environ.get('FUNCTIONALPOST') == '1':
+            self.skipTest('skipped functional-post test: test_appimage')
         bld_branch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[_branch()]
         bld_branch = '' if bld_branch == 'stable' else ('-' + bld_branch)
         self.__test_template(
         bld_branch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[_branch()]
         bld_branch = '' if bld_branch == 'stable' else ('-' + bld_branch)
         self.__test_template(
@@ -149,6 +157,9 @@ class FunctionalTests(TestCase):
     #         str(Path.home()) + '/.var/app/it.ya2.Pmachines/data/pmachines/tests/functional/')
 
     def __update_itchio(self):
     #         str(Path.home()) + '/.var/app/it.ya2.Pmachines/data/pmachines/tests/functional/')
 
     def __update_itchio(self):
+        info('update_itchio::itchio_updated::cond: %s' % str(self.__itchio_updated))
+        if self.__itchio_updated:
+            return
         system('/home/flavio/.itch/itch')
         sleep(120)
         system('xdotool mousemove 860 620')
         system('/home/flavio/.itch/itch')
         sleep(120)
         system('xdotool mousemove 860 620')
@@ -156,6 +167,8 @@ class FunctionalTests(TestCase):
         system('xdotool click 1')
         sleep(300)
         system('killall itch')
         system('xdotool click 1')
         sleep(300)
         system('killall itch')
+        self.__itchio_updated = True
+        info('update_itchio::itchio_updated::done: %s' % str(self.__itchio_updated))
 
     def test_itchio(self):
         info('test_itchio')
 
     def test_itchio(self):
         info('test_itchio')
@@ -172,6 +185,8 @@ class FunctionalTests(TestCase):
 
     def test_windows(self):
         info('test_windows')
 
     def test_windows(self):
         info('test_windows')
+        if environ.get('FUNCTIONALPOST') == '1':
+            self.skipTest('skipped functional-post test: test_windows')
         system('pkill -f "pmachines.exe"')
         abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
         self.__test_template(
         system('pkill -f "pmachines.exe"')
         abspath = str(Path(__file__).parent.parent) + '/build/win_amd64/pmachines.exe'
         self.__test_template(