Skip to content
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

Fix ChatFeed / Interface tests and async generator placeholders #6245

Merged
merged 2 commits into from
Jan 20, 2024

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Jan 19, 2024

Ensures that the tests actually run and raises errors by setting callback_exception = "raise" rather than having the errors piped to the chat logs

This resulted in finding a lot of tests failing, but most of them were just tests not written properly (e.g. not using wait_until to assert)

The only bug I found was a result of #6105, where async generator functions execution time was based on placeholder_threshold, i.e. await _schedule_placeholder had to run in completion, before the actual callback started executing.

This was remedied by wrapping _serialize_response (where the iteration of the generator was happening) alongside the actual callback so that when checking task.done(), it checks the execution of both of these.

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c8f4e08) 82.68% compared to head (cbcf154) 84.19%.
Report is 11 commits behind head on main.

Files Patch % Lines
panel/tests/chat/test_feed.py 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6245      +/-   ##
==========================================
+ Coverage   82.68%   84.19%   +1.51%     
==========================================
  Files         301      301              
  Lines       45099    45137      +38     
==========================================
+ Hits        37288    38004     +716     
+ Misses       7811     7133     -678     
Flag Coverage Δ
ui-tests 40.70% <10.44%> (+2.22%) ⬆️
unitexamples-tests 71.87% <97.01%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahuang11
Copy link
Contributor Author

I manually tested this branch on a few examples:

Screen.Recording.2024-01-19.at.11.05.48.AM.mov
Screen.Recording.2024-01-19.at.11.06.34.AM.mov
Screen.Recording.2024-01-19.at.11.08.31.AM.mov

panel/chat/feed.py Outdated Show resolved Hide resolved
panel/chat/feed.py Outdated Show resolved Hide resolved
@philippjfr philippjfr merged commit 8e7992a into main Jan 20, 2024
15 checks passed
@philippjfr philippjfr deleted the fix_chat_issues branch January 20, 2024 22:26
philippjfr pushed a commit that referenced this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants