Compare commits

...

17 Commits

Author SHA1 Message Date
Tim Bentley 7c64e935b5 Merge branch 'oct_2020' into 'master'
Oct 2020

See merge request openlp/openlp_api_tester!7
2021-01-02 12:10:19 +00:00
Tim Bentley 7d06a06f48 Merge branch 'master' into 'oct_2020'
# Conflicts:
#   full_run_rand.yaml
#   full_run_seq.yaml
#   test.yaml
#   test_api/apitest/callbacks.py
#   test_api/apitest/runner.py
2021-01-02 12:09:20 +00:00
Tim ac408e4912
More Updates and year change 2021-01-02 12:05:02 +00:00
Tim a55bac850e
fix errors 2020-10-20 13:00:18 +01:00
Tim a0cfa10278
fix errors 2020-10-20 12:57:59 +01:00
Tim 8c0769f93f
updates and documentation 2020-10-20 12:41:52 +01:00
Tim 4183cc6806
Timing Cleanups 2020-10-04 19:50:42 +01:00
Tim 670c658dc6
Timing Cleanups 2020-10-04 19:47:01 +01:00
Tim 3f232728a1
Updates to add socket queue and timing changes 2020-10-04 18:11:30 +01:00
Tim bb0ad4c36d
Fix 2020-06-26 15:26:48 +01:00
Tim 81a1f87366
Fixes 2020-06-26 15:19:30 +01:00
Tim 149a189bfe
help 2020-06-26 14:40:45 +01:00
Tim Bentley c6cd3aa837 Update .gitlab-ci.yml 2020-06-21 07:31:12 +00:00
Tim Bentley a2dee2650b Update .gitlab-ci.yml 2020-06-21 07:28:23 +00:00
Tim Bentley 13061e46a9 Add .gitlab-ci.yml 2020-06-21 07:25:52 +00:00
Tim 3281f241fa
Update WebSocket code to run on Thread and test from Thread. 2020-06-20 11:18:05 +01:00
Tim b616f41b4e
Remove .idea tracking 2020-06-20 09:07:08 +01:00
10 changed files with 28 additions and 41 deletions

View File

@ -3,7 +3,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #

View File

@ -82,4 +82,4 @@ step17:
payload:
plugin: bibles
step18:
name: load_service_sequential
name: load_service_random

View File

@ -46,11 +46,6 @@ step10:
name: search_and_add
payload:
plugin: songs
step11:
delay: 1
name: search_and_add
payload:
plugin: presentation
step12:
delay: 1
name: search_and_add
@ -82,4 +77,4 @@ step17:
payload:
plugin: bibles
step18:
name: load_service_random
name: load_service_sequential

View File

@ -2,7 +2,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@ -137,6 +137,18 @@ def load_service_sequential(rtc: object) -> None:
rtc.pending.append(Task(rtc, pl))
def load_service_random(rtc: object) -> None:
print_text('Load_service_sequential')
items = requests.get(rtc.base_url + 'service/items')
service = json.loads(items.text)
limit = len(service)
random_service = [random.randint(1, limit) for itr in range(limit)]
# test sequentially
for item in random_service:
pl = {'max': 1, 'min': 1, 'name': 'service_item_show', 'payload': {'item': item}}
rtc.pending.append(Task(rtc, pl))
def service_item_show(rtc: object, payload: dict) -> None:
print_text('Service_item_show')
item = payload['item']
@ -146,7 +158,7 @@ def service_item_show(rtc: object, payload: dict) -> None:
ret = requests.post(rtc.base_url + 'service/show', json=dict(uid=id))
assert ret.status_code == 204, ret.status_code
if not item['plugin'] == 'media':
pl = {'max': 1, 'min': 2, 'delay': 0.5, 'name': 'play_live_items', 'payload': {'item': item}}
pl = {'max': 1, 'min': 2, 'delay': 0.5, 'name': 'play_live_items'}
rtc.tasks.append(Task(rtc, pl))
@ -162,12 +174,12 @@ def play_live_items(rtc: object) -> None:
assert ret.status_code == 200, f'{ret.status_code} returned from show'
def play_live_item(rtc: object) -> None:
def play_live_item(rtc: object, payload: dict) -> None:
print_text('Play_live_item')
ret = requests.get(rtc.base_url + 'controller/live-item')
assert ret.status_code == 200, f'{ret.status_code} returned from live_item'
aa = json.loads(ret.text)
print_text(aa)
print_text(str(aa))
def controller_item_show(rtc: object, payload: dict) -> None:

View File

@ -3,7 +3,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #

View File

@ -3,7 +3,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #

View File

@ -2,7 +2,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@ -48,6 +48,7 @@ class RunTestsController(object):
self.pending = deque()
self.ws_data = deque()
self.base_url = f'http://{self.address}:{self.http_port}/api/v2/'
self.debug = False
def connect(self) -> None:
print_info("Starting thread")
@ -69,7 +70,8 @@ class RunTestsController(object):
print_error("Could not connect to WS! Exiting.")
def on_message(self, message: str) -> None:
print_debug(f"Message returned: {message}")
if self.debug:
print_debug(f"Message returned: {message}")
if not self.received:
self.reserved_result_stage = message
else:
@ -148,28 +150,6 @@ class RunTestsController(object):
pend = self.pending.popleft()
self.tasks.append(pend)
def load_service_sequential(self) -> None:
print_text('Load_and_process_service_sequential - old')
items = requests.get(f'http://{self.address}:{self.http_port}/api/v2/service/items')
service = json.loads(items.text)
# test sequentially
for item in service:
if item['plugin'] == 'video':
pass
else:
service_item_show(self, item)
def load_service_random(self) -> None:
print_text('Load_and process_service_random - old')
items = requests.get(f'http://{self.address}:{self.http_port}/api/v2/service/items')
service = json.loads(items.text)
limit = len(service)
random_service = [random.randint(1, limit) for itr in range(limit)]
print_error(str(random_service))
for pos in random_service:
item = service[pos - 1]
service_item_show(self, item)
def check_websocket_changes(self, mandatory: int, optional: int) -> None:
while len(self.ws_data) > 0:
message = self.ws_data.popleft()

View File

@ -2,7 +2,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #

View File

@ -2,7 +2,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #

View File

@ -2,7 +2,7 @@
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2020 OpenLP Developers #
# Copyright (c) 2008-2021 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #