Skip to content

Commit

Permalink
Merge branch 'develop' into fix/phpcs-security-issues
Browse files Browse the repository at this point in the history
# Conflicts:
#	includes/Commission.php
  • Loading branch information
devAsadNur committed Jan 1, 2025
2 parents cdb9839 + 4a5d435 commit 9eb13a2
Show file tree
Hide file tree
Showing 676 changed files with 90,344 additions and 25,927 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
}
72 changes: 28 additions & 44 deletions .github/workflows/e2e_api_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ env:
CUSTOMER2: customer2
USER_PASSWORD: 01dokan01
GMAP: ${{secrets.GMAP}}
MAPBOX: ${{secrets.MAPBOX}}
BASE_URL: http://localhost:9999
CI: true
FORCE_COLOR: 1
DB_HOST_NAME: localhost
DB_USER_NAME: root
DB_USER_PASSWORD: password
DB_PORT: 9998
DATABASE: tests-wordpress
DB_PREFIX: wp

PR_NUMBER: ${{ github.event.number }}
SHA: ${{ github.event.pull_request.head.sha }}
SYSTEM_INFO: ./tests/pw/playwright/systemInfo.json
Expand All @@ -73,42 +76,36 @@ jobs:
uses: actions/checkout@v4

- name: Use desired version of NodeJS
if: success()
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Composer install and build (Dokan-lite)
if: success()
run: |
composer i --no-dev -o || composer update --no-dev -o
- name: Npm install and build (Dokan-lite)
if: success()
run: |
npm ci || npm i
npm run build
# Install test dependencies
- name: Install test dependencies
if: success()
working-directory: tests/pw
run: |
cd tests/pw
npm ci || npm i
# Create wp debuglog file
- name: Create wp debuglog file
id: debug-log
if: success()
working-directory: tests/pw
run: |
cd tests/pw
mkdir -p wp-data && touch wp-data/debug.log
# Start wordpress environment
- name: Start WordPress Env
id: wp-env
if: success()
uses: nick-fields/retry@v3
with:
timeout_minutes: 4
Expand All @@ -118,47 +115,28 @@ jobs:
cd tests/pw
npm run start:env
# Grab test db port
- name: Get Test DB PORT
id: db-port
if: success()
run: |
cd tests/pw
echo "DB_PORT=$(docker ps -f ancestor='mariadb:lts' -f name='tests-mysql' --format='{{.Ports}}' | sed -E 's/.*:(.*)->.*/\1/')" >> $GITHUB_ENV
# db port
- name: DB PORT
if: success()
run: |
cd tests/pw
echo "The value of test DB_PORT is ${{ env.DB_PORT }}"
# Set permalink structure
- name: Set Permalink structure
if: success()
working-directory: tests/pw
run: |
cd tests/pw
npm run wp-env run tests-cli wp rewrite structure /%postname%/
# Activate theme
- name: Activate theme:Storefront
if: success()
working-directory: tests/pw
run: |
cd tests/pw
npm run wp-env run tests-cli wp theme activate storefront
# Get Playwright version
- name: Get installed Playwright version
id: playwright-version
if: success()
working-directory: tests/pw
run: |
cd tests/pw
echo "PLAYWRIGHT_VERSION=$(npm ls @playwright/test --json | jq --raw-output '.dependencies["@playwright/test"].version')" >> $GITHUB_ENV
# Cache browser binaries, cache key is based on Playwright version and OS
- name: Cache playwright binaries
id: playwright-cache
if: success()
uses: actions/cache@v4
with:
path: |
Expand All @@ -170,36 +148,42 @@ jobs:
# Install browser binaries & OS dependencies if cache missed
- name: Install Playwright browser binaries & OS dependencies
id: pw-install
if: success() && steps.playwright-cache.outputs.cache-hit != 'true'
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: tests/pw
run: |
cd tests/pw
npm run pw:browser-with-deps
# # Install only the OS dependencies if cache hit not needed
# - name: Install Playwright OS dependencies
# if: steps.playwright-cache.outputs.cache-hit == 'true'
# working-directory: tests/pw
# run: |
# cd tests/pw
# npm run pw:deps-only

# Run e2e tests
- name: 🧪 Running the e2e tests
- name: 🧪 Run e2e tests
id: e2e-test
if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
timeout-minutes: 40
working-directory: tests/pw
run: |
npm run test:e2e
# Run e2e coverage
- name: 🧪 Run e2e coverage
if: always() && (steps.e2e-test.outcome == 'success' || steps.e2e-test.outcome == 'failure')
working-directory: tests/pw
run: |
cd tests/pw
npm run test:e2e:lite
npm run e2e_coverage
npm run test:e2e:coverage
# Run API tests
- name: 🧪 Running the api tests
# Run api tests
- name: 🧪 Run api tests
id: api-test
if: always() && steps.db-port.outcome == 'success' && ( github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All')))
if: always() && steps.wp-env.outcome == 'success' && ( github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All')))
timeout-minutes: 5
working-directory: tests/pw
run: |
cd tests/pw
npm run test:api:lite
npm run test:api
# Prepare test summary
- name: Prepare test summary
Expand Down Expand Up @@ -235,9 +219,9 @@ jobs:

# Backup Database
- name: Backup Database
if: always() && steps.db-port.outcome == 'success'
if: always() && steps.wp-env.outcome == 'success'
working-directory: tests/pw
run: |
cd tests/pw
npm run wp-env run tests-cli wp db export wp-data/db.sql
# Upload artifacts
Expand Down
Loading

0 comments on commit 9eb13a2

Please sign in to comment.