Skip to content

Commit 8846bbd

Browse files
committed
Fine tune e2e running on github actions
1 parent 59e22a5 commit 8846bbd

File tree

8 files changed

+37
-30
lines changed

8 files changed

+37
-30
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ jobs:
128128
docker compose rm -f
129129
docker compose up --exit-code-from=playwright --pull always
130130
working-directory: tests/
131+
env:
132+
CI: true
131133

132134
- name: upload playwright artifacts
133-
uses: actions/upload-artifact@v3
135+
uses: actions/upload-artifact@v4
134136
if: always()
135137
with:
136138
name: playwright

playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default defineConfig<PluginOptions>({
66
outputDir: './tests/results',
77
fullyParallel: false,
88
forbidOnly: !!process.env.CI,
9-
retries: process.env.CI ? 2 : 0,
10-
workers: 1,
9+
retries: process.env.CI ? 3 : 0,
10+
workers: 2,
1111
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
1212
reporter: 'list',
1313
use: {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
su - cmk -c "/usr/bin/env bash" << __EOF__
3+
echo abskjfdalkdhjbld | cmk-passwd cmkadmin -i
4+
echo "Admin password set"
5+
6+
omd stop
7+
omd config set MKEVENTD off
8+
omd config set AGENT_RECEIVER off
9+
omd config set LIVEPROXYD off
10+
omd config set TRACE_SEND off
11+
omd config set TRACE_RECEIVE off
12+
omd start
13+
echo "Event console, agent receiver, liveproxy, and trace disabled"
14+
__EOF__

tests/checkmk-docker-hooks/post-create/set-admin-password.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/docker-compose.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,19 @@ services:
3333
context: ../
3434
dockerfile: tests/Dockerfile
3535
environment:
36-
CMK_SITE: cmk
37-
CMK_ADMIN: cmkadmin
38-
CMK_AUTOMATION: automation
39-
CMK_PASSWORD: abskjfdalkdhjbld
40-
PLAYWRIGHT_TO_CHECKMK_URL: http://checkmk:5000/cmk/
41-
PLAYWRIGHT_TO_GRAFANA_URL: http://grafana:3000/
42-
GRAFANA_USER: admin
43-
GRAFANA_PASSWORD: password
44-
GRAFANA_TO_CHECKMK_USER: automation
45-
GRAFANA_TO_CHECKMK_PASSWORD: abskjfdalkdhjbld
46-
GRAFANA_TO_CHECKMK_URL: http://checkmk:5000/cmk/
36+
- CMK_SITE=cmk
37+
- CMK_ADMIN=cmkadmin
38+
- CMK_AUTOMATION=automation
39+
- CMK_PASSWORD=abskjfdalkdhjbld
40+
- PLAYWRIGHT_TO_CHECKMK_URL=http://checkmk:5000/cmk/
41+
- PLAYWRIGHT_TO_GRAFANA_URL=http://grafana:3000/
42+
- GRAFANA_USER=admin
43+
- GRAFANA_PASSWORD=password
44+
- GRAFANA_TO_CHECKMK_USER=automation
45+
- GRAFANA_TO_CHECKMK_PASSWORD=abskjfdalkdhjbld
46+
- GRAFANA_TO_CHECKMK_URL=http://checkmk:5000/cmk/
47+
- CI
48+
4749
extra_hosts:
4850
- checkmk.local:host-gateway
4951
volumes:

tests/e2e/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ import dotenv from 'dotenv';
22

33
dotenv.config();
44

5-
const site = process.env.CMK_SITE;
6-
75
const cfg = {
86
//Checkmk
9-
site: site,
7+
site: process.env.CMK_SITE,
108
cmkUser: process.env.CMK_ADMIN,
119
cmkPassword: process.env.CMK_PASSWORD,
1210
automationUser: process.env.CMK_AUTOMATION,

tests/e2e/models/DashboardPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type Page, expect } from '@playwright/test';
33
import current_config from '../config';
44
import { FilterTypes, GRAFANA_SELECTORS, GRAFANA_TEXT, GraphTypes } from '../constants';
55

6-
const CUSTOM_TIMEOUT = 40000;
6+
const CUSTOM_TIMEOUT = 30000;
77

88
export class DashboardPage {
99
readonly page: Page;

tests/e2e/tests/e2e.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ test.describe('E2E tests', () => {
3232
});
3333

3434
test.describe('Commercial editions tests', () => {
35+
test.slow();
3536
test('time-usage panel by service (single host)', async ({ page }) => {
3637
const dashboardPage = new DashboardPage(page);
3738
await dashboardPage.selectDatasource(CMK_EDITION.CEE);
@@ -94,7 +95,7 @@ test.describe('E2E tests', () => {
9495
await dashboardPage.addFilter(FilterTypes.HOSTNAME_REGEX);
9596
await dashboardPage.filterByHostnameRegex('localhost_grafana[0-9]+');
9697

97-
await expect(page.locator(GRAFANA_SELECTORS.SPINNER).first()).not.toBeVisible();
98+
await dashboardPage.expectSpinners(false);
9899

99100
await dashboardPage.selectPredefinedGraphType(GraphTypes.RAM_USAGE);
100101

@@ -213,6 +214,7 @@ test.describe('E2E tests', () => {
213214
});
214215

215216
test.describe('Raw edition tests', () => {
217+
test.slow();
216218
test('time-usage panel by service (Single host)', async ({ page }, testInfo) => {
217219
const dashboardPage = new DashboardPage(page);
218220
await dashboardPage.selectDatasource(CMK_EDITION.CRE);

0 commit comments

Comments
 (0)