-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "live test" to template CI #75
Comments
I've been trying to flesh out an implementation for this. Unlike the app template repos that contain Briefcase projects already, CI must generate the Briefcase projects for this repo to actually test it. Given this, I'm trying to figure out the best way to inject one of the methods you've mentioned to stop the app once it starts running with To do with while still rolling out this template, I'm imagining a new conditional flag in the input dict for cookiecutter that will include a bit of code to stop the app once it has successfully started. Additionally, this means that the I think this seems less than ideal to me, though....am I missing something perhaps? |
You're not missing anything; I might have been a little enthusiastic flagging this as "good first issue". I'm not wild about adding an However, I do have another idea (or, at least, the start of an idea). The requirements for this are actually pretty close to the requirements for beeware/briefcase#1288. In that case, what we have is a need for a "base Toga template, but with different app content". In the Positron case, we need the body logic for a "launch a web server and a web view" app. In the testing case we need "hit exit after 2 seconds" body logic. However, both are examples of "inject body logic into an existing app template". So - Toga would provide a "vanilla" and "positron" option; we could provide a Pyside/PPB/PyGame plugin (with the hope those communities would eventually take ownership of their respective plugins), and Briefcase would provide an "app test" plugin. We'd only install the Briefcase app test plugin for our own testing purposes; we probably wouldn't even publish it to PyPI. Any other GUI toolkit that wanted to plug into Briefcase could provide its own plugin. Does that approach make any sense to you? |
I think it makes sense....but want to make sure I understand the scope of the solution you're imagining. Right now, the list of "GUI toolkits" to choose from while running These packages would effectively be responsible for defining a template to roll out as the app project directory (and effectively supplanting this repo entirely); a simple implementation would be to just expose a URL briefcase could use to pass to cookiecutter. Going further, I suppose, Briefcase could even leverage such a plugin package to control the template for the Create command. Am I on track with what you're imagining? I haven't done much with entry points so I'm curious to experiment with them. A cursory review of their docs certainly suggests this was an intended use-case in their design and a widely-used strategy for plugin support. |
Details notwithstanding - yes. Exactly where the line is between "cookiecutter template" and "content we can inject into that template" isn't entirely clear to me at this point in the design process; but broadly speaking, I think we're on the same page.
Yeah - we're already using entry points internally to Briefcase - each platform and backend is an entry point. Nobody has taken us up on the offer yet, but at least in theory, you could define an entirely different platform for Briefcase without our involvement. It's a really powerful mechansim, and the implementaiton is disturbingly straightforward from a developer's point of view. |
Yeah... might have misjudged that one a bit... 🤣 |
What is the problem or limitation you are having?
The CI configuration for the briefcase template currently validates the
create
andbuild
commands, but doesn't do any validation that the app actually runs. It's possible to successfully create an app, but be unable to run that app.Describe the solution you'd like
As a final step in CI, we should actually run the app.
This will require modifying the test apps so that they will stop (or that logging will stop streaming). Adding a background task that sleeps a second, then calls app.exit() (or equivalent) and outputs a logging sentinel (the same format used for test termination) should be sufficient.
Describe alternatives you've considered
We could just run the app in
--test
mode; however, that will require rebuilding the app in test mode, which will take a while.Additional context
No response
The text was updated successfully, but these errors were encountered: