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

How to test Panel data apps #4244

Merged
merged 26 commits into from Jan 9, 2023
Merged

How to test Panel data apps #4244

merged 26 commits into from Jan 9, 2023

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Dec 29, 2022

@MarcSkovMadsen MarcSkovMadsen changed the title Docs on testing Panel data apps How to test Panel data apps Dec 29, 2022
@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Dec 29, 2022

Assets

Some assets used in the docs that should later be uploaded to a cdn.

app.mp4

app.mp4

app.gif

app (1)

uitest.mp4

uitest.mp4

uitest.gif

uitest

panel-playwright-recording.mp4

panel-playwright-recording.mp4

panel-playwright-recording.gif

panel-playwright-recording (1)

panel-locust.mp4

panel-locust.mp4

panel-locust.gif

panel-locust

loadwright.mp4

loadwright.mp4

loadwright.gif

loadwright

@MarcSkovMadsen MarcSkovMadsen marked this pull request as ready for review January 1, 2023 15:21
@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Jan 1, 2023

Hi @philippjfr

Please make a first draft review. I need some feedback on the overall outline and content. As a minimum I would appreciate feedback on:

  • Is it ok to have all this content in one "how to" guide? If not how should it be split?
  • Whether the code in this how to should somehow be automatically tested to avoid regressions later on?
  • What should I do additionally to bring it to a state where is should be possible to get it approved?

@philippjfr
Copy link
Member

philippjfr commented Jan 1, 2023

My initial reaction is that this is indeed a lot of content for a single guide. I'd suggest splitting it into at least two guides:

  • Testing Panel UIs with Playwright
  • Load testing with Locust

doc/how_to/test/test.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 1, 2023

Codecov Report

Merging #4244 (9d4a950) into main (805ddd5) will decrease coverage by 0.34%.
The diff coverage is 80.48%.

@@            Coverage Diff             @@
##             main    #4244      +/-   ##
==========================================
- Coverage   83.05%   82.71%   -0.35%     
==========================================
  Files         237      237              
  Lines       34252    34285      +33     
==========================================
- Hits        28449    28358      -91     
- Misses       5803     5927     +124     
Flag Coverage Δ
ui-tests 37.98% <50.40%> (+0.03%) ⬆️
unitexamples-tests 73.87% <80.48%> (-0.35%) ⬇️

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

Impacted Files Coverage Δ
panel/tests/test_docs.py 35.00% <0.00%> (ø)
panel/tests/ui/io/test_convert.py 95.68% <ø> (ø)
panel/tests/pane/test_echart.py 33.33% <33.33%> (-4.60%) ⬇️
panel/tests/template/test_vanilla_manual.py 15.21% <50.00%> (-71.74%) ⬇️
panel/tests/pane/test_alert.py 65.62% <66.66%> (-28.13%) ⬇️
...nel/tests/template/fast/test_fast_list_template.py 79.31% <66.66%> (-13.80%) ⬇️
panel/tests/widgets/test_text_to_speech.py 77.50% <66.66%> (-15.00%) ⬇️
panel/io/state.py 70.63% <70.83%> (+0.22%) ⬆️
...nel/tests/template/fast/test_fast_grid_template.py 52.72% <75.00%> (-43.57%) ⬇️
panel/tests/widgets/test_speech_to_text.py 62.88% <75.00%> (-27.84%) ⬇️
... and 25 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documenting how to test Panel apps is a great addition!

However, I would recommend splitting this into different how-tos. I believe most users should only be concerned with simple unit tests with Pytest. In its current form the how-to can lead users into an overly complicated path, specially beginners and non developers.

doc/how_to/test/test.md Outdated Show resolved Hide resolved
doc/how_to/test/test.md Outdated Show resolved Hide resolved

According to [locust-plugins](https://github.com/SvenskaSpel/locust-plugins) it should also be possible to possible to combine Locust and Playwright to test more advanced interactions. Unfortunately it does not work for me on Windows. You can check out the issue with code [here](https://github.com/SvenskaSpel/locust-plugins/issues/101#issuecomment-1367216919).

### Test advanced interactions with Loadwright
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this too alpha to be documented?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

There is no other way currently. And I also need it for other the next how to guides I plan to write on "performance optimization" and "dask". Loadwright is the only thing that can provide insights into the improved performance.

Real Load Testing of Panel data apps has really, really been missing. This is why the Bokeh/ Panel server still has performance issues. We have not been able to get insights and provide reproducible examples. This makes it possible. I've specifically pinned the version here. And its not more alpha than any new example or code contributed to Panel.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm saying alpha as this is the disclaimer on the project's README.

Please note this project is at a very early stage an the api and functionality will change!

I would personally be hesitating when advised to depend on a project that states this, as it feels like it's still being built and that I'll have to change a lot of my code in the future.

doc/how_to/test/test.md Outdated Show resolved Hide resolved
doc/how_to/test/test.md Outdated Show resolved Hide resolved
doc/how_to/test/test.md Outdated Show resolved Hide resolved
doc/how_to/test/test.md Outdated Show resolved Hide resolved
doc/how_to/test/test.md Outdated Show resolved Hide resolved
@MarcSkovMadsen
Copy link
Collaborator Author

Thanks for all the good comments. I've refactored. Please make a second review. Thanks.

@philippjfr
Copy link
Member

Thanks for your fixes. I've made a number of edits. One thing that would be nice is if you could re-record some of the gifs with a larger font size. You can do that any time and I'll upload the new versions.

@MarcSkovMadsen
Copy link
Collaborator Author

@philippjfr . The link https://assets.holoviz.org/panel/gifs/loadwright.gif used in the docs does not exist. Could you please upload the file? Thanks.

@philippjfr
Copy link
Member

Done

@MarcSkovMadsen
Copy link
Collaborator Author

I've increased the fontsize of the uitest.gif and loadwright.gif files above. Please take a look and upload them if they are ok @philippjfr . Thanks.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Jan 6, 2023

I've tested the how to guides manually twice and fixed any errors identified. I don't plan to do more unless told what to do :-)

@MarcSkovMadsen MarcSkovMadsen added this to the next milestone Jan 8, 2023
@philippjfr philippjfr merged commit cff7c4d into main Jan 9, 2023
@philippjfr philippjfr deleted the feature/document-test branch January 9, 2023 15:40
@philippjfr philippjfr modified the milestones: next, v0.14.3 Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document how to test panel
3 participants