Skip to content

Commit

Permalink
tUpdate CI
Browse files Browse the repository at this point in the history
Debug

New config
  • Loading branch information
adamyeats committed Aug 15, 2024
1 parent a49d8c7 commit 97eab03
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
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: 1.22

- 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: isbang/[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: npx playwright test

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion .github/workflows/run-frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 'stable'

- name: Install yarn dependencies
run: yarn install
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
ports:
- 3000:3000
volumes:
- ./dist:/var/lib/grafana/plugins/grafanalabs-clickhouse-datasource
- ./dist:/var/lib/grafana/plugins/grafana-clickhouse-datasource
- ./provisioning:/etc/grafana/provisioning
- .:/root/grafana-clickhouse-datasource
healthcheck:
Expand All @@ -22,6 +22,7 @@ services:
start_period: 30s
environment:
- GF_LOG_LEVEL=debug
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=true
networks:
- grafana

Expand Down
4 changes: 3 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ export default defineConfig<PluginOptions>({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:3000',
baseURL: `http://localhost:${process.env.PORT || 3000}`,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'on'
},

/* Configure projects for major browsers */
Expand Down

0 comments on commit 97eab03

Please sign in to comment.