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

PREOPS-5286: Add Playwright end-to-end tests #95

Merged
merged 36 commits into from
Jul 29, 2024
Merged

Conversation

alserene
Copy link
Collaborator

@alserene alserene commented Jul 4, 2024

Created Playwright end-to-end tests for different operational modes. Documentation for installation, execution, and debugging is in playwright_testing.rst.

Tests are disabled by default to minimise workflow runtime and prevent artifact failures due to server load variations. To run tests manually, set ENABLE_PLAYWRIGHT_TESTS=1.

@alserene
Copy link
Collaborator Author

alserene commented Jul 4, 2024

@ehneilsen I'm not too sure how to fix the workflow errors ModuleNotFoundError: No module named 'playwright'. Any ideas?

I added

- name: Install playwright browsers
        run: |
          pip install playwright
          python -m playwright install --with-deps

to test_and_build.yaml and I also added playwright to test-requirements.txt.
Playwright is now showing up in the Conda list, but, still, the error appears.

I'm not super familiar with GitHub workflows so this could be a trivial solve.

One fix (which doesn't solve this problem, only works around it) is to add conditional statements to the Playwright import statement (see 7c29363).

@alserene
Copy link
Collaborator Author

alserene commented Jul 4, 2024

@ehneilsen There is also this error. I want to check with you if this code correction should be made here since this file was not modified in this PR.

schedview/app/scheduler_dashboard/scheduler_dashboard.py:273:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
    |
[27](https://github.com/lsst/schedview/actions/runs/9788750126/job/27027344464?pr=95#step:3:29)2 |         # Current fix for _conditions.mjd having different datatypes.
273 |         if type(self._conditions._mjd) == np.ndarray:
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
274 |             self._conditions._mjd = self._conditions._mjd[0]

@ehneilsen
Copy link
Collaborator

@ehneilsen There is also this error. I want to check with you if this code correction should be made here since this file was not modified in this PR.

schedview/app/scheduler_dashboard/scheduler_dashboard.py:273:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
    |
[27](https://github.com/lsst/schedview/actions/runs/9788750126/job/27027344464?pr=95#step:3:29)2 |         # Current fix for _conditions.mjd having different datatypes.
273 |         if type(self._conditions._mjd) == np.ndarray:
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E721
274 |             self._conditions._mjd = self._conditions._mjd[0]

Fixing this to use is instead of == would be fine.

@ehneilsen
Copy link
Collaborator

@ehneilsen I'm not too sure how to fix the workflow errors ModuleNotFoundError: No module named 'playwright'. Any ideas?

It looks like you figured this out? I see that the playwright tests are being run in the github CI, and that they are making it some way into the tests (with several asserts being passed successfully) before failing here.

@alserene alserene force-pushed the tickets/PREOPS-5286 branch from 2857762 to 5116422 Compare July 23, 2024 06:28
Copy link
Collaborator

@ehneilsen ehneilsen left a comment

Choose a reason for hiding this comment

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

Looks good.

@alserene alserene merged commit 0faf5bc into main Jul 29, 2024
7 checks passed
@alserene alserene deleted the tickets/PREOPS-5286 branch July 29, 2024 22:43
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.

2 participants