Skip to content
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

Move k6 E2E tests to Playwright #940

Merged
merged 16 commits into from
Sep 11, 2024
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
61 changes: 61 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- uses: actions/setup-go@v5
with:
go-version: 'stable'

- name: Build backend
uses: magefile/mage-action@v3
with:
args: buildAll
version: latest

- name: Install frontend dependencies
run: yarn install --frozen-lockfile

- name: Build frontend
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Install Playwright Browsers
run: yarn playwright install --with-deps

- name: Install and run Docker Compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: './docker-compose.yml'

- name: Wait for Grafana to start
uses: nev7n/wait_for_response@v1
with:
url: 'http://localhost:3000/'
responseCode: 200
timeout: 60000
interval: 500

- name: Run Playwright tests
run: yarn playwright test

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
11 changes: 7 additions & 4 deletions .github/workflows/run-backend-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run-backend-tests
name: Backend unit tests

on:
push:
Expand Down Expand Up @@ -32,10 +32,13 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 'stable'

- name: Build
run: go build -v ./...
- name: Build backend
uses: magefile/mage-action@v3
with:
args: buildAll
version: latest

- name: Run backend tests
run: CLICKHOUSE_VERSION=${{ matrix.clickhouse }} go test -v ./...
31 changes: 0 additions & 31 deletions .github/workflows/run-ci-cd.yml

This file was deleted.

17 changes: 3 additions & 14 deletions .github/workflows/run-frontend-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run-frontend-tests
name: Frontend unit tests

on:
push:
Expand All @@ -21,29 +21,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup packages
id: setup-packages
run: |
sudo apt-get update -y
sudo apt-get install -y zip zstd jq git

- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Install yarn dependencies
run: yarn install
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Build
run: go build -v ./...
- name: Check types
run: yarn typecheck

- name: Build Frontend
run: yarn build
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/run-k6e2e-tests.yml

This file was deleted.

7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ test_summary.json

pkg/__debug_bin

provisioning

**/.DS_Store
.eslintcache
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
26 changes: 14 additions & 12 deletions cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,43 @@
"mage_output_file.go"
],
"words": [
"dataframe",
"lowcardinality",
"fixedstring",
"singlequote",
"concats",
"Milli",
"traceid",
"aggregatable",
"aheads",
"apikey",
"CHSQL",
"ClickHouse",
"closedate",
"commitish",
"concats",
"createddate",
"dataframe",
"DataSource",
"DataSources",
"DateTime",
"dbug",
"elazarl",
"emerg",
"endregion",
"eror",
"errorsource",
"fixedstring",
"fromtime",
"goproxy",
"Grafana",
"grafanalabs",
"groupable",
"healthcheck",
"ILIKE",
"instancemgmt",
"lowcardinality",
"magefile",
"mgbench",
"Milli",
"millis",
"networkidle",
"nofile",
"nolint",
"Nonproxy",
"oper",
"otel",
"OUTFILE",
Expand All @@ -54,6 +58,7 @@
"regexes",
"sdkproxy",
"shopspring",
"singlequote",
"slvrtrn",
"sqlds",
"sqlutil",
Expand All @@ -71,14 +76,11 @@
"timespan",
"TLSCA",
"totime",
"traceid",
"typecheck",
"Ulimits",
"uuidv",
"vectorator",
"WorkDir",
"elazarl",
"goproxy",
"Nonproxy",
"errorsource"
"WorkDir"
]
}
57 changes: 43 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,60 @@
version: '3.7'
services:
grafana:
image: grafana/grafana-enterprise:${GR_VERSION:-10.0.3}
# image: grafana/grafana-enterprise:latest
# image: grafana/grafana-enterprise:main
container_name: grafana
build:
context: ./.config
args:
grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise}
grafana_version: ${GRAFANA_VERSION:-11.1.0}
# remove the following line when developing to have backend debugger
development: false
ports:
- '3000:3000'
- 3000:3000
volumes:
- ./:/var/lib/grafana/plugins/grafana-clickhouse-datasource
- ./dist:/var/lib/grafana/plugins/grafana-clickhouse-datasource
- ./provisioning:/etc/grafana/provisioning
- .:/root/grafana-clickhouse-datasource
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:3000/login"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
environment:
- TERM=linux
- GF_DEFAULT_APP_MODE=development
- GF_ENTERPRISE_LICENSE_TEXT=$GF_ENTERPRISE_LICENSE_TEXT
- GF_LOG_LEVEL=debug
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=true
networks:
- grafana

clickhouse:
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-23.2-alpine}'
container_name: 'grafana-clickhouse-server'
clickhouse-server:
image: clickhouse/clickhouse-server:${CLICKHOUSE_VERSION:-24.7-alpine}
container_name: clickhouse-server
ports:
- '8123:8123'
- '9000:9000'
- 8123:8123
- 9000:9000
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: ["CMD", "clickhouse-client", "--host", "clickhouse-server", "--query", "SELECT 1"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
networks:
- grafana

test-data-loader:
image: clickhouse/clickhouse-server:${CLICKHOUSE_VERSION:-24.7-alpine}
container_name: test-data-loader
entrypoint: ["clickhouse-client", "--host", "clickhouse-server", "--queries-file", "/dev/shm/property-prices.sql"]
depends_on:
clickhouse-server:
condition: service_healthy
restart: on-failure
volumes:
- ./tests/fixtures/property-prices.sql:/dev/shm/property-prices.sql
networks:
- grafana

Expand Down
6 changes: 0 additions & 6 deletions e2e/custom.ini

This file was deleted.

Loading
Loading