-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3854 from 10up/feature/es-8-automated-tests
Automated tests with ES 8
- Loading branch information
Showing
7 changed files
with
29 additions
and
77 deletions.
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Test | ||
name: Unit Test | ||
|
||
env: | ||
COMPOSER_VERSION: "2" | ||
|
@@ -17,9 +17,16 @@ on: | |
- '[0-9].[0-9x]*' # Version branches: 4.x.x, 4.1.x, 5.x | ||
|
||
jobs: | ||
phpunit_single_site: | ||
name: PHP Unit (Single Site) | ||
phpunit: | ||
name: ${{ matrix.type.name }} - ES ${{ matrix.esVersion }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
esVersion: ['7.10.1', '8.12.2'] | ||
type: | ||
- {name: 'Single Site', command: 'test-single-site'} | ||
- {name: 'Multisite', command: 'test'} | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -28,71 +35,11 @@ jobs: | |
- name: Start MySQL | ||
run: sudo systemctl start mysql.service | ||
|
||
- name: Configure sysctl limits | ||
run: | | ||
sudo swapoff -a | ||
sudo sysctl -w vm.swappiness=1 | ||
sudo sysctl -w fs.file-max=262144 | ||
sudo sysctl -w vm.max_map_count=262144 | ||
- name: Setup Elasticsearch | ||
uses: getong/[email protected] | ||
with: | ||
elasticsearch version: '7.10.1' | ||
|
||
- name: Set standard 10up cache directories | ||
run: | | ||
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}" | ||
- name: Prepare composer cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.COMPOSER_CACHE }} | ||
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
composer-${{ env.COMPOSER_VERSION }}- | ||
- name: Set PHP version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
extensions: :php-psr | ||
coverage: none | ||
run: cd bin/es-docker/ && docker-compose build --build-arg ES_VERSION=${{ matrix.esVersion }} && docker-compose up -d | ||
|
||
- name: Install dependencies | ||
run: composer install --ignore-platform-reqs | ||
|
||
- name: Setup WP Tests | ||
run: | | ||
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 | ||
sleep 10 | ||
- name: PHPUnit | ||
run: | | ||
composer run-script test-single-site | ||
phpunit_multisite: | ||
name: PHP Unit (Multisite) | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Start MySQL | ||
run: sudo systemctl start mysql.service | ||
|
||
- name: Configure sysctl limits | ||
run: | | ||
sudo swapoff -a | ||
sudo sysctl -w vm.swappiness=1 | ||
sudo sysctl -w fs.file-max=262144 | ||
sudo sysctl -w vm.max_map_count=262144 | ||
- name: Setup Elasticsearch | ||
uses: getong/[email protected] | ||
with: | ||
elasticsearch version: '7.10.1' | ||
- name: Check ES response | ||
run: curl --connect-timeout 5 --max-time 10 --retry 5 --retry-max-time 40 --retry-all-errors http://127.0.0.1:8890 | ||
|
||
- name: Set standard 10up cache directories | ||
run: | | ||
|
@@ -114,16 +61,13 @@ jobs: | |
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
run: composer install --ignore-platform-reqs | ||
|
||
- name: Setup WP Tests | ||
run: | | ||
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 | ||
sleep 10 | ||
- name: Debug | ||
run: ./vendor/bin/phpunit --filter test_use_language_in_setting_for_multisite | ||
- name: PHPUnit | ||
run: | | ||
composer run-script test | ||
EP_HOST=http://127.0.0.1:8890/ composer run-script ${{ matrix.type.command }} |
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
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 |
---|---|---|
|
@@ -18,6 +18,6 @@ function() { | |
add_filter( | ||
'ep_elasticsearch_version', | ||
function() { | ||
return '8.0'; | ||
return '9.0'; | ||
} | ||
); |
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