Skip to content
Merged
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
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,42 @@ jobs:
- run: npm ci
- run: npm run test

e2e:
name: "e2e tests"
needs: build # <--- CRITICAL: Wait for build to finish. PERSES_PLUGIN_ARCHIVE_PATHS accepts archive files only
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
- name: download plugin archives
uses: actions/download-artifact@v4 # <--- Download the artifacts to use the archive files
with:
name: archives
path: ./plugins/temp-archives
- name: flatten plugin archives # <--- Move all plugins archive into a single folder for simplicity
run: |
mkdir -p ./plugins/development-archives
find ./plugins/temp-archives -name "*.tar.gz" -exec mv {} ./plugins/development-archives/ \;
rm -rf ./plugins/temp-archives
ls -R ./plugins/development-archives
- name: start dev env
uses: hoverkraft-tech/compose-action@v2.5.0
with:
compose-file: .github/workflows/docker-compose.ci.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 Playwright browsers
run: npx playwright install --with-deps
working-directory: e2e
- name: run e2e tests
run: npm run test:ci --prefix e2e -- src/tests


type-check:
name: "type-check"
runs-on: ubuntu-latest
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
perses:
image: persesdev/perses:main-2026-02-26-739dc289-distroless-debug
container_name: perses
network_mode: host
environment:
- PERSES_PLUGIN_ENABLE_DEV=true
- PERSES_PLUGIN_ARCHIVE_PATHS_0=/etc/perses/development-archives
- PERSES_PROVISIONING_FOLDERS_0=/etc/perses/provisioning
volumes:
- ../../plugins/development-archives:/etc/perses/development-archives
- ../../e2e/src/data:/etc/perses/provisioning
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/
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"
}
}
39 changes: 39 additions & 0 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// 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: './src/tests',
fullyParallel: true,
retries: 0,
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,
},
});
7 changes: 7 additions & 0 deletions e2e/src/data/projects/e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"kind": "Project",
"metadata": {
"name": "e2eproject"
},
"spec": {}
}
21 changes: 21 additions & 0 deletions e2e/src/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(1).toBe(1);
});
});
21 changes: 21 additions & 0 deletions e2e/src/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();
});
});
92 changes: 84 additions & 8 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"timeseriestable",
"tracetable",
"tracingganttchart",
"victorialogs"
"victorialogs",
"e2e"
],
"peerDependencies": {
"@types/react-dom": "^18.3.0",
Expand Down Expand Up @@ -84,4 +85,4 @@
"typescript": "^5.4.2"
},
"packageManager": "npm@10.9.2"
}
}
2 changes: 1 addition & 1 deletion scripts/golangci-lint/golangci-lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func main() {
var isError bool

for _, workspace := range npm.MustGetWorkspaces(".") {
schemasPath := filepath.Join(workspace,"schemas")
schemasPath := filepath.Join(workspace, "schemas")
if _, err := os.Stat(schemasPath); os.IsNotExist(err) {
// No schemas, skip go validation
logrus.Infof("skipping golangci-lint for %s (no schemas)", workspace)
Expand Down
Loading