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
Install plugins via .wp-env.json for e2e testing. #709
Conversation
5a9a898
to
914ef21
Compare
@@ -163,7 +164,7 @@ | |||
"mini-css-extract-plugin": "1.3.4", | |||
"npm-check": "^5.9.2", | |||
"optimize-css-assets-webpack-plugin": "5.0.4", | |||
"playwright": "^1.8.0", | |||
"playwright": "^1.7.0", |
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.
as seen here
b384a18
to
e69009b
Compare
.wp-env.json
Outdated
@@ -3,7 +3,7 @@ | |||
"env": { | |||
"tests": { | |||
"mappings": { | |||
"wp-content/plugins/event-espresso-core": "./build", |
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.
daadc40
to
1940f23
Compare
.github/workflows/pr-checks.yml
Outdated
@@ -72,12 +73,24 @@ jobs: | |||
- name: Setup Playwright | |||
uses: microsoft/playwright-github-action@v1 | |||
|
|||
- name: Check out event-espresso-core | |||
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 |
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.
tried as suggested here: actions/checkout#417 (comment)
.gitignore
Outdated
@@ -72,3 +72,5 @@ typings/ | |||
|
|||
# SB-related | |||
storybook-static | |||
|
|||
event-espresso-core |
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.
tried this: actions/checkout#424 (comment)
.github/workflows/pr-checks.yml
Outdated
GIT_TRACE: 1 | ||
GIT_CURL_VERBOSE: 1 |
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.
to make it more verbose
8999e99
to
ba305f4
Compare
ba305f4
to
f835264
Compare
@@ -66,6 +67,18 @@ jobs: | |||
- name: Make sure PlayWright doesn't play it wrong | |||
run: yarn add -WD playwright | |||
|
|||
- name: Check out event-espresso-core |
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 errors I had before was related to the order of this step, it needs to be before WP install
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.
really? that... doesn't make any sense...
if WP isn't installed then there's no /wp-content/plugins/
folder to put the EE plugin into !!?!?!
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.
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.
my point was that how do you install EE (a WP plugin) before WP is installed?
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 tried to add the EE after WP installation, but was getting a lot of permission issues, so tried this way and it was working;
I am not aware of wordress/env
internals and can't tell how this is installed internally into that docker container, my guess would be that they feed somehow the mappings after the install process automagically 🤷♂️
- name: Build event-espresso-core | ||
run: cd event-espresso-core && yarn && yarn build |
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.
not entirely happy with this approach, but I was getting the error that there is no manifest file
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.
if GitHub ever adds composite actions then we'll need to build one that handles all of the WP && EE core setup.
@manzoorwanijk can we cache things at any point during a workflow and reuse in another step?
would be great if we could cache the initial WP && EE Core setup.
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, we can. But it's better to wait for composite actions
cd3ee63
to
29a7291
Compare
it('should work', async () => { | ||
await loginUser(); | ||
|
||
await activatePlugin('event-espresso'); |
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.
COOL 😎
other than some missing newlines at the end of some PHP files, everything looks great to me!
@@ -66,6 +67,18 @@ jobs: | |||
- name: Make sure PlayWright doesn't play it wrong | |||
run: yarn add -WD playwright | |||
|
|||
- name: Check out event-espresso-core |
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.
really? that... doesn't make any sense...
if WP isn't installed then there's no /wp-content/plugins/
folder to put the EE plugin into !!?!?!
- name: Build event-espresso-core | ||
run: cd event-espresso-core && yarn && yarn build |
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.
if GitHub ever adds composite actions then we'll need to build one that handles all of the WP && EE core setup.
@manzoorwanijk can we cache things at any point during a workflow and reuse in another step?
would be great if we could cache the initial WP && EE Core setup.
wp_add_inline_style( 'wp-components', $custom_css ); | ||
} | ||
|
||
add_action( 'admin_enqueue_scripts', 'enqueue_disable_animations_stylesheet' ); |
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.
ooo i didn't know you were a php dev too?!?!?
looks like you need newlines at the end of these php files though
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.
no, just borrowed this from GB,
added newline
|
||
await activatePlugin('event-espresso'); | ||
|
||
expect(true).toBe(true); |
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.
🤔
verifying that the booleans haven't been redefined?
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.
65f6e0d
to
a6dacd5
Compare
a6dacd5
to
a6ec6c9
Compare
Related: #689