Skip to content

Commit

Permalink
run unit tests on different beanstalkd instance
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Ray <[email protected]>
  • Loading branch information
jasonray committed Dec 26, 2023
1 parent d461e27 commit 77e3972
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pulpo-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def main():
parser.add_argument('--config', type=str, help='path to config file')

parser.add_argument('--file_queue_adapter.base_path', type=str)
parser.add_argument('--beanstalkd_queue_adapter.host', type=str)
parser.add_argument('--beanstalkd_queue_adapter.port', type=int)

# parser.add_argument('--server', '-s', dest='host', default='127.0.0.1', help='beanstalkd host/server', type=str)
# parser.add_argument('--port', '-p', dest='port', default=11300, help='beanstalkd port', type=int)
Expand Down
10 changes: 6 additions & 4 deletions pulpo_messaging/tests/test_bqa_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ def decorator(test: TestFunc) -> WrapperFunc:

def wrapper(cls) -> None:
cmd = [BEANSTALKD_PATH]
host = '127.0.0.1'
port = 11300
address = (host, port)
host, port = DEFAULT_INET_ADDRESS
cmd.extend(["-l", host, "-p", str(port)])
print(f'starting beanstalkd [{cmd=}][{address=}]')
print(f'starting beanstalkd [{cmd=}][{DEFAULT_INET_ADDRESS=}]')
with subprocess.Popen(cmd) as beanstalkd:
print(f'started beanstalkd {beanstalkd.pid=}')
time.sleep(0.1)
Expand Down Expand Up @@ -51,6 +49,10 @@ def run_cli(self, command, config: str = None, additional_args=None, error_on_fa
args.append(command)
args.append(f'--config={config}')

host, port = DEFAULT_INET_ADDRESS
args.append(f'--beanstalkd_queue_adapter.host={host}')
args.append(f'--beanstalkd_queue_adapter.port={port}')

if additional_args:
args = args + additional_args

Expand Down

0 comments on commit 77e3972

Please sign in to comment.