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

[CMSP-695] Filter WP font_dir #29

Merged
merged 61 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
19ae183
use the downloaded tmp directory to source the wp-latest.json
jazzsequence Feb 5, 2024
ae82717
add fonts namespace and font dir mods
jazzsequence Feb 5, 2024
79abd55
load our font dir mods
jazzsequence Feb 5, 2024
a8476b7
initial hello world tests
jazzsequence Feb 5, 2024
6e51dd8
test the pantheon_font_dir function works as expected
jazzsequence Feb 6, 2024
cd59bef
allow a nightly version of WP to be installed
jazzsequence Feb 6, 2024
4cad5c1
handle installed nightly releases for testing
jazzsequence Feb 6, 2024
f3fa10c
create wp-config for nightly wp if one doesn't exist
jazzsequence Feb 6, 2024
ae53e2e
install latest gutenberg if we're running tests on latest wp
jazzsequence Feb 6, 2024
435aa15
fix spacing
jazzsequence Feb 6, 2024
56f9c6d
Add font library retrieval function from Gutenberg
jazzsequence Feb 6, 2024
567a918
change how we identify whether to skip the test
jazzsequence Feb 6, 2024
cd021bd
Add test for our font directory filtering
jazzsequence Feb 6, 2024
6df74d6
use a function to get the modify fonts dir value
jazzsequence Feb 6, 2024
80ea6c9
use the new function rather than a constant
jazzsequence Feb 6, 2024
32def22
don't add our own filter
jazzsequence Feb 6, 2024
df631d7
lower the priority of our font_dir filter
jazzsequence Feb 6, 2024
979cdfd
test that lowering the priority and filtering font_dir overrides our …
jazzsequence Feb 6, 2024
3cc9501
test disabling our font dir modification
jazzsequence Feb 6, 2024
ecf626b
linting fixes
jazzsequence Feb 6, 2024
26f03b9
fix download function for shellcheck
jazzsequence Feb 6, 2024
6ea1258
check if the file exists first
jazzsequence Feb 6, 2024
976dc8a
install wp-cli for tests
jazzsequence Feb 6, 2024
439372c
move multisite tests to run before nightly tests
jazzsequence Feb 6, 2024
d4ecf9b
setup nightly tests
jazzsequence Feb 6, 2024
dc3bc68
use latest checkout
jazzsequence Feb 6, 2024
9a5b45c
remove reference to non-existant filter
jazzsequence Feb 6, 2024
93c6518
return after marking test skipped
jazzsequence Feb 6, 2024
fba7864
maybe we need to check against latest 6.4.x
jazzsequence Feb 6, 2024
8b2bfa4
explicitly skip tests if wp_get_font_dir does not exist after trying …
jazzsequence Feb 6, 2024
7e3e403
don't remove non-existant file
jazzsequence Feb 6, 2024
8585cfb
better prompt for local install
jazzsequence Feb 6, 2024
2021d13
turn on debugging for phpunit test
jazzsequence Feb 6, 2024
37c9525
remove the rm's which apparently aren't doing anything
jazzsequence Feb 6, 2024
ce3e0fe
don't define a path
jazzsequence Feb 6, 2024
00f78b7
try /tmp/wordpress
jazzsequence Feb 6, 2024
0cc668a
remove debug mode
jazzsequence Feb 6, 2024
3ba1885
add labels and dividers between each run
jazzsequence Feb 6, 2024
3fa3de7
add composer-diff workflow
jazzsequence Feb 6, 2024
3a3a647
fix prerelease check logic
jazzsequence Feb 6, 2024
3d1feeb
capital W and P, i guess, dangit
jazzsequence Feb 6, 2024
2f6624d
test on all PHPs
jazzsequence Feb 6, 2024
36e5008
break wp_get_upload_dir out to a global
jazzsequence Feb 8, 2024
c7e3fbc
use our global for the wp_upload_dir
jazzsequence Feb 8, 2024
e1fb384
switch the wp_ prefix for pantheon_
jazzsequence Feb 8, 2024
1ee5a46
ignore unused variable
jazzsequence Feb 8, 2024
bb57dfc
Mock our pantheon_upload_dir global so we can test against it
jazzsequence Feb 8, 2024
83218c2
don't prefix property with an underscore
jazzsequence Feb 8, 2024
2d80e9e
linting fixes
jazzsequence Feb 8, 2024
1fa5a8b
simplify font dir
jazzsequence Feb 8, 2024
8a28754
remove function and just use the filter
jazzsequence Feb 8, 2024
363f6ba
remove wp version checks and rely on wp_get_font_dir check
jazzsequence Feb 8, 2024
3359e15
remove function call
jazzsequence Feb 8, 2024
03bdddf
use wpunit-helpers instead of our own files
jazzsequence Feb 8, 2024
1c497b9
remove shellcheck action
jazzsequence Feb 8, 2024
ae0723c
allow the wpunit-helpers plugin
jazzsequence Feb 8, 2024
3cfe3d1
gitignore the scripts sourced by wpunit-helpers
jazzsequence Feb 9, 2024
a39677b
after copying the files, we need to chmod them, so hook to post-insta…
jazzsequence Feb 9, 2024
9746d52
update syntax and add a nightly script
jazzsequence Feb 9, 2024
f3dbd51
bump actions/cache
jazzsequence Feb 9, 2024
d300920
use the new release
jazzsequence Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/composer-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Composer Diff
on:
pull_request:
paths:
- 'composer.lock'
permissions:
contents: write
pull-requests: write
jobs:
composer-diff:
name: Composer Diff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate composer diff
id: composer_diff
uses: IonBazan/composer-diff-action@v1
- uses: marocchino/sticky-pull-request-comment@v2
if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }}
with:
header: composer-diff
message: |
<summary>Composer Changes</summary>

${{ steps.composer_diff.outputs.composer_diff }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Lint
run: |
composer install
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/shellcheck.yml

This file was deleted.

24 changes: 18 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: PHP Compatibility
uses: pantheon-systems/phpcompatibility-action@dev
with:
Expand All @@ -26,23 +26,35 @@ jobs:
services:
mariadb:
image: mariadb:10.6
strategy:
matrix:
php_version: [7.4, 8.1, 8.3] # Versions represent newest 7.x, WP supported with exclusions, and beta support.
steps:
- uses: actions/checkout@v3
- name: Setup PHP 8.3
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: ${{ matrix.php_version }}
extensions: mysqli, zip, imagick
- name: Start MySQL
run: sudo systemctl start mysql
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/vendor
key: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
restore-keys: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
- name: Install Composer dependencies
run: composer install
run: |
if [ ${{ matrix.php_version }} = "7.4" ]; then
composer update
fi
composer install
- name: Install WP-CLI
run: |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
- name: Run PHPUnit
run: bash ./bin/phpunit-test.sh

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Ignore composer files.
/vendor
composer.lock
composer.lock

# Ignore bin files copied from wpunit-helpers
/bin/install-local-tests.sh
/bin/install-wp-tests.sh
/bin/phpunit-test.sh
/bin/helpers.sh
61 changes: 0 additions & 61 deletions bin/install-local-tests.sh

This file was deleted.

151 changes: 0 additions & 151 deletions bin/install-wp-tests.sh

This file was deleted.

29 changes: 0 additions & 29 deletions bin/phpunit-test.sh

This file was deleted.

18 changes: 15 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@
},
"require-dev": {
"pantheon-systems/pantheon-wp-coding-standards": "^2.0",
"pantheon-systems/wpunit-helpers": "^2.0",
"phpunit/phpunit": "^9",
"yoast/phpunit-polyfills": "^2.0"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"pantheon-systems/wpunit-helpers": true
}
},
"scripts": {
"chmod-scripts": [
"chmod +x bin/*.sh"
],
"post-install-cmd": [
"@chmod-scripts"
],
"post-update-cmd": [
"@chmod-scripts"
],
"lint": [
"@phplint",
"@phpcs"
Expand All @@ -30,7 +41,8 @@
"@test:multisite"
],
"test:multisite": "WP_MULTISITE=1 vendor/bin/phpunit --colors=always",
"test:install": "bin/install-local-tests.sh --no-db",
"test:install:withdb": "bin/install-local-tests.sh"
"test:install": "bin/install-local-tests.sh --skip-db=true",
"test:install:withdb": "bin/install-local-tests.sh",
"test:install:nightly": "bin/install-local-tests.sh --version=nightly --skip-db=true"
}
}
Loading
Loading