Merge pull request #165 from yedpodtrzitko/yed/ci-run

ci: try to run the app
This commit is contained in:
Travis Abendshien
2024-05-13 14:31:46 -07:00
committed by GitHub
5 changed files with 65 additions and 2 deletions

View File

@@ -191,6 +191,9 @@ class QtDriver(QObject):
)
max_threads = os.cpu_count()
if args.ci:
# spawn only single worker in CI environment
max_threads = 1
for i in range(max_threads):
# thread = threading.Thread(target=self.consumer, name=f'ThumbRenderer_{i}',args=(), daemon=True)
# thread.start()
@@ -234,6 +237,7 @@ class QtDriver(QObject):
# Handle OS signals
self.setup_signals()
# allow to process input from console, eg. SIGTERM
timer = QTimer()
timer.start(500)
timer.timeout.connect(lambda: None)
@@ -524,7 +528,11 @@ class QtDriver(QObject):
)
self.open_library(lib)
app.exec_()
if self.args.ci:
# gracefully terminate the app in CI environment
self.thumb_job_queue.put((self.SIGTERM.emit, []))
app.exec()
self.shutdown()

View File

@@ -45,6 +45,11 @@ def main():
type=str,
help="User interface option for TagStudio. Options: qt, cli (Default: qt)",
)
parser.add_argument(
"--ci",
action=argparse.BooleanOptionalAction,
help="Exit the application after checking it starts without any problem. Meant for CI check.",
)
args = parser.parse_args()
core = TagStudioCore() # The TagStudio Core instance. UI agnostic.