Merge branch 'trunk' into fix/e2e-wp57-cli

This commit is contained in:
Ron Rennick 2021-03-12 12:03:36 -04:00
commit ac95718dff
2 changed files with 20 additions and 43 deletions

View File

@ -21,38 +21,11 @@ jobs:
name: woocommerce
path: ${{ steps.build.outputs.zip_path }}
retention-days: 7
e2e-tests-cache:
name: Set e2e caches for running tests
runs-on: ubuntu-latest
steps:
- name: Checkout code.
uses: actions/checkout@v2
- name: Load Node.js.
uses: actions/setup-node@v2
with:
node-version: '12'
# From https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#using-the-cache-action
- name: Cache node modules
uses: actions/cache@v2
id: cache_node_modules
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Run npm install, and cache if they aren't.
run: npm install
e2e-tests-run:
name: Runs E2E tests.
runs-on: ubuntu-latest
needs: [ build, e2e-tests-cache ]
runs-on: ubuntu-18.04
needs: [ build ]
steps:
- name: Create dirs.
@ -66,20 +39,6 @@ jobs:
uses: actions/checkout@v2
with:
path: package/woocommerce
# From https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#using-the-cache-action
- name: Cache node modules
uses: actions/cache@v2
id: cache_node_modules
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
- name: Restore node modules from cache, if available.
run: mv ./node_modules package/woocommerce/node_modules
- name: Run npm install.
working-directory: package/woocommerce
@ -87,6 +46,8 @@ jobs:
- name: Load docker images and start containers.
working-directory: package/woocommerce
env:
WP_VERSION: 5.6.2
run: npx wc-e2e docker:up
- name: Move current directory to code. We will install zip file in this dir later.

View File

@ -24,4 +24,20 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zone_Met
* @var string
*/
protected $namespace = 'wc/v3';
/**
* Get the settings schema, conforming to JSON Schema.
*
* @return array
*/
public function get_item_schema() {
// Get parent schema to append additional supported settings types for shipping zone method.
$schema = parent::get_item_schema();
// Append additional settings supported types (class, order).
$schema['properties']['settings']['properties']['type']['enum'][] = 'class';
$schema['properties']['settings']['properties']['type']['enum'][] = 'order';
return $this->add_additional_fields_schema( $schema );
}
}