-
Notifications
You must be signed in to change notification settings - Fork 14
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
Dev-Anleitung #1209
Merged
Merged
Dev-Anleitung #1209
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
6f6cdb3
Initial version of wp-env file
datengraben 1fb7707
added instructions for translation updates
hansmorb b88b553
Update Readme.md
datengraben 1490013
Update Readme.md
datengraben 9264bdf
Update Readme.md
hansmorb 0356624
Add link to readme
datengraben a2d53a1
Adds useful plugins
datengraben 5849d12
Merge branch 'master' into ft-wp-env
hansmorb 1370b0e
updated composer packages
hansmorb 919bb17
Merge branch 'master' into ft-wp-env
hansmorb 42d8fd4
Mail logging plugin für convenience
datengraben eadb938
Merge branch 'master' into ft-wp-env
hansmorb 143592b
fixed up README after merge
hansmorb 021e28f
update composer packages after merge
hansmorb 7033a1f
added experimental cypress support
hansmorb 34aaba0
switch back ubuntu version
hansmorb 2a1402f
tried adding compass
hansmorb 00a179b
removed Cypress install
hansmorb 9f0732b
removed video recording
hansmorb 7ed9d2a
add error on purpose to see if tests will fail
hansmorb 42baf06
fixed unit test to properly check if dashboard is present
hansmorb 1c0b1fd
Revert "add error on purpose to see if tests will fail"
hansmorb 4b08aca
upped WP version
hansmorb e209450
added tests to load every page
hansmorb 4b0adc6
upped WP version
hansmorb 91bdf2d
Add node 20.5.1 nvmrc
datengraben c497b2e
Use nvmrc in cypress path
datengraben ec6cce0
Use latest action and node 20
datengraben e2f00d3
Add bash script to build release
datengraben a527eae
Place nvmrc in root
datengraben 46b7734
Revert "Add bash script to build release"
datengraben 5d7163c
Takes screenshot of each page on success
datengraben 5bcfddb
added cypress screenshot upload
hansmorb 24c9cba
Merge pull request #1 from wielebenwir/experiment/cypress
datengraben 528b4ac
Merge branch 'wielebenwir:master' into ft-wp-env
datengraben a58f265
added e2e testing instructions
hansmorb 53c15d9
fixed typos & coherency
hansmorb 6d01638
fixed jQuery not enqueued for map shortcodes
hansmorb df2feff
catch fatal error when import Locations from .xml export
hansmorb 2b1e345
added test data & basic shortcode tests
hansmorb e04bc03
add rudimentary test for map shortcode
hansmorb 5d4794b
added tests for booking process
hansmorb 2e0aeae
fix load-wp tests & spread them out
hansmorb b31557c
Merge branch 'master' into ft-wp-env
hansmorb 0c93dc1
updated cypress
hansmorb 4fa6171
fix plugin activation sometimes not working
hansmorb 5d98e90
Revert "fix plugin activation sometimes not working"
hansmorb 19ebc3c
fixed broken behaviour when plugin was activated through cli
hansmorb 1e2e256
added wait for map shortcode
hansmorb ea574d4
added badge for E2E tests
hansmorb 74f49dc
added test for location & item frontend templates
hansmorb b81b0b2
added screenshots to gitignore
hansmorb 9dd9f4f
Update Readme.md
hansmorb 1570399
added start script (basically installation)
hansmorb 1abdab2
added setup step to README.md
hansmorb c18a293
organized tests folders
hansmorb cae4f4b
Update Readme.md
hansmorb d574d95
Merge branch 'master' into ft-wp-env
hansmorb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
- '**.txt' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
env: | ||
DB_DATABASE: wordpress_test | ||
DB_USER: root | ||
DB_PASSWORD: '' | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer install --no-dev --prefer-dist --no-progress | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- run: npm ci --legacy-peer-deps --include=dev | ||
- run: docker-compose -v | ||
- name: setup wp env | ||
run: npm run env:start | ||
|
||
- name: install test data for e2e test | ||
run: npm run cypress:setup | ||
|
||
- name: Cypress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
install: false | ||
config-file: tests/cypress/cypress.config.js | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: cypress-screenshots | ||
path: ${{ github.workspace }}/tests/cypress/screenshots/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"phpVersion": "7.4", | ||
"core": "Wordpress/Wordpress#6.3.1", | ||
"plugins": [ | ||
".", | ||
"https://downloads.wordpress.org/plugin/wp-crontrol.zip", | ||
"https://downloads.wordpress.org/plugin/wordpress-importer.zip", | ||
"https://downloads.wordpress.org/plugin/query-monitor.zip", | ||
"https://downloads.wordpress.org/plugin/wp-mail-logging.zip" | ||
], | ||
"port": 1000, | ||
"testsPort": 1001, | ||
"config": { | ||
"WP_DEBUG": true, | ||
"WP_DEBUG_LOG": true, | ||
"WP_DEBUG_DISPLAY": false | ||
}, | ||
"themes": [ | ||
"flegfleg/kasimir-theme" | ||
], | ||
"env": { | ||
"tests": { | ||
"mappings": { | ||
"wp-content/plugins/commonsbooking": "." | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# install-wp-cli.sh | ||
# | ||
# Felipe Elia <contato@felipeelia.com.br> and 10up contributors | ||
# | ||
# The following code is a derivative work of the code from the ElasticPress project, | ||
# which is licensed GPLv2. This code therefore is also licensed under the terms | ||
# of the GNU Public License, version 2.' | ||
|
||
#!/usr/bin/env bash | ||
|
||
echo "Installing WP-CLI in $1" | ||
|
||
./bin/wp-env-cli $1 curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | ||
./bin/wp-env-cli $1 chmod +x wp-cli.phar | ||
./bin/wp-env-cli $1 mv wp-cli.phar /usr/local/bin/wp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# setup-cypress-env.sh | ||
# Felipe Elia <contato@felipeelia.com.br> and 10up contributors | ||
# | ||
# The following code is a derivative work of the code from the ElasticPress project, | ||
# which is licensed GPLv2. This code therefore is also licensed under the terms | ||
# of the GNU Public License, version 2.' | ||
|
||
#!/bin/bash | ||
|
||
# Install our example posts from a WP export file | ||
./bin/wp-env-cli tests-wordpress "wp --allow-root import /var/www/html/wp-content/plugins/commonsbooking/tests/cypress/wordpress-files/content-example.xml --authors=create" | ||
# Create subscriber with username "subscriber" and password "password" | ||
./bin/wp-env-cli tests-wordpress "wp --allow-root user create subscriber sub@sub.de --role=subscriber --user_pass=password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env node | ||
|
||
const path = require('path'); | ||
const { spawn } = require('child_process'); | ||
const { readConfig } = require('@wordpress/env/lib/config'); | ||
|
||
function spawnCommandDirectly({ container, command, dockerComposeConfigPath }) { | ||
const composeCommand = [ | ||
'-f', | ||
dockerComposeConfigPath, | ||
'exec -T', | ||
container, | ||
...command.split(' '), // The command will fail if passed as a complete string. | ||
]; | ||
|
||
return new Promise((resolve, reject) => { | ||
const childProc = spawn('docker-compose', composeCommand, { | ||
stdio: 'inherit', | ||
shell: true, | ||
}); | ||
childProc.on('error', reject); | ||
childProc.on('exit', (code) => { | ||
// Code 130 is set if the user tries to exit with ctrl-c before using | ||
// ctrl-d (so it is not an error which should fail the script.) | ||
if (code === 0 || code === 130) { | ||
resolve(); | ||
} else { | ||
reject(code); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
const run = async () => { | ||
const configPath = path.resolve('.wp-env.json'); | ||
const { dockerComposeConfigPath } = await readConfig(configPath); | ||
|
||
const container = process.argv[2]; | ||
const command = process.argv.splice(3).join(' '); | ||
|
||
try { | ||
await spawnCommandDirectly({ | ||
container, | ||
command, | ||
dockerComposeConfigPath, | ||
}); | ||
} catch (errorCode) { | ||
process.exit(errorCode); | ||
} | ||
}; | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@hansmorb Also diese Stelle stimmt jetzt nicht mehr, das bin/build-zip.sh ist irgendwie rausgeflogen.
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.
Dann lass uns doch gerne zuerst die #1223 mergen und dann diesen Branch.