Skip to content

Commit d5db173

Browse files
committed
Add proxy config for tests
1 parent 6cb211b commit d5db173

File tree

8 files changed

+880
-33
lines changed

8 files changed

+880
-33
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
run: npx playwright install chromium firefox
9292
- name: Run end to end tests
9393
working-directory: plugin/e2e
94-
run: npx playwright test
94+
run: npx playwright test -c playwright.config.js
9595
- name: Stop development server
9696
working-directory: plugin/runtime
9797
run: |

e2e/playwright.config.proxy.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// @ts-check
2+
const { defineConfig, devices } = require('@playwright/test');
3+
4+
/**
5+
* Read environment variables from file.
6+
* https://github.com/motdotla/dotenv
7+
*/
8+
// require('dotenv').config({ path: path.resolve(__dirname, '.env') });
9+
10+
/**
11+
* @see https://playwright.dev/docs/test-configuration
12+
*/
13+
module.exports = defineConfig({
14+
testDir: './tests',
15+
/* Run tests in files in parallel */
16+
fullyParallel: true,
17+
/* Fail the build on CI if you accidentally left test.only in the source code. */
18+
forbidOnly: !!process.env.CI,
19+
/* Retry on CI only */
20+
retries: process.env.CI ? 2 : 0,
21+
/* Opt out of parallel tests on CI. */
22+
workers: process.env.CI ? 1 : undefined,
23+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
24+
reporter: 'html',
25+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
26+
use: {
27+
/* Base URL to use in actions like `await page.goto('/')`. */
28+
baseURL: 'http://localhost:9000/graylog/',
29+
30+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
31+
trace: 'on-first-retry',
32+
},
33+
34+
/* Configure projects for major browsers */
35+
projects: [
36+
{
37+
name: 'chromium',
38+
use: { ...devices['Desktop Chrome'] },
39+
},
40+
41+
{
42+
name: 'firefox',
43+
use: { ...devices['Desktop Firefox'] },
44+
},
45+
46+
],
47+
48+
/* Run your local dev server before starting the tests */
49+
// webServer: {
50+
// command: 'npm run start',
51+
// url: 'http://127.0.0.1:3000',
52+
// reuseExistingServer: !process.env.CI,
53+
// },
54+
});
55+

runtime/docker-compose-common.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# sources of inspiration for this file
2+
# * https://go2docs.graylog.org/5-1/downloading_and_installing_graylog/docker_installation.htm
3+
# * https://github.com/Graylog2/docker-compose
4+
5+
services:
6+
7+
# MongoDB: https://hub.docker.com/_/mongo/
8+
mongo:
9+
image: "mongo:6.0"
10+
container_name: mongo
11+
networks:
12+
- eh-network
13+
# uncomment to expose mongodb on localhost:27017
14+
# ports:
15+
# - 27017:27017
16+
17+
# OpenSearch:
18+
# * https://hub.docker.com/r/opensearchproject/opensearch
19+
# * https://opensearch.org/docs/2.15/install-and-configure/install-opensearch/docker/#sample-docker-composeyml
20+
opensearch:
21+
image: "opensearchproject/opensearch:2.15.0"
22+
container_name: opensearch2.15
23+
environment:
24+
- plugins.security.disabled=true
25+
- discovery.type=single-node
26+
- action.auto_create_index=false
27+
- bootstrap.memory_lock=true
28+
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=T3st-P@ssword!
29+
ulimits:
30+
memlock:
31+
soft: -1
32+
hard: -1
33+
ports:
34+
- 9200:9200
35+
networks:
36+
- eh-network
37+
38+
networks:
39+
eh-network:
40+
name: eh-network
41+
driver: bridge
42+

runtime/docker-compose-proxy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
include:
2+
- docker-compose-common.yml
3+
4+
# sources of inspiration for this file
5+
# * https://go2docs.graylog.org/5-1/downloading_and_installing_graylog/docker_installation.htm
6+
# * https://github.com/Graylog2/docker-compose
7+
8+
services:
9+
10+
# Graylog: https://hub.docker.com/r/graylog/graylog/
11+
graylog:
12+
image: "graylog/graylog:6.1.4"
13+
container_name: graylog
14+
links:
15+
- mongo:mongo
16+
- opensearch
17+
depends_on:
18+
- mongo
19+
- opensearch
20+
ports:
21+
# Graylog web interface and REST API
22+
- 9000:9000
23+
# Raw/Plaintext TCP
24+
- 5555:5555
25+
# Syslog TCP
26+
- 514:514
27+
# Syslog UDP
28+
- 514:514/udp
29+
# GELF TCP
30+
- 12201:12201
31+
# GELF UDP
32+
- 12201:12201/udp
33+
volumes:
34+
- ./graylog/config-proxy:/usr/share/graylog/data/config
35+
- ./graylog/plugin:/usr/share/graylog/plugin/
36+
healthcheck:
37+
test: curl --head --fail http://localhost:9000/graylog || exit 1
38+
start_period: 60s
39+
networks:
40+
- eh-network
41+
42+
networks:
43+
eh-network:
44+
name: eh-network
45+
driver: bridge
46+

runtime/docker-compose.yml

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,12 @@
1+
include:
2+
- docker-compose-common.yml
3+
14
# sources of inspiration for this file
25
# * https://go2docs.graylog.org/5-1/downloading_and_installing_graylog/docker_installation.htm
36
# * https://github.com/Graylog2/docker-compose
47

58
services:
69

7-
# MongoDB: https://hub.docker.com/_/mongo/
8-
mongo:
9-
image: "mongo:6.0"
10-
container_name: mongo
11-
networks:
12-
- eh-network
13-
# uncomment to expose mongodb on localhost:27017
14-
# ports:
15-
# - 27017:27017
16-
17-
# OpenSearch:
18-
# * https://hub.docker.com/r/opensearchproject/opensearch
19-
# * https://opensearch.org/docs/2.15/install-and-configure/install-opensearch/docker/#sample-docker-composeyml
20-
opensearch:
21-
image: "opensearchproject/opensearch:2.15.0"
22-
container_name: opensearch2.15
23-
environment:
24-
- plugins.security.disabled=true
25-
- discovery.type=single-node
26-
- action.auto_create_index=false
27-
- bootstrap.memory_lock=true
28-
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=T3st-P@ssword!
29-
ulimits:
30-
memlock:
31-
soft: -1
32-
hard: -1
33-
ports:
34-
- 9200:9200
35-
networks:
36-
- eh-network
37-
38-
3910
# Graylog: https://hub.docker.com/r/graylog/graylog/
4011
graylog:
4112
image: "graylog/graylog:6.1.4"

0 commit comments

Comments
 (0)