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

Run playwright tests in CI #10708

Merged
merged 1 commit into from
Feb 12, 2022

Conversation

planger
Copy link
Contributor

@planger planger commented Feb 3, 2022

What it does

  • Add script yarn test:playwright for conveniently running playwright tests in the CI
  • Include invocation of above-mentioned script in build.yml
    • Playwright tests are executed only once in ubuntu-18.04, Node.js v16.x

If you prefer, we could also run the playwright tests in a separate job on every PR / master commit.
Alternatively, we could only run the playwright tests periodically in a separate action.

I tend to prefer running the tests on every PR and master commit (within build.yml) either as part of the build job (as in this PR) or as a separate build job, as this raises breakages immediately when a change either broke expected behavior or broke the page objects. However, I understand that this would potentially add responsibilities to the committers. So alternatively, we could run those tests in a nightly job and we batch-fix the page objects periodically.

Please let me know what you think! Thanks!

How to test

  • To only run playwright tests, run yarn && yarn build && yarn test:playwright
  • Check CI build result of Build / ubuntu-18.04, Node.js v16.x

Review checklist

Reminder for reviewers

@planger planger marked this pull request as draft February 3, 2022 09:37
@planger planger force-pushed the enable-playwright-tests branch from e51e335 to e144d6f Compare February 3, 2022 09:55
@planger planger changed the title Run playwright tests on yarn test Run playwright tests in CI Feb 3, 2022
@planger planger force-pushed the enable-playwright-tests branch 3 times, most recently from ed1bee8 to 074b069 Compare February 3, 2022 11:58
@planger planger marked this pull request as ready for review February 3, 2022 12:20
@planger
Copy link
Contributor Author

planger commented Feb 3, 2022

@vince-fugnitto Thanks again for reviewing #10494!

I'd be very grateful if you could look at this PR too (as you already have the context) and let me know how whether you are fine with the way how the playwright build/verification is integrated.

Thanks!

@vince-fugnitto
Copy link
Member

I tend to prefer running the tests on every PR and master commit (within build.yml) either as part of the build job (as in this PR) or as a separate build job, as this raises breakages immediately when a change either broke expected behavior or broke the page objects. However, I understand that this would potentially add responsibilities to the committers. So alternatively, we could run those tests in a nightly job and we batch-fix the page objects periodically.

@planger @JonasHelming should we make the decision in the next dev meeting? For example, who is expected to maintain these page object and how frequently do we update them (when they break vs before a release).

@vince-fugnitto vince-fugnitto added ci issues related to CI / tests test issues related to unit and api tests labels Feb 3, 2022
@JonasHelming
Copy link
Contributor

@vince-fugnitto : Yes, let's at least point to this discussion in the meeting. I added it to the agenda.
My POV: I would also run them on every PR and also directly maintain them if they break. I expect maintenance to be very very minimal. Only if a core UI element is drastically changes, the mapping in the page object model has to be adapted, which in the current state almost never happens. If it happens, it will be much easier to fix it immediatly, because you know what you changed. In the time period this PR was open, ~70 other PRs were merged without any effect. If we experience an overhead with this, we can still change this process, i.e. extract it into a separate build and do a separate maintainace step. We are happy to observe this, support committers when something breaks and adapt the process if required.

@planger planger force-pushed the enable-playwright-tests branch 6 times, most recently from 6b9a8b4 to 621aa4d Compare February 9, 2022 17:18
@planger
Copy link
Contributor Author

planger commented Feb 9, 2022

As discussed in the dev meeting, we decided to start with running the playwright tests on every PR & master commit and show the results in the list of checks, but don't make them blocking a merge if they happen to fail. This way we can observe their stability over a certain time period and decide later whether we make them a mandatory check or keep them just as information.

Thus, I moved the playwright test run into an own job in a separate workflow .github/workflows/playwright.yml, so the test run shows up as a separate check (see Playwright Tests / ubuntu-18.04, Node.js 16.x). Unfortunately, I can't see how this repo is configured regarding its branch rules due to missing permissions.
Are all checks currently configured to be mandatory? If yes, we will have to disable the Playwright Tests workflow in this list.

Also, I re-triggered the tests a couple of times to check their behavior on this infrastructure with this config and so far they look fine.

Please let me know if that meets the expectation as discussed in the dev meeting! Thanks a lot!

.github/workflows/playwright.yml Outdated Show resolved Hide resolved
.github/workflows/playwright.yml Outdated Show resolved Hide resolved
examples/playwright/configs/playwright.ci.config.ts Outdated Show resolved Hide resolved
examples/playwright/configs/playwright.ci.config.ts Outdated Show resolved Hide resolved
@planger planger force-pushed the enable-playwright-tests branch 3 times, most recently from 9b28cbe to f130c45 Compare February 11, 2022 08:28
@planger
Copy link
Contributor Author

planger commented Feb 11, 2022

Thanks a lot for your review @vince-fugnitto!

Hm, the 3PP License Check fail seems unrelated on a first glance, as we didn't any dependency in this change.
Or am I missing something?

WARN: Command [
  "java",
  "-jar",
  "/home/runner/work/theia/theia/scripts/download/dash-licenses.jar",
  "yarn.lock",
  "-batch",
  "50",
  "-timeout",
  "240",
  "-summary",
  "/home/runner/work/theia/theia/license-check-summary.txt"
] exited with code: 5
INFO: Checking results against the baseline...
X npm/npmjs/-/doctrine/2.1.0, Apache-2.0
ERROR: Found results that aren't part of the baseline!
error Command failed with exit code 1.

@vince-fugnitto
Copy link
Member

@planger I believe there might have been an error on dash-licenses yesterday which resulted in a few deps being marked as false positives. The dependency is approved (twice actually):

I do have the pull-request #10725 which we can merge first if you'd like, it includes an upgrade and adds the approved deps to our baseline (until dash-licenses updates itself).

@planger
Copy link
Contributor Author

planger commented Feb 11, 2022

@vince-fugnitto Ok great, thanks! Sure, let's merge PR #10725 first. I'm happy with the way you think is best. Thanks!

@vince-fugnitto
Copy link
Member

@planger #10725 was merged so if you rebase the CI should be all green :)

eclipse-theia#10337

Change-Id: I4d431777333eb4c516071630379f1e6ed87e1850
@planger planger force-pushed the enable-playwright-tests branch from f130c45 to c6be714 Compare February 11, 2022 17:15
@planger
Copy link
Contributor Author

planger commented Feb 11, 2022

Thanks, rebased and keeping my fingers crossed :)

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@JonasHelming JonasHelming merged commit df55d42 into eclipse-theia:master Feb 12, 2022
@JonasHelming JonasHelming added this to the 1.23.0 milestone Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci issues related to CI / tests test issues related to unit and api tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants