Skip to content

Commit 0c1af43

Browse files
author
David Erb
committed
adds test mysql
1 parent 27e5c3c commit 0c1af43

File tree

3 files changed

+89
-2
lines changed

3 files changed

+89
-2
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
type: dls_multiconf.classic
2+
3+
logging_settings:
4+
console:
5+
enabled: True
6+
verbose: True
7+
logfile:
8+
enabled: True
9+
directory: ${output_directory}/logfile.log
10+
graypy:
11+
enabled: False
12+
host: 172.23.7.128
13+
port: 12201
14+
protocol: UDP
15+
16+
# The external access bits.
17+
external_access_bits:
18+
xchembku_dataface_server: &XCHEMBKU_DATAFACE_SERVER http://*:27821
19+
xchembku_dataface_client: &XCHEMBKU_DATAFACE_CLIENT http://localhost:27821
20+
chimpflow_miner_server: &CHIMPFLOW_MINER_SERVER http://*:27825
21+
chimpflow_miner_client: &CHIMPFLOW_MINER_CLIENT http://localhost:27825
22+
23+
# -----------------------------------------------------------------------------
24+
# The xchembku_dataface direct access.
25+
xchembku_dataface_specification_direct: &XCHEMBKU_DATAFACE_SPECIFICATION_DIRECT
26+
type: "xchembku_lib.xchembku_datafaces.direct"
27+
should_drop_database: True
28+
database:
29+
type: "dls_normsql.aiomysql"
30+
type_specific_tbd:
31+
database_name: "xchembku_pytest"
32+
host: $MYSQL_HOST
33+
port: $MYSQL_PORT
34+
username: "root"
35+
password: "root"
36+
37+
# The xchembku_dataface client/server composite.
38+
xchembku_dataface_specification: &XCHEMBKU_DATAFACE_SPECIFICATION
39+
type: "xchembku_lib.xchembku_datafaces.aiohttp"
40+
type_specific_tbd:
41+
# The remote xchembku_dataface server access.
42+
aiohttp_specification:
43+
server: *XCHEMBKU_DATAFACE_SERVER
44+
client: *XCHEMBKU_DATAFACE_CLIENT
45+
# The local implementation of the xchembku_dataface.
46+
actual_xchembku_dataface_specification: *XCHEMBKU_DATAFACE_SPECIFICATION_DIRECT
47+
context:
48+
start_as: process
49+
50+
# -----------------------------------------------------------------------------
51+
# The chimpflow direct access.
52+
chimpflow_miner_specification_direct_poll:
53+
&CHIMPFLOW_COLLECTOR_SPECIFICATION_DIRECT_POLL
54+
type: "chimpflow_lib.miners.direct_poll"
55+
type_specific_tbd:
56+
chimp_adapter:
57+
# In pytest conftest.py, this file gets downloaded from Zenodo.
58+
model_path: "2022-12-07_CHiMP_Mask_R_CNN_XChem_50eph_VMXi_finetune_DICT_NZ.pytorch"
59+
num_classes: 3
60+
xchembku_dataface_specification: *XCHEMBKU_DATAFACE_SPECIFICATION
61+
62+
# The chimpflow client/server composite.
63+
chimpflow_miner_specification:
64+
type: "chimpflow_lib.miners.aiohttp"
65+
type_specific_tbd:
66+
# The remote chimpflow server access.
67+
aiohttp_specification:
68+
server: *CHIMPFLOW_MINER_SERVER
69+
client: *CHIMPFLOW_MINER_CLIENT
70+
# The local implementation of the chimpflow.
71+
direct_miner_specification: *CHIMPFLOW_COLLECTOR_SPECIFICATION_DIRECT_POLL
72+
context:
73+
start_as: process

tests/test_miner.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,29 @@ def __process(self, constants, configuration_file, output_directory):
5555

5656

5757
# ----------------------------------------------------------------------------------------
58-
class TestMinerService:
58+
class TestMinerServiceSqlite:
5959
"""
6060
Test miner interface through network interface.
6161
"""
6262

6363
def test(self, constants, logging_setup, output_directory):
6464

6565
# Configuration file to use.
66-
configuration_file = "tests/configurations/service.yaml"
66+
configuration_file = "tests/configurations/service_sqlite.yaml"
67+
68+
MinerTester().main(constants, configuration_file, output_directory)
69+
70+
71+
# ----------------------------------------------------------------------------------------
72+
class TestMinerServiceMysql:
73+
"""
74+
Test miner interface through network interface.
75+
"""
76+
77+
def test(self, constants, logging_setup, output_directory):
78+
79+
# Configuration file to use.
80+
configuration_file = "tests/configurations/service_mysql.yaml"
6781

6882
MinerTester().main(constants, configuration_file, output_directory)
6983

0 commit comments

Comments
 (0)