Commit Graph

9 Commits

Author SHA1 Message Date
Fabio Manganiello 1e45aa5de9
A more robust logic to wait for the app to start in the tests.
continuous-integration/drone/push Build is passing Details
2024-01-04 23:24:25 +01:00
Fabio Manganiello 1819ee75ef
`s/Application.stop_app/Application.stop/g` 2023-08-13 22:23:15 +02:00
Fabio Manganiello 91cd08cdff
Adapted tests to use a locally started Redis instance. 2023-07-24 10:37:07 +02:00
Fabio Manganiello 37dcaba7a1
Refactored structure of main application and startup scripts.
The main application class has been moved from __init__ to the app
module.

__init__ will contain instead the relevant global variables and the
modules and objects exposed to external integrations - such as
`get_plugin` and `get_backend`, or the `main` itself.

This will make future integrations much easier - the global __init__
doesn't contain any business logic now, it can import anything without
fearing circular dependencies, and it can limit its exposed objects to
those that we want to expose to 3rd-party integrations and scripts.

It will also make it easier to extend the main entry point with
additional logic - such as a supervisor or an embedded Redis server.
2023-07-23 23:12:36 +02:00
Fabio Manganiello 666ea9ea6b
Added `use_werkzeug_server` option to `backend.http`.
There are situations where you may not want to run the HTTP server in a
full blown WSGI-over-Tornado container - unit/integration tests and
embedded single-core devices are among those cases.

In those scenarios, we should allow the user to be able to run the
backend using the built-in Werkzeug server provided by Flask.
2023-05-20 15:26:58 +02:00
Fabio Manganiello 34a108bbcb Clear log objects on teardown to prevent pytest logging errors 2021-03-06 20:02:25 +01:00
Fabio Manganiello 090e7d6de8 Support for specifying the application Redis queue from the command line or service constructor 2021-03-06 19:22:13 +01:00
Fabio Manganiello 6f85318868 Use another Redis queue for the test app to prevent clashes with another Platypush service running on the same machine 2021-03-06 17:17:55 +01:00
Fabio Manganiello 49ad3261f1 Refactored tests to use pytest with fixtures instead of unittest.TestCase 2021-03-06 16:21:28 +01:00