-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(*): add pipeline for EE features (#83)
- Loading branch information
1 parent
0d3cd35
commit 0c54429
Showing
7 changed files
with
173 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# This is a BASE reusable workflow used by other workflows for E2E testing with Gateway EE | ||
|
||
name: Run E2E Tests - EE | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
base-url: | ||
type: string | ||
default: http://localhost:8002 | ||
gateway-image: | ||
type: string | ||
default: kong/kong:nightly-ubuntu | ||
retries: | ||
type: number | ||
default: 0 | ||
|
||
env: | ||
GATEWAY_IMAGE: ${{ inputs.gateway-image }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PRIVATE_READ }} | ||
|
||
jobs: | ||
e2e-tests: | ||
strategy: | ||
matrix: | ||
suite: | ||
- plugins | ||
fail-fast: false | ||
name: ${{ matrix.suite }} | ||
runs-on: ${{ vars.RUNS_ON }} | ||
|
||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download assets | ||
timeout-minutes: 5 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: assets | ||
|
||
- name: Unpack assets | ||
run: tar xzvf ./assets.tar.gz | ||
|
||
- id: setup-node | ||
name: Setup Node | ||
timeout-minutes: 5 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Install Playwright | ||
timeout-minutes: 10 | ||
run: | | ||
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" | ||
yarn install:e2e | ||
yarn playwright install chromium | ||
- name: Log in to GitHub Container Registry | ||
timeout-minutes: 1 | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Start Kong | ||
timeout-minutes: 10 | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
echo "Using image: $GATEWAY_IMAGE" | ||
docker_compose_exit_code=0 | ||
docker compose -f .ci/docker-compose.yml up -d kong --wait || docker_compose_exit_code=$? | ||
docker compose -f .ci/docker-compose.yml logs | ||
exit $compose_exit | ||
- name: Run E2E tests - EE | ||
timeout-minutes: 10 | ||
env: | ||
KM_TEST_GUI_URL: ${{ inputs.base-url }} | ||
run: | | ||
yarn test:e2e \ | ||
--pass-with-no-tests \ | ||
--retries ${{ inputs.retries }} \ | ||
--reporter=list \ | ||
${{ format('specs-ee/{0}/', matrix.suite) }} | ||
- name: Upload results | ||
if: ${{ !cancelled() }} | ||
continue-on-error: true | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: results-${{ matrix.suite }} | ||
path: tests/playwright/test-results/ | ||
retention-days: 1 |
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { expect } from '@playwright/test' | ||
import baseTest from '@pw/base-test' | ||
|
||
const test = baseTest() | ||
|
||
test.describe('PLACEHOLDER', () => { | ||
test('is enterprise edition', async ({ page }) => { | ||
await page.goto('/') | ||
await expect(page.locator('[aria-label="Gateway"] .info-list')).toContainText('enterprise') | ||
}) | ||
}) |