From 5d380f04302e0c84ed421dc97a854202abec836b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 5 Sep 2024 08:59:25 -0600 Subject: [PATCH 1/3] fix for plugins --- qiita_client/plugin.py | 2 +- qiita_client/qiita_client.py | 6 +++--- qiita_client/testing.py | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/qiita_client/plugin.py b/qiita_client/plugin.py index 3af462e..8dbff73 100644 --- a/qiita_client/plugin.py +++ b/qiita_client/plugin.py @@ -188,7 +188,7 @@ def _register_command(self, command): command: QiitaCommand The command to be added to the plugin """ - logger.debug('Entered BaseQiitaPlugin._register_command()') + logger.debug(f'Entered BaseQiitaPlugin._register_command({command.name}, {command})') self.task_dict[command.name] = command def _register(self, qclient): diff --git a/qiita_client/qiita_client.py b/qiita_client/qiita_client.py index 2dca728..553fae8 100644 --- a/qiita_client/qiita_client.py +++ b/qiita_client/qiita_client.py @@ -31,9 +31,9 @@ # if the log level is not CRITICAL, the default, then we not expect slow # responses from the server so let's make the retries values small if logger.level != logging.CRITICAL: - MAX_RETRIES = 2 - MIN_TIME_SLEEP = 2 - MAX_TIME_SLEEP = 5 + MAX_RETRIES = 1 + MIN_TIME_SLEEP = 6 + MAX_TIME_SLEEP = 12 else: MAX_RETRIES = 3 MIN_TIME_SLEEP = 180 diff --git a/qiita_client/testing.py b/qiita_client/testing.py index da55598..f33519e 100644 --- a/qiita_client/testing.py +++ b/qiita_client/testing.py @@ -25,12 +25,13 @@ def setUpClass(cls): cls.client_id = '19ndkO3oMKsoChjVVWluF7QkxHRfYhTKSFbAVt8IhK7gZgDaO4' cls.client_secret = ('J7FfQ7CQdOxuKhQAf1eoGgBAE81Ns8Gu3EKaWFm3IO2JKh' 'AmmCWZuabe0O5Mp28s1') + # qiita_port needs to be the main worker in qiita, the default is 21174 + qiita_port = int(environ.get('QIITA_PORT', '21174')) cls.ca_cert = environ.get('QIITA_ROOTCA_CERT') - # do not rely on defining ca_cert for these tests. Instead append - # the appropriate CA cert to certifi's pem file. + url = URL.replace('8383', qiita_port) cls.qclient = QiitaClient( - URL, cls.client_id, cls.client_secret, cls.ca_cert) + url, cls.client_id, cls.client_secret, cls.ca_cert) logger.debug( 'PluginTestCase.setUpClass() token %s' % cls.qclient._token) From d317a0ab8dbaebca41e45d64dc9b78dc50b13729 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 5 Sep 2024 08:59:50 -0600 Subject: [PATCH 2/3] fix for plugins --- qiita_client/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qiita_client/plugin.py b/qiita_client/plugin.py index 8dbff73..7ee87b4 100644 --- a/qiita_client/plugin.py +++ b/qiita_client/plugin.py @@ -188,7 +188,8 @@ def _register_command(self, command): command: QiitaCommand The command to be added to the plugin """ - logger.debug(f'Entered BaseQiitaPlugin._register_command({command.name}, {command})') + logger.debug( + f'Entered BaseQiitaPlugin._register_command({command.name})') self.task_dict[command.name] = command def _register(self, qclient): From 87c6d6447fcc77bb23b1a60cd4c0abd914b27af4 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 5 Sep 2024 09:21:28 -0600 Subject: [PATCH 3/3] int -> str --- qiita_client/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiita_client/testing.py b/qiita_client/testing.py index f33519e..41b183c 100644 --- a/qiita_client/testing.py +++ b/qiita_client/testing.py @@ -26,7 +26,7 @@ def setUpClass(cls): cls.client_secret = ('J7FfQ7CQdOxuKhQAf1eoGgBAE81Ns8Gu3EKaWFm3IO2JKh' 'AmmCWZuabe0O5Mp28s1') # qiita_port needs to be the main worker in qiita, the default is 21174 - qiita_port = int(environ.get('QIITA_PORT', '21174')) + qiita_port = environ.get('QIITA_PORT', '21174') cls.ca_cert = environ.get('QIITA_ROOTCA_CERT') url = URL.replace('8383', qiita_port)