Skip to content

Commit e55a895

Browse files
Updated based on discussions
1 parent 8b036e2 commit e55a895

File tree

6 files changed

+12
-29
lines changed

6 files changed

+12
-29
lines changed

.github/workflows/qiita-ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
shell: bash -l {0}
8787
run: |
8888
conda activate qiita
89-
export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_server.crt
89+
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
9090
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
9191
sed "s#/home/runner/work/qiita/qiita#${PWD}/qiita-dev/#g" `pwd`/qiita-dev/qiita_core/support_files/config_test.cfg > ${QIITA_CONFIG_FP}
9292
@@ -118,8 +118,7 @@ jobs:
118118
COVER_PACKAGE: ${{ matrix.cover_package }}
119119
run: |
120120
conda activate qiita_client
121-
export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_server.crt
122-
export QIITA_ROOT_CA=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
121+
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
123122
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
124123
export PYTHONWARNINGS="ignore:Certificate for localhost has no \`subjectAltName\`"
125124
- uses: codecov/codecov-action@v3

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ This package includes the Qiita Client utility library, a library to simplify th
1010
How to test this package?
1111
-------------------------
1212
In order to test the Qiita Client package, a local installation of Qiita should be running in test mode on the address `https://localhost:21174`, with the default test database created in Qiita's test suite.
13-
Also, if Qiita is running with the default server SSL certificate, you need to export the variable `QIITA_SERVER_CERT` in your environment, so the Qiita Client can perform secure connections against the Qiita server:
13+
Also, if Qiita is running with the default server SSL certificate, you need to export the variable `QIITA_ROOTCA_CERT` in your environment, so the Qiita Client can perform secure connections against the Qiita server:
1414

1515
```bash
1616

17-
export QIITA_SERVER_CERT=<QIITA_INSTALL_PATH>/qiita_core/support_files/server.crt
17+
export QIITA_ROOT_CA=<QIITA_INSTALL_PATH>/qiita_core/support_files/ci_rootca.crt
1818
```

qiita_client/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def __call__(self, server_url, job_id, output_dir):
250250
# this value will prevent underlying libraries
251251
# from validating the server's cert using
252252
# certifi's pem cache.
253-
ca_cert=environ['QIITA_ROOT_CA'])
253+
ca_cert=environ['QIITA_ROOTCA_CERT'])
254254

255255
if job_id == 'register':
256256
self._register(qclient)

qiita_client/qiita_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, output_name, artifact_type, files, archive=None):
5757

5858
def __eq__(self, other):
5959
logger.debug('Entered ArtifactInfo.__eq__()')
60-
if type(self) != type(other): # noqa
60+
if type(self) is not type(other):
6161
return False
6262
if self.output_name != other.output_name or \
6363
self.artifact_type != other.artifact_type or \

qiita_client/tests/test_qiita_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# -----------------------------------------------------------------------------
88

99
from unittest import TestCase, main
10-
from os import remove, close
10+
from os import remove, close, environ
1111
from os.path import basename, exists
1212
from tempfile import mkstemp
1313
from json import dumps
@@ -97,7 +97,6 @@ def test_format_payload_error(self):
9797

9898
class QiitaClientTests(PluginTestCase):
9999
def setUp(self):
100-
# self.server_cert = environ.get('QIITA_SERVER_CERT', None)
101100
self.tester = QiitaClient("https://localhost:21174",
102101
CLIENT_ID,
103102
CLIENT_SECRET)
@@ -116,11 +115,14 @@ def tearDown(self):
116115
remove(fp)
117116

118117
def test_init(self):
119-
obs = QiitaClient("https://localhost:21174", CLIENT_ID, CLIENT_SECRET)
118+
obs = QiitaClient("https://localhost:21174",
119+
CLIENT_ID,
120+
CLIENT_SECRET,
121+
ca_cert=environ['QIITA_ROOT_CA'])
120122
self.assertEqual(obs._server_url, "https://localhost:21174")
121123
self.assertEqual(obs._client_id, CLIENT_ID)
122124
self.assertEqual(obs._client_secret, CLIENT_SECRET)
123-
self.assertEqual(obs._verify, True)
125+
self.assertEqual(obs._verify, environ['QIITA_ROOT_CA'])
124126

125127
def test_get(self):
126128
obs = self.tester.get("/qiita_db/artifacts/1/")

rootca_insert.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)