Skip to content

Commit 9344b4d

Browse files
authored
Merge pull request #241 from GravityKit/tests/post-build-smoke
Add post-build smoke E2E against built .zip artifact
2 parents 11e672a + 154e40c commit 9344b4d

4 files changed

Lines changed: 65 additions & 14 deletions

File tree

.circleci/config.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,54 @@ jobs:
118118
else
119119
echo "Skipping translation pipeline."
120120
fi
121+
- run:
122+
name: Collect build artifacts
123+
command: |
124+
mkdir -p .release
125+
cp gf-entries-in-excel-*.zip .release/
126+
- store_artifacts:
127+
path: .release
128+
destination: release
129+
- persist_to_workspace:
130+
root: /home/circleci
131+
paths:
132+
- plugin/.release
133+
- plugin/gf-entries-in-excel-*.zip
134+
135+
run_post_build_smoke:
136+
<<: *default_job_config
137+
machine:
138+
image: default
139+
docker_layer_caching: true
140+
resource_class: xlarge
141+
steps:
142+
- attach_workspace:
143+
at: /home/circleci
144+
- run:
145+
name: Post-build smoke
146+
# Unzips .release/*.zip, restores dev deps via gktools' Docker composer,
147+
# boots wp-env with retry, runs `playwright test --grep=@smoke` against
148+
# the built artifact. See @gravitykit/e2e-bootstrap README for details.
149+
command: |
150+
npx @gravitykit/e2e-bootstrap smoke \
151+
--composer-cmd "npx @gravitykit/gktools composer install"
152+
- store_artifacts:
153+
path: tests/E2E/results
154+
- store_artifacts:
155+
path: tests/E2E/report
156+
- store_test_results:
157+
path: tests/E2E/results/junit.xml
158+
159+
publish_release:
160+
<<: *default_job_config
161+
steps:
162+
- attach_workspace:
163+
at: /home/circleci
164+
- run:
165+
name: Configure git
166+
command: |
167+
git config user.email "support@gravitykit.com"
168+
git config user.name "GravityKit - CI"
121169
- run:
122170
name: Create GitHub release
123171
command: npx @gravitykit/gktools release
@@ -127,14 +175,6 @@ jobs:
127175
if ! git log -1 --pretty=%B | grep -iq "\[skip notify\]"; then
128176
npx @gravitykit/gktools announce
129177
fi
130-
- run:
131-
name: Collect build artifacts
132-
command: |
133-
mkdir -p .release
134-
cp gf-entries-in-excel-*.zip .release/ 2>/dev/null || true
135-
- store_artifacts:
136-
path: .release
137-
destination: release
138178
139179
workflows:
140180
version: 2
@@ -148,3 +188,11 @@ workflows:
148188
<<: *context
149189
requires:
150190
- prepare
191+
- run_post_build_smoke:
192+
<<: *context
193+
requires:
194+
- build_package_release
195+
- publish_release:
196+
<<: *context
197+
requires:
198+
- run_post_build_smoke

package-lock.json

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"tests:e2e:run": "playwright test --config=tests/E2E/setup/playwright.config.js"
1111
},
1212
"devDependencies": {
13-
"@gravitykit/e2e-bootstrap": "^1.0.0",
13+
"@gravitykit/e2e-bootstrap": "^1.1.0",
1414
"@playwright/test": "1.56.1",
1515
"@wordpress/env": "^10.0.0",
1616
"grunt": "^1.5.3",

tests/E2E/tests/activation.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { test, expect } = require('@playwright/test');
22

3-
test.describe('GravityExport Lite — Activation Smoke Test', () => {
3+
test.describe('GravityExport Lite — Activation Smoke Test @smoke', () => {
44

55
test('Plugin activates without fatal PHP errors', async ({ page } ) => {
66
await page.goto('/wp-admin/plugins.php');

0 commit comments

Comments
 (0)