Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,46 @@ jobs:
- run: npm ci
- run: npm run test

e2e:
name: "e2e tests"
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v6

- name: start dev env (host network)
uses: hoverkraft-tech/compose-action@v2.5.0
with:
compose-file: .github/workflows/docker-compose.e2e.yml

- uses: perses/github-actions@v0.11.0
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_npm: true
nvmrc_path: ".nvmrc"
- name: install dependencies
run: npm ci
- name: install percli
uses: perses/cli-actions/actions/install_percli@v0.2.0
with:
cli-version: "v0.53.0-rc.1"
- name: verify percli installation
run: percli version
- name: install Playwright browsers
run: npx playwright install --with-deps
working-directory: e2e
- name: setup Perses and start Plugins
run: |
# Handshake with server on port 8080
percli login http://localhost:8080
PLUGINS=("table" "tracetable")
for plugin in "${PLUGINS[@]}"; do
percli plugin start "./$plugin" &
sleep 10
npm run test:ci --prefix e2e -- "tests/$plugin"
done

type-check:
name: "type-check"
runs-on: ubuntu-latest
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/docker-compose.e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
perses:
image: persesdev/perses:v0.53.0-rc.1
container_name: perses
network_mode: host
environment:
- PERSES_PLUGIN_ENABLE_DEV=true
volumes:
- ../..:/home/runner/work/plugins/plugins
8 changes: 8 additions & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
97 changes: 97 additions & 0 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@perses-dev/plugins-e2e",
"version": "0.1.0",
"description": "e2e tests for plugins",
"private": true,
"scripts": {
"test:ci": "npx playwright test --workers=1 --reporter=github,list",
"test:install": "npx playwright install --with-deps",
"test:local": "npx playwright test --ui",
"build": "echo 'Skipping build for e2e tests'"
},
"devDependencies": {
"@playwright/test": "^1.58.2",
"@types/node": "^25.2.3"
}
}
40 changes: 40 additions & 0 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright The Perses Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
testDir: './tests',
fullyParallel: true,
retries: 0,
workers: 1,
reporter: 'list',

use: {
baseURL: 'http://localhost:8080',
trace: 'off',
screenshot: 'only-on-failure',
video: 'off',
},

projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],

expect: {
timeout: 10000,
},
});
21 changes: 21 additions & 0 deletions e2e/tests/table/table.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright The Perses Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { test, expect } from '@playwright/test';

/* WAS ONLY ADDED FOR DEMONSTRATIONS*/
test.describe('table Plugin', () => {
test('ONLY FOR PR DEMONSTRATION', async () => {
expect(true).toBeTruthy();
});
});
21 changes: 21 additions & 0 deletions e2e/tests/tracetable/tracetable.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright The Perses Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { test, expect } from '@playwright/test';

/* WAS ONLY ADDED FOR DEMONSTRATIONS*/
test.describe('tacetable Plugin', () => {
test('ONLY FOR PR DEMONSTRATION', async () => {
expect(true).toBeTruthy();
});
});
Loading
Loading