-
Notifications
You must be signed in to change notification settings - Fork 64
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: Playwright with shared repo, compared with master #236
base: master
Are you sure you want to change the base?
Conversation
…t-plugin-todo into feat/adding-playwright-e2e
…suresh-git/mattermost-plugin-todo into feat/adding-playwright-e2e
…t-plugin-todo into feat/adding-playwright-e2e
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #236 +/- ##
======================================
Coverage 6.42% 6.42%
======================================
Files 11 11
Lines 1712 1712
======================================
Hits 110 110
Misses 1594 1594
Partials 8 8 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is amazing work 🚀 Thank you @mickmister, and an even bigger thanks to @rahulsuresh-git!
Does it make sense to re-use the actions from https://github.com/mattermost/actions? That could help keeping the code DRY.
.github/workflows/playwright.yml
Outdated
- master | ||
tags: | ||
- "v*" | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
TERM: xterm | ||
GO_VERSION: 1.19.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of CI uses go1.21. (mattermost/actions#13) Should the same version be used here?
.github/workflows/playwright.yml
Outdated
# cache: "npm" | ||
# cache-dependency-path: webapp/package-lock.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed any longer? Having a cache would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM, I just saw #233.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we were having issues with this block, where the package-lock.json
file itself was being cached, so if you pushed a commit that changed that file, CI didn't end up using the new file
.github/workflows/playwright.yml
Outdated
# - name: ci/checkout-mattermost-monorepo | ||
# uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
# with: | ||
# path: ../mattermost | ||
# repository: mattermost/mattermost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
[submodule "e2e/playwright/mattermost-plugin-e2e-test-utils"] | ||
path = e2e/playwright/mattermost-plugin-e2e-test-utils | ||
url = https://github.com/mattermosttest/mattermost-plugin-e2e-test-utils.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love seeing a submodule getting used here. It adds a lot of complexity. Are there simpler approaches that you considered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hanzei Yes the other two options I've considered is referencing through npm, and just duplicating the code. I definitely don't want to go down the route of duplicating the code. Publishing to npm or referencing as a git-based node dependency is probably what we will end up doing.
The submodule approach was the quickest way that required no hassling with npm. Even if I didn't end up running into an issue with npm, I didn't want that to get in the way when trying this out. A git-based npm dependency wouldn't be much different as far as "use this commit", but I agree the submodule is not as turnkey as referencing a git-based dependency
[submodule "e2e/playwright/mattermost-plugin-e2e-test-utils"] | ||
path = e2e/playwright/mattermost-plugin-e2e-test-utils | ||
url = https://github.com/mattermosttest/mattermost-plugin-e2e-test-utils.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the repo be under the Mattermost org? mattermosttest
is only used for GitHub API testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hanzei Yes this was just the easiest way for me to have it somewhere other than my personal account. Since it is specifically related to Mattermost, and I was directly referencing it in a Mattermost project as a dependency, I sided to put it there for now. It's mainly a proof of concept to test out sharing code, and figuring out exactly which code should be shared etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something we can generalize from this file and move into https://github.com/mattermost/actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I want to "get it right" first though. I don't think we should merge two PRs from two different repos before moving this to the actions repo
.nvmrc
Outdated
@@ -1 +1 @@ | |||
16.13.1 | |||
16.20.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Missing end of line
I shall be addressing the comments in the coming days. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mickmister! Overall looks good to me. Left few non-blocking comments.
I'll ask for @mvitale1989 review for his inputs.
.github/workflows/playwright.yml
Outdated
- 10080:10080 | ||
- 10110:10110 | ||
- 10025:10025 | ||
elasticsearch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do minio and elasticsearch to be used during testing? If not, maybe these can be removed?
.github/workflows/playwright.yml
Outdated
|
||
ports: | ||
- 8065:8065 | ||
- 4000:4000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does port 4000 needs to be exposed?
.github/workflows/playwright.yml
Outdated
- name: ci/checkout-mattermost-monorepo | ||
run: | | ||
git clone https://github.com/mattermost/mattermost.git ../mattermost | ||
|
||
- name: ci/setup-node-for-mattermost-monorepo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe drop monorepo in name? Same in other instances.
@saturninoabril Note that much of the code being used here is in a separate repo mattermost-community/mattermost-plugin-e2e-test-utils#1, currently being referenced through git submodule |
Apologies for the late review, I have little experience with git submodules but have no objection in trying out the approach. I see it working fine among the PR status checks. |
Summary
This PR is built off of Playwright PR #228, and is pointing to master. This PR uses a submodule defined at mattermost-community/mattermost-plugin-e2e-test-utils#1 to centralize the Playwright bootstrapping code.
PR comparing to open Playwright PR #235
Ticket Link