-
Notifications
You must be signed in to change notification settings - Fork 65
Integration test for Sycamore Query demo. #985
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
Conversation
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.
Thanks for this! Couple of nits and suggestions.
"--exec-mode", type=str, choices=["ray", "local"], default="ray", help="Configure Sycamore execution mode." | ||
) | ||
argparser.add_argument("--chat", action="store_true", help="Only show the chat demo pane.") | ||
argparser.add_argument("--test", action="store_true", help="Only run the integration test.") |
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.
Do you need both chat
and test
if both are never used together? Why not a mode
argument that is either chat
or test
?
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.
Well, for now --test is kind of a whole different mode of execution of the entire script, which will subsume a bunch of the other arguments anyway. Maybe the specific test for not using --chat does not make sense in that light.
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.
Yes, it would help clarify this architecture better as well. I didn't realize that they encompass overlapping things while reading this script.
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.
LGTM!
"--exec-mode", type=str, choices=["ray", "local"], default="ray", help="Configure Sycamore execution mode." | ||
) | ||
argparser.add_argument("--chat", action="store_true", help="Only show the chat demo pane.") | ||
argparser.add_argument("--test", action="store_true", help="Only run the integration test.") |
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.
Yes, it would help clarify this architecture better as well. I didn't realize that they encompass overlapping things while reading this script.
This PR uses the Streamlit app testing library (which is incredibly handy) to provide an integration test for the Luna demo.
This is needed because we often find that small changes to Luna or the UI code can break the demo. I need a way to run an integration test when the demo is deployed, and this is it.
The intention is not to run this test as part of CI, since it needs a specifically-configured OpenSearch index. Instead, it will be run as part of the demo deployment process.
The Streamlit AppTest class lets us run a "headless" Streamlit app, interact with it programmatically, and access its state, including all of the UI elements. To make writing test cases easier, I've implemented a few helper functions to walk the UI tree and test specific conditions on it.
I realize that understanding this test code is going to be difficult if you don't know the ins and outs of the Luna demo code itself, but I'm not expecting reviewers to have that background. I'd appreciate your looking for any glaring mistakes or stylistic suggestions. Thanks!