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

[WIP] Unit Test for dashboard #706

Open
wants to merge 26 commits into
base: development
Choose a base branch
from

Conversation

proy30
Copy link
Contributor

@proy30 proy30 commented Sep 19, 2024

This PR introduces the first unit test for the ImpactX dashboard, leveraging the SeleniumBase library to simulate a simulation run by a user with the GUI.

Key Features

  • The unit test runs a simulation using the parameters from the FODO cell example on the GUI. (takes ~1 minute)
  • The test is considered successful if the simulation is completed without errors.

Issues

  • Dependency on Running Dashboard:
    • The current implementation requires the ImpactX dashboard to run in a separate terminal before executing the test via pytest.
    • Can investigate to potentially have dashboard be launched within the test itself.
    • Unit test is flaky with passing/failing, unsure if this is due to code error or error in pytest implementation. Need to investigate. Started occurring after the implementation of subprocess.
  • Adding seleniumbase as a dependency
    • Unsure where to add. (implemented incorrectly)

Checklist

  • Implement unit test for impactx-dashboard (testing with FODO cell simulation parameters.
  • Automate the dashboard launch within the test.
  • Fix flaky unit test
  • Include seleniumbase dependency in CI test files
  • Include trame dependencies in CI test files
  • Fix headless state for ctest

Resolves #667

proy30 and others added 22 commits August 10, 2024 21:38
Contributes to unit testing by applying a UI component to exit the dialog box and allowing selenium to continue testing the application
Initially these were added to convert user input to the correct type in order to be compatible with simulation. However, upon commenting these out for the sake of unit testing compatibility, it was found that the simulation is still functional with user inputs and does not need any conversion of user values. There is potential for underlying problems that have yet to be found.
Mark the test as skipped if `seleniumbase` is not available.
This indirectly assures user that sim ran successfully.
changed hardcoded 'python' command to 'sys.executable' and also initialized app_process
Adjusted function to retry upon failure until timeout has reached max time.
@ax3l ax3l mentioned this pull request Sep 19, 2024
5 tasks
@proy30 proy30 added the component: dashboard our browser based trame dashboard label Sep 28, 2024
@proy30 proy30 self-assigned this Sep 28, 2024
@EZoni EZoni self-requested a review October 24, 2024 17:11
@cemitch99 cemitch99 self-requested a review October 24, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dashboard our browser based trame dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Missing Unit Testing
2 participants