-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 'Runtime not created' issue for custom components executed without Streamlit #8610
Fix 'Runtime not created' issue for custom components executed without Streamlit #8610
Conversation
5436157
to
948676b
Compare
291a87e
to
dfb54a4
Compare
|
||
def _select_component(app: Page, component: str): | ||
selectbox_input = app.get_by_test_id("stSelectbox").locator("input") | ||
|
||
# Type an option (defined in the test app): | ||
selectbox_input.type(component) | ||
selectbox_input.press("Enter") | ||
wait_for_app_run(app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this wait as without it the exception we are looking for was usually not detected :/
## Describe your changes The `Makefile` step for the e2e_playwright custom component step was broken since #8437 and is fixed here. Also, the popular_custom_components test did not wait for an app run, which means that an exception triggered by using a custom component would not have been caught properly. Extracts these fixes from the PR #8610 ## GitHub Issue Link (if applicable) ## Testing Plan - fixes an existing e2e test --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
ab7e133
to
4eb4672
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's good in this case to create a dedicated PR with only the changes from this file, which makes it super easy to cherry-pick. And do a fast-follow PR with a testing setup for this situation because it might take another discussion on how best to test this scenario
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, I have opened a dedicated PR here: #8620
## Describe your changes Closes #8606 The PR allows custom component modules to be executed standalone by not registering them with Streamlit at all, which makes sense since Streamlit is not started. It's a cherry-pick of this broader PR #8610, which also adds tests. However, we want to discuss our testing strategy first, so we decouple it from adding the fix (see for example also this PR #8616). ## GitHub Issue Link (if applicable) - #8606 - NathanChen198/streamlit-rsa-auth-ui#1 - randyzwitch/streamlit-folium#186 ## Testing Plan - E2E Tests: tests to ensure this behavior will come in a separate PR, see #8616 and #8610 --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Update: we have split the PR into a couple of minor PRs to fix the Makefile, tests (#8617) and the actual fix itself (#8620). The PR #8616 migrated our bare-run test to run against the playwright tests, which would have caught the issue. Hence, we won't add the very specific tests in this PR for now and rather rely on the existing-and-now-migrated bare-execution test. |
Describe your changes
Closes #8606
The PR allows custom component modules to be executed standalone by not registering them with Streamlit at all, which makes sense since Streamlit is not started.
Also, adds tests to the
e2e_playwright/custom-components
suite to ensure this behavior for the future.Playwright Test Output With the Fix
Playwright Test Output Without the Fix
GitHub Issue Link
Testing Plan
e2e_playwright/custom-components
suite by adding tests that were reported in the issueContribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.