Skip to content

[mock_uss] Isolate Flask server #1218

@BenjaminPelletier

Description

@BenjaminPelletier

Is your feature request related to a problem? Please describe.
Currently, it is difficult to use portions of mock_uss outside the context of an actual webapp instance because the Flask server is built into multiple package __init__s. It would be very useful to be able to confidently access mock_uss behaviors in other contexts. For instance, large tracer log collections can cause KML generation to take 10+ minutes, so it is often necessary to perform this generation offline/after the fact. However, it is hard to add a robust tool to the repository to do this because the KML generation tools are intertwined with the Flask server.

Describe the solution you'd like
Only cause instantiation of the Flask server when a specific leaf package (e.g., monitoring.mock_uss.app) is accessed, rather than causing Flask server instantiation when simply accessing the base monitoring.mock_uss package.

Describe alternatives you've considered
All mock_uss capabilities not directly supporting the Flask server could be moved outside of the mock_uss package, but that doesn't seem ideal since many things mock_uss does could be "mocked out" in isolation separate from the Flask server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priorityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions