-
Notifications
You must be signed in to change notification settings - Fork 0
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
Playwright Initial Setup #3
base: main
Are you sure you want to change the base?
Conversation
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.
Awesome work Lucas! 🚀
I have some comments for discussion, including one about putting some example tests in this repo to see this in action! Can't wait to use this awesome functionality 😄
Thanks for your comments @mickmister In the last few commits, I externalized the PluginConfig, added the external plugin configuration, and added the example-test folder to have tests in it. After reading all of your comments, I think my plan of action will be:
I'm thinking that maybe the
And the
Is this a good plan? What do you think? cc: @mickmister @jespino Thank you! |
@panoramix360 For eslint, this file from the GitHub plugin is probably good minus the React stuff https://github.com/mattermost/mattermost-plugin-github/blob/master/webapp/.eslintrc.json. I personally don't recommend adding prettier, mainly because eslint has been made standard in our projects with no use of prettier. eslint does everything we have deemed that we need in terms of formatting, even if eslint's primary use case is not for formatting.
This all sounds good 👍
For the terminology here, this makes me think that we are running the plugin in a separate docker container, which is obv not what's happening. Would the developer still have access to the main |
Thanks for confirming it, I think it's easier to work with a path clearer forward 😄
Ok, no Prettier then! I noticed that when I worked on the
I agree with that approach, I'll align my code to that. I just was going to use mostly of the structure the code that was already in place regarding the But I agree that maybe it's better for the dev to interact just with the MattermostContainer itself and get an instance of the plugin and interact with it how it sees fit. This week I'm trying to organize the code and follow the approaches that we discussed, thanks for the insights! |
…n about the `playwright.config.ts` plus fixing some lint errors
Added the ESLInt configuration! I'll continue with the other implementations. |
done! can you take a look at the new structure? I think it solves a lot of scaling problems within the code, and separates well the MattermostPlugin vs MattermostContainer I liked the new structure, probably we will have some things to still adjust and enhance regarding other topics, but as a base, I think this is beginning to be more solid. The tests are passing already. What more tests do you think we could create inside the demo-plugin? Please share your thoughts so I can improve this if needed. |
@DHaussermann Can you please provide some guidance on where we can find the documented test cases for the demo plugin? @panoramix360 We can pick 1 or 2 of the simplest cases to implement here
Yep it's a configurable setting for the eslint plugin https://www.digitalocean.com/community/tutorials/workflow-auto-eslinting I typically type |
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.
Hi @panoramix360, this is looking great! 🚀
I have a few more comments on the PR. Let me know what you think 😄
Thanks so much @panoramix360!
src/index.ts
Outdated
import fetch from 'node-fetch'; | ||
global.fetch = fetch; |
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 we can do something like this to make sure we only do this when we need to. Some versions of node already have this, and if the developer wants to use that version of fetch
, then we shouldn't overwrite that version
import fetch from 'node-fetch'; | |
global.fetch = fetch; | |
import fetch from 'node-fetch'; | |
if (typeof fetch === 'undefined') { | |
global.fetch = fetch; | |
} |
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.
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.
@mickmister any thoughts?
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 try this:
if (typeof fetch === 'undefined') {
(global as any).fetch = fetch;
}
@panoramix360 Maybe we can run one of the |
FYI there is some existing code in the GitHub plugin's e2e tests that works with interactive dialogs that we can share here |
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.
This looking awesome @panoramix360!!
I'll leave to you to decide if we need to implement the demo plugin tests. Maybe we can at least verify that the /dialog
slash command exists in the command autocomplete to show that the demo plugin was correctly installed.
One thing I want to be sure of before merging (or maybe after this PR) is that this is usable from external repos. Do you mind trying to import this code from a repo like demo plugin or GitHub plugin e2e tests? You and I agreed that we can keep this as Typescript and do not need to compile it, but maybe we should via a postinstall
script in this repo. I'd like to importing with its current state first and see if we run into any issues. We would install the npm dependency as a git-based dependency right now since we don't have this published on npm.
Great work Lucas!!
hey @mickmister! thanks for the feedback! I worked on some minor details and now it's just missing the Thank you! |
I added a test example after some effort, I ran into some problems but already solved talking through the community, thank you for that You can already review the latest changes. I'll work on running this on the CI now, let's see if it's easy enough. |
hey @mickmister The CI is configured and passing already, really happy with it. It's taking shape! Do you think it's good to merge? |
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 think this is good to go. Let's ask @jespino for another review then I think we can merge 👍 🚀
@@ -3,7 +3,8 @@ on: | |||
push: | |||
branches: [ main, master ] | |||
pull_request: | |||
branches: [ main, master ] | |||
workflow_dispatch: |
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 wonder if it makes sense to have this workflow be in a centralized GH action for other plugin projects to use. The one thing is that the way we set up our shared actions, the caller cannot pass any arbitrary environment variables. I think that works fine since pretty much all configuration is done in the actual test now due to using testcontainers
🎉 🎉
Made a ticket for creating a centralized action/workflow to run playwright tests #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.
That makes sense! let's work on that in the new ticket!
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.
Keeping this conversation unresolved to surface the discussion
src/index.ts
Outdated
import fetch from 'node-fetch'; | ||
global.fetch = fetch; |
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 try this:
if (typeof fetch === 'undefined') {
(global as any).fetch = fetch;
}
This PR introduces some initial configurations to use this project as a utility for other Plugins in the Mattermost Space.
It adds:
As an initial configuration this is already being used by me on another branch inside the
mattermost-plugin-todo
to create an initial test.