Skip to content

Commit 96b2711

Browse files
Make each product use their own gRPC Device Server ports in the System Tests (#2086)
* Make each product use their own gRPC Device Server ports * Change comma to period --------- Co-authored-by: Saarthak Mohan <--global>
1 parent 6a67d01 commit 96b2711

13 files changed

+74
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"address": "[::1]",
3+
"port": 31760,
4+
"security" : {
5+
"server_cert": "",
6+
"server_key": "",
7+
"root_cert": ""
8+
}
9+
}

src/nidcpower/system_tests/test_system_nidcpower.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,9 @@ def test_lcr_compensation_data(self, session):
10991099
class TestGrpc(SystemTests):
11001100
@pytest.fixture(scope='class')
11011101
def grpc_channel(self):
1102-
with system_test_utilities.GrpcServerProcess() as proc:
1102+
current_directory = os.path.dirname(os.path.abspath(__file__))
1103+
config_file_path = os.path.join(current_directory, 'grpc_server_config.json')
1104+
with system_test_utilities.GrpcServerProcess(config_file_path) as proc:
11031105
channel = grpc.insecure_channel(f"localhost:{proc.server_port}")
11041106
yield channel
11051107

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"address": "[::1]",
3+
"port": 31761,
4+
"security" : {
5+
"server_cert": "",
6+
"server_key": "",
7+
"root_cert": ""
8+
}
9+
}

src/nidigital/system_tests/test_system_nidigital.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,9 @@ def test_enable_match_fail_combination(self, multi_instrument_session):
13501350
class TestGrpc(SystemTests):
13511351
@pytest.fixture(scope='class')
13521352
def grpc_channel(self):
1353-
with system_test_utilities.GrpcServerProcess() as proc:
1353+
current_directory = os.path.dirname(os.path.abspath(__file__))
1354+
config_file_path = os.path.join(current_directory, 'grpc_server_config.json')
1355+
with system_test_utilities.GrpcServerProcess(config_file_path) as proc:
13541356
channel = grpc.insecure_channel(f"localhost:{proc.server_port}")
13551357
yield channel
13561358

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"address": "[::1]",
3+
"port": 31762,
4+
"security" : {
5+
"server_cert": "",
6+
"server_key": "",
7+
"root_cert": ""
8+
}
9+
}

src/nidmm/system_tests/test_system_nidmm.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,9 @@ def test_fetch_waveform_into(self, session):
330330
class TestGrpc(SystemTests):
331331
@pytest.fixture(scope='class')
332332
def grpc_channel(self):
333-
with system_test_utilities.GrpcServerProcess() as proc:
333+
current_directory = os.path.dirname(os.path.abspath(__file__))
334+
config_file_path = os.path.join(current_directory, 'grpc_server_config.json')
335+
with system_test_utilities.GrpcServerProcess(config_file_path) as proc:
334336
channel = grpc.insecure_channel(f"localhost:{proc.server_port}")
335337
yield channel
336338

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"address": "[::1]",
3+
"port": 31763,
4+
"security" : {
5+
"server_cert": "",
6+
"server_key": "",
7+
"root_cert": ""
8+
}
9+
}

src/nifgen/system_tests/test_system_nifgen.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ def test_write_named_waveform_numpy_array_int16(self, session):
516516
class TestGrpc(SystemTests):
517517
@pytest.fixture(scope='class')
518518
def grpc_channel(self):
519-
with system_test_utilities.GrpcServerProcess() as proc:
519+
current_directory = os.path.dirname(os.path.abspath(__file__))
520+
config_file_path = os.path.join(current_directory, 'grpc_server_config.json')
521+
with system_test_utilities.GrpcServerProcess(config_file_path) as proc:
520522
channel = grpc.insecure_channel(f"localhost:{proc.server_port}")
521523
yield channel
522524

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"address": "[::1]",
3+
"port": 31764,
4+
"security" : {
5+
"server_cert": "",
6+
"server_key": "",
7+
"root_cert": ""
8+
}
9+
}

src/niscope/system_tests/test_system_niscope.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ def test_reset_with_defaults(self, single_instrument_session):
612612
class TestGrpc(SystemTests):
613613
@pytest.fixture(scope='class')
614614
def grpc_channel(self):
615-
with system_test_utilities.GrpcServerProcess() as proc:
615+
current_directory = os.path.dirname(os.path.abspath(__file__))
616+
config_file_path = os.path.join(current_directory, 'grpc_server_config.json')
617+
with system_test_utilities.GrpcServerProcess(config_file_path) as proc:
616618
channel = grpc.insecure_channel(f"localhost:{proc.server_port}")
617619
yield channel
618620

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"address": "[::1]",
3+
"port": 31765,
4+
"security" : {
5+
"server_cert": "",
6+
"server_key": "",
7+
"root_cert": ""
8+
}
9+
}

src/niswitch/system_tests/test_system_niswitch.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ def session_creation_kwargs(self):
195195
class TestGrpc(SystemTests):
196196
@pytest.fixture(scope='class')
197197
def grpc_channel(self):
198-
with system_test_utilities.GrpcServerProcess() as proc:
198+
current_directory = os.path.dirname(os.path.abspath(__file__))
199+
config_file_path = os.path.join(current_directory, 'grpc_server_config.json')
200+
with system_test_utilities.GrpcServerProcess(config_file_path) as proc:
199201
channel = grpc.insecure_channel(f"localhost:{proc.server_port}")
200202
yield channel
201203

src/shared/system_test_utilities.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99

1010
class GrpcServerProcess:
11-
def __init__(self):
11+
def __init__(self, config_file_path):
1212
server_exe = self._get_grpc_server_exe()
13-
self._proc = subprocess.Popen([str(server_exe)], stdout=subprocess.PIPE)
13+
self._proc = subprocess.Popen([str(server_exe), config_file_path], stdout=subprocess.PIPE)
1414

1515
# Read/parse output until we find the port number or the process exits; discard the rest.
1616
try:

0 commit comments

Comments
 (0)