Commit 8b47df7d authored by Jérome Perrin's avatar Jérome Perrin

theia/test/{project_tests,test_resiliency}: log output, don't print

and other small cleanups
parent 159460d5
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
from __future__ import unicode_literals
import gzip import gzip
import json import json
...@@ -32,20 +31,19 @@ import os ...@@ -32,20 +31,19 @@ import os
import re import re
import subprocess import subprocess
import time import time
import unittest
import shutil import shutil
import requests import requests
import tempfile import tempfile
from datetime import datetime, timedelta from datetime import datetime, timedelta
from six.moves.urllib.parse import urljoin from urllib.parse import urljoin
from mimetypes import guess_type from mimetypes import guess_type
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from slapos.testing.testcase import installSoftwareUrlList from slapos.testing.testcase import installSoftwareUrlList
import test_resiliency import test_resiliency
from test import SlapOSInstanceTestCase, theia_software_release_url from .test import SlapOSInstanceTestCase, theia_software_release_url
erp5_software_release_url = os.path.abspath( erp5_software_release_url = os.path.abspath(
...@@ -448,6 +446,7 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience): ...@@ -448,6 +446,7 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
return self.getPartitionPath( return self.getPartitionPath(
instance_type, 'srv', 'runner', 'instance', partition, *paths) instance_type, 'srv', 'runner', 'instance', partition, *paths)
class TestTheiaResilienceGitlab(test_resiliency.TestTheiaResilience): class TestTheiaResilienceGitlab(test_resiliency.TestTheiaResilience):
test_instance_max_retries = 50 # puma takes time to be ready test_instance_max_retries = 50 # puma takes time to be ready
backup_max_tries = 480 backup_max_tries = 480
...@@ -467,7 +466,7 @@ class TestTheiaResilienceGitlab(test_resiliency.TestTheiaResilience): ...@@ -467,7 +466,7 @@ class TestTheiaResilienceGitlab(test_resiliency.TestTheiaResilience):
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
text=True, text=True,
) )
print(out) self.logger.info("_getGitlabConnectionParameters output: %s", out)
return json.loads(self._connection_parameters_regex.search(out).group(0).replace("'", '"')) return json.loads(self._connection_parameters_regex.search(out).group(0).replace("'", '"'))
def test_twice(self): def test_twice(self):
......
...@@ -77,7 +77,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase): ...@@ -77,7 +77,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase):
output = cls.captureSlapos('node', 'instance', instance_type=instance_type, stderr=subprocess.STDOUT) output = cls.captureSlapos('node', 'instance', instance_type=instance_type, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
continue continue
print(output) cls.logger.info("_processEmbeddedInstance output: %s", output)
break break
else: else:
if retries: if retries:
...@@ -93,7 +93,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase): ...@@ -93,7 +93,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase):
output = cls.captureSlapos('node', 'software', instance_type=instance_type, stderr=subprocess.STDOUT) output = cls.captureSlapos('node', 'software', instance_type=instance_type, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
continue continue
print(output) cls.logger.info("_processEmbeddedSoftware output: %s", output)
break break
else: else:
if retries: if retries:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment