-
Notifications
You must be signed in to change notification settings - Fork 1
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
add job matrix #92
base: pw
Are you sure you want to change the base?
add job matrix #92
Changes from 6 commits
5290512
d647885
5c1535c
e6e478d
2f2227f
ab60fbf
d016d87
6b6b825
8503d05
681612b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,14 +61,15 @@ env: | |
SHA: ${{ github.event.pull_request.head.sha }} | ||
SYSTEM_INFO: ./tests/pw/playwright/systemInfo.json | ||
API_TEST_RESULT: ./tests/pw/playwright-report/api/summary-report/results.json | ||
E2E_TEST_RESULT: ./tests/pw/playwright-report/e2e/summary-report/results.json | ||
API_COVERAGE: ./tests/pw/playwright-report/api/coverage-report/coverage.json | ||
E2E_COVERAGE: ./tests/pw/playwright-report/e2e/coverage-report/coverage.json | ||
|
||
jobs: | ||
tests: | ||
name: e2e_api tests | ||
name: e2e_api tests-${{ matrix.group }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
group: [e2e_1, e2e_2] | ||
|
||
steps: | ||
- name: Checkout testing repo | ||
|
@@ -115,17 +116,17 @@ jobs: | |
cd tests/pw | ||
npm run start:env | ||
|
||
# Set permalink structure | ||
- name: Set Permalink structure | ||
working-directory: tests/pw | ||
run: | | ||
npm run wp-env run tests-cli wp rewrite structure /%postname%/ | ||
# # Set permalink structure | ||
# - name: Set Permalink structure | ||
# working-directory: tests/pw | ||
# run: | | ||
# npm run wp-env run tests-cli wp rewrite structure /%postname%/ | ||
|
||
# Activate theme | ||
- name: Activate theme:Storefront | ||
working-directory: tests/pw | ||
run: | | ||
npm run wp-env run tests-cli wp theme activate storefront | ||
# # Activate theme | ||
# - name: Activate theme:Storefront | ||
# working-directory: tests/pw | ||
# run: | | ||
# npm run wp-env run tests-cli wp theme activate storefront | ||
|
||
# Get Playwright version | ||
- name: Get installed Playwright version | ||
|
@@ -161,29 +162,42 @@ jobs: | |
# npm run pw:deps-only | ||
|
||
# Run e2e tests | ||
- name: 🧪 Run e2e tests | ||
- name: 🧪 Run e2e tests-${{ matrix.group }} | ||
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 | ||
timeout-minutes: 30 | ||
working-directory: tests/pw | ||
run: | | ||
npm run test:e2e | ||
if [[ "${{ matrix.group }}" == "e2e_1" ]]; then | ||
export E2E_TEST_RESULT="./tests/pw/playwright-report/e2e/${{ matrix.group }}/summary-report/results.json" | ||
export E2E_COVERAGE="./tests/pw/playwright-report/e2e/${{ matrix.group }}/coverage-report/coverage.json" | ||
export GROUP="${{ matrix.group }}" | ||
echo "E2E_TEST_RESULT: $E2E_TEST_RESULT" | ||
echo "E2E_COVERAGE: $E2E_COVERAGE" | ||
echo "GROUP: $GROUP" | ||
npx playwright test --project="${{ matrix.group }}" --config=e2e.config.ts | ||
elif [[ "${{ matrix.group }}" == "e2e_2" ]]; then | ||
export E2E_TEST_RESULT="./tests/pw/playwright-report/e2e/${{ matrix.group }}/summary-report/results.json" | ||
export E2E_COVERAGE="./tests/pw/playwright-report/e2e/${{ matrix.group }}/coverage-report/coverage.json" | ||
export GROUP="${{ matrix.group }}" | ||
npx playwright test --project="${{ matrix.group }}" --config=e2e.config.ts | ||
fi | ||
|
||
# Run e2e coverage | ||
- name: 🧪 Run e2e coverage | ||
if: always() && (steps.e2e-test.outcome == 'success' || steps.e2e-test.outcome == 'failure') | ||
working-directory: tests/pw | ||
run: | | ||
npm run test:e2e:coverage | ||
npm run test:e2e:coverage | ||
|
||
# Run api tests | ||
- name: 🧪 Run api tests | ||
id: api-test | ||
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: | | ||
npm run test:api | ||
# - name: 🧪 Run api tests | ||
# id: api-test | ||
# 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: | | ||
# npm run test:api | ||
Comment on lines
+187
to
+193
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-enable API test execution. The API tests have been commented out without justification. These tests are configured in Remove the comment markers to restore API test coverage. |
||
|
||
# Prepare test summary | ||
- name: Prepare test summary | ||
|
@@ -229,7 +243,7 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
if: always() && steps.debug-log.outcome == 'success' | ||
with: | ||
name: test-artifact | ||
name: test-artifact-${{ matrix.group }} | ||
path: | | ||
tests/pw/wp-data | ||
tests/pw/playwright | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -4,7 +4,7 @@ import fs from 'fs'; | |||||||||||
import path from 'path'; | ||||||||||||
import { helpers } from '@utils/helpers'; | ||||||||||||
|
||||||||||||
const { DOKAN_PRO } = process.env; | ||||||||||||
const { DOKAN_PRO, GROUP } = process.env; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add validation for required GROUP environment variable The GROUP variable is destructured but not validated. Consider adding a validation check to ensure it's defined. -const { DOKAN_PRO, GROUP } = process.env;
+const { DOKAN_PRO, GROUP } = process.env;
+if (!GROUP) {
+ throw new Error('GROUP environment variable is required for coverage reporting');
+} 📝 Committable suggestion
Suggested change
|
||||||||||||
|
||||||||||||
let executed_tests: string[] = []; | ||||||||||||
|
||||||||||||
|
@@ -17,8 +17,8 @@ const uncoveredFeatures: string[] = []; | |||||||||||
|
||||||||||||
teardown.describe('get e2e test coverage', () => { | ||||||||||||
const feature_map = 'feature-map/feature-map.yml'; | ||||||||||||
const outputFile = 'playwright-report/e2e/coverage-report/coverage.json'; | ||||||||||||
const testReport = 'playwright-report/e2e/summary-report/results.json'; | ||||||||||||
const outputFile = `playwright-report/e2e/${GROUP}/coverage-report/coverage.json`; | ||||||||||||
const testReport = `playwright-report/e2e/${GROUP}/summary-report/results.json`; | ||||||||||||
|
||||||||||||
teardown('get coverage', { tag: ['@lite'] }, async () => { | ||||||||||||
executed_tests = helpers.readJson(testReport)?.tests; | ||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ declare global { | |
E2E_TEST_RESULT: string; | ||
API_COVERAGE: string; | ||
E2E_COVERAGE: string; | ||
GROUP: string; | ||
} | ||
} | ||
} |
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.
💡 Codebase verification
Re-enable commented out steps - they are critical dependencies
The verification shows these steps are essential and actively used in the test suite:
productsDetails.spec.ts
and site setup in_site.setup.ts
_site.setup.ts
,_localSite.setup.ts
,_env.setup.ts
) including theme-specific configurationspackage.json
and have dedicated test commandsLocations requiring attention:
.github/workflows/e2e_api_tests.yml
: Re-enable lines 121-131 (permalink and theme setup).github/workflows/e2e_api_tests.yml
: Re-enable lines 187-193 (API tests execution)🔗 Analysis chain
Verify impact of disabled steps
Several critical steps have been commented out:
These changes could impact the test environment setup and overall test coverage.
Let's verify if these steps are still needed:
Also applies to: 187-193
Let me check the actual content of these files to understand the dependencies better.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 320
Script:
Length of output: 3065