ya2 · news · projects · code · about

fixed testing
[pmachines.git] / tests / test_functional.py
index efb7b1d0564cbae4fdd6126c3cdf6cce037026cc..18b2a05b426a31642ee1a08c280e0f354e3c137b 100644 (file)
@@ -39,6 +39,9 @@ class FunctionalTests(TestCase):
                 info('%s removed' % _file)
             else:
                 info('%s does not exist' % _file)
+        opt_ini = str(Path.home()) + '/builders/pmachines_builder/pmachines/options.ini'
+        if exists(opt_ini):
+            remove(opt_ini)
         system('pkill -f "pmachines.exe"')
 
     def __awake(self):
@@ -111,10 +114,12 @@ class FunctionalTests(TestCase):
         if environ.get('FUNCTIONALPOST') != '1':
             self.skipTest('skipped functional-post tests')
         bld_branch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[_branch()]
-        cmd = 'flatpak update -y it.ya2.Pmachines//%s' % bld_branch
+        cmd = 'flatpak update --user -y it.ya2.Pmachines//%s' % bld_branch
         info('executing: %s' % cmd)
-        system(cmd)
+        #system(cmd)
+        fout = exec_cmd(cmd)
         info('executed: %s' % cmd)
+        info(fout)
         self.__test_template(
             'timeout 720s flatpak run it.ya2.Pmachines//%s --functional-test & '
             'timeout 720s ~/venv/bin/python -m lib.tools.functional_test.py 1; sleep 5; '
@@ -181,7 +186,11 @@ class FunctionalTests(TestCase):
                 self.__update_itchio()
                 cmds += [('timeout 720s /home/flavio/.config/itch/apps/pmachines/pmachines --version', str(Filename.get_user_appdata_directory()) + '/pmachines/obs_version.txt')]
             cmds += [('timeout 720s flatpak run it.ya2.Pmachines//%s --version' % bld_branch, '/home/flavio/.var/app/it.ya2.Pmachines/data/pmachines/obs_version.txt')]
-        system('flatpak update -y it.ya2.Pmachines//%s' % bld_branch)
+        info('executing flatpak update --user -y it.ya2.Pmachines//%s' % bld_branch)
+        #system('flatpak update -y --user it.ya2.Pmachines//%s' % bld_branch)
+        fout = exec_cmd('flatpak update -y --user it.ya2.Pmachines//%s' % bld_branch)
+        info('executed flatpak update --user -y it.ya2.Pmachines//%s' % bld_branch)
+        info(fout)
         for cmd in cmds:
             if exists(cmd[1]):
                 remove(cmd[1])