Skip to content

Commit 991d914

Browse files
committed
installing current version in qiita
1 parent 04b0705 commit 991d914

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

.github/workflows/qiita-ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ jobs:
8181
conda activate qiita_client
8282
pip --quiet install .
8383
84+
# Note that the qiita conda environment has installed the qiita_client "master branch"
85+
# but to fully test we need to install the current branch of qiita_client
86+
conda deactivate
87+
conda activate qiita
88+
pip --quiet install .
89+
8490
- name: Starting Main Services
8591
shell: bash -l {0}
8692
run: |

qiita_client/testing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import logging
1616

1717
logger = logging.getLogger(__name__)
18+
URL = "https://localhost:8383"
1819

1920

2021
class PluginTestCase(TestCase):
@@ -25,12 +26,11 @@ def setUpClass(cls):
2526
cls.client_secret = ('J7FfQ7CQdOxuKhQAf1eoGgBAE81Ns8Gu3EKaWFm3IO2JKh'
2627
'AmmCWZuabe0O5Mp28s1')
2728
cls.rootca = environ.get('QIITA_ROOTCA_CERT')
28-
qiita_port = int(environ.get('QIITA_PORT', 8383))
2929

3030
# do not rely on defining ca_cert for these tests. Instead append
3131
# the appropriate CA cert to certifi's pem file.
32-
cls.qclient = QiitaClient("https://localhost:%d" % qiita_port,
33-
cls.client_id, cls.client_secret, cls.rootca)
32+
cls.qclient = QiitaClient(
33+
URL, cls.client_id, cls.client_secret, cls.rootca)
3434

3535
logger.debug(
3636
'PluginTestCase.setUpClass() token %s' % cls.qclient._token)

qiita_client/tests/test_plugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from qiita_client.testing import PluginTestCase
1717
from qiita_client import (QiitaPlugin, QiitaTypePlugin, QiitaCommand,
1818
QiitaArtifactType, ArtifactInfo)
19+
from .testing import URL
1920

2021

2122
class QiitaCommandTest(TestCase):
@@ -173,7 +174,7 @@ def html_generator_func(a, b, c, d):
173174
self.qclient.post('/apitest/reload_plugins/')
174175

175176
# Install the current plugin
176-
tester("https://localhost:8383", 'register', 'ignored')
177+
tester(URL, 'register', 'ignored')
177178

178179
# Check that it has been installed
179180
obs = self.qclient.get('/qiita_db/plugins/NewPlugin/1.0.0/')
@@ -214,7 +215,7 @@ def func(qclient, job_id, job_params, working_dir):
214215

215216
tester.generate_config('ls', 'echo')
216217
self.qclient.post('/apitest/reload_plugins/')
217-
tester("https://localhost:8383", 'register', 'ignored')
218+
tester(URL, 'register', 'ignored')
218219

219220
obs = self.qclient.get('/qiita_db/plugins/NewPlugin/0.0.1/')
220221
self.assertEqual(obs['name'], 'NewPlugin')
@@ -230,7 +231,7 @@ def func(qclient, job_id, job_params, working_dir):
230231
'status': 'queued'}
231232
job_id = self.qclient.post('/apitest/processing_job/',
232233
data=data)['job']
233-
tester("https://localhost:8383", job_id, self.outdir)
234+
tester(URL, job_id, self.outdir)
234235

235236
status = self._wait_for_running_job(job_id)
236237
self.assertEqual(status, 'success')

qiita_client/tests/test_qiita_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,11 @@ def test_format_payload_error(self):
9797

9898
class QiitaClientTests(PluginTestCase):
9999
def setUp(self):
100-
self.ca_cert = environ.get('QIITA_ROOT_CA', None)
100+
self.ca_cert = environ.get('QIITA_ROOT_CA')
101101
self.tester = QiitaClient("https://localhost:8383",
102102
CLIENT_ID,
103103
CLIENT_SECRET,
104104
self.ca_cert)
105-
self.bad_tester = QiitaClient("https://localhost:8383",
106-
BAD_CLIENT_ID,
107-
CLIENT_SECRET,
108-
self.ca_cert)
109105
self.clean_up_files = []
110106

111107
# making assertRaisesRegex compatible with Python 2.7 and 3.9
@@ -247,6 +243,10 @@ def test_update_job_step_ignore_failure(self):
247243

248244
# confirm that update_job_step behaves as before when ignore_error
249245
# parameter absent or set to False.
246+
self.bad_tester = QiitaClient("https://localhost:8383",
247+
BAD_CLIENT_ID,
248+
CLIENT_SECRET,
249+
self.ca_cert)
250250

251251
with self.assertRaises(BaseException):
252252
self.bad_tester.update_job_step(job_id, new_step)

0 commit comments

Comments
 (0)