From 1ba5e7f0abb17952254a2c3219cd660d920ad8c9 Mon Sep 17 00:00:00 2001 From: Flavio Calva Date: Thu, 14 Apr 2022 18:48:09 +0100 Subject: [PATCH] functional tests: flatpak --- prj.org | 2 +- setup.py | 2 +- tests/test_functional.py | 29 ++++++++++++++++------------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/prj.org b/prj.org index 4d8b134..29079f0 100644 --- a/prj.org +++ b/prj.org @@ -12,7 +12,7 @@ - [X] code - [X] appimage - [X] windows - - [ ] flatpak + - [X] flatpak - [ ] itchio - [ ] versions ** READY management of error and success (upload builds, itch.io) diff --git a/setup.py b/setup.py index 6f5aead..0984091 100644 --- a/setup.py +++ b/setup.py @@ -129,7 +129,7 @@ class BDistAppsCmd(bdist_apps): if not self.nolinux: hbranch = {'master': 'alpha', 'rc': 'rc', 'stable': ''}[branch] AppImageBuilder(self).build(longname, hbranch, - 'http://www.ya2tech.it/downloads/') + 'https://www.ya2.it/downloads/') fbranch = {'master': 'alpha', 'rc': 'rc', 'stable': 'stable'}[branch] bld = FlatpakBuilder( self, diff --git a/tests/test_functional.py b/tests/test_functional.py index db96fa9..1d1c27a 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -76,6 +76,9 @@ class FunctionalTests(TestCase): self.assertTrue(exists(path + basename(fname)), '%s does not exist' % (path + basename(fname))) self.assertTrue( self.__similar_images( + str(Path.home()) + '/.local/share/pmachines/tests/functional_ref_%s/' % _branch() + basename(fname), + path + basename(fname)), + 'error while comparing %s and %s' % ( str(Path.home()) + '/.local/share/pmachines/tests/functional_ref_%s/' % _branch() + basename(fname), path + basename(fname))) @@ -95,19 +98,19 @@ class FunctionalTests(TestCase): './dist/Pmachines%s-x86_64.AppImage --functional-test 2' % (bld_branch, bld_branch), str(Path.home()) + '/.local/share/pmachines/tests/functional/') - # def test_flatpak(self): - # info('test_flatpak') - # 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 - # info('executing: %s' % cmd) - # system(cmd) - # info('executed: %s' % cmd) - # self.__test_template( - # 'flatpak run it.ya2.Pmachines//%s --functional-test 1 ;' - # 'flatpak run it.ya2.Pmachines//%s --functional-test 2' % (bld_branch, bld_branch), - # str(Path.home()) + '/.var/app/it.ya2.Pmachines/data/pmachines/tests/functional/') + def test_flatpak(self): + info('test_flatpak') + 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 + info('executing: %s' % cmd) + system(cmd) + info('executed: %s' % cmd) + self.__test_template( + 'flatpak run it.ya2.Pmachines//%s --functional-test 1 ;' + 'flatpak run it.ya2.Pmachines//%s --functional-test 2' % (bld_branch, bld_branch), + str(Path.home()) + '/.var/app/it.ya2.Pmachines/data/pmachines/tests/functional/') # def __update_itchio(self): # system('/home/flavio/.itch/itch') -- 2.30.2