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

Install plugins via .wp-env.json for e2e testing. #709

Merged
merged 13 commits into from Feb 9, 2021
Merged

Conversation

nicolad
Copy link
Contributor

@nicolad nicolad commented Feb 8, 2021

Related: #689

@nicolad nicolad self-assigned this Feb 8, 2021
@nicolad nicolad added this to In progress in Barista CI/CD Pipeline via automation Feb 8, 2021
@nicolad nicolad force-pushed the e2e-improvements branch 4 times, most recently from 5a9a898 to 914ef21 Compare February 8, 2021 11:54
@@ -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",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as seen here

@nicolad nicolad force-pushed the e2e-improvements branch 8 times, most recently from b384a18 to e69009b Compare February 8, 2021 16:14
.wp-env.json Outdated
@@ -3,7 +3,7 @@
"env": {
"tests": {
"mappings": {
"wp-content/plugins/event-espresso-core": "./build",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

based on uploaded artifact, the build folder is for barista

activatePlugin

@nicolad nicolad force-pushed the e2e-improvements branch 6 times, most recently from daadc40 to 1940f23 Compare February 8, 2021 19:07
@@ -72,12 +73,24 @@ jobs:
- name: Setup Playwright
uses: microsoft/playwright-github-action@v1

- name: Check out event-espresso-core
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
Copy link
Contributor Author

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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 79 to 74
GIT_TRACE: 1
GIT_CURL_VERBOSE: 1
Copy link
Contributor Author

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

@nicolad nicolad force-pushed the e2e-improvements branch 2 times, most recently from 8999e99 to ba305f4 Compare February 9, 2021 13:53
@@ -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
Copy link
Contributor Author

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

Copy link
Member

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 !!?!?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in .wp-env.json we have mappings to corresponding plugin

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

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?

Copy link
Contributor Author

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 🤷‍♂️

Comment on lines +79 to +80
- name: Build event-espresso-core
run: cd event-espresso-core && yarn && yarn build
Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor

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

@nicolad nicolad force-pushed the e2e-improvements branch 2 times, most recently from cd3ee63 to 29a7291 Compare February 9, 2021 16:14
it('should work', async () => {
await loginUser();

await activatePlugin('event-espresso');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

locally and on CI, the core plugin has this slug

image

@nicolad nicolad marked this pull request as ready for review February 9, 2021 16:28
@nicolad nicolad moved this from In progress to Code Review in Barista CI/CD Pipeline Feb 9, 2021
tn3rb
tn3rb previously approved these changes Feb 9, 2021
Copy link
Member

@tn3rb tn3rb left a 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
Copy link
Member

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 !!?!?!

Comment on lines +79 to +80
- name: Build event-espresso-core
run: cd event-espresso-core && yarn && yarn build
Copy link
Member

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' );
Copy link
Member

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

Copy link
Contributor Author

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);
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, there were no assertions while debugging and I've added an expect just to please jest

Screenshot from 2021-02-09 18-59-15

@nicolad nicolad merged commit eea25bd into master Feb 9, 2021
Barista CI/CD Pipeline automation moved this from Code Review to Done Feb 9, 2021
@nicolad nicolad deleted the e2e-improvements branch February 9, 2021 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants