blob: ae9025a0b27723a66a0a25921f40b59b9dd8f5a5 [file] [log] [blame]
Marc Kupietzbfb23012025-06-03 15:47:10 +02001# GitLab CI/CD configuration for KorAP E2E Tests
2# This pipeline runs end-to-end tests against a KorAP instance
3
4stages:
5 - test
6
7variables:
8 # Default test configuration
9 KORAP_URL: "https://korap.ids-mannheim.de/"
10 KORAP_QUERIES: 'geht, [orth=geht & tt/p="VVFIN"]'
11 LC_ALL: "C"
12
13 # Node.js configuration
14 NODE_ENV: "test"
15
16# Main E2E test job
17e2e_tests:
18 stage: test
19 image: node:bullseye
20
21 # Install system dependencies required for Puppeteer
22 before_script:
23 - apt-get update
24 - apt-get install -y
25 wget
26 gnupg
27 ca-certificates
28 fonts-liberation
29 libasound2
30 libatk-bridge2.0-0
31 libatk1.0-0
32 libc6
33 libcairo2
34 libcups2
35 libdbus-1-3
36 libexpat1
37 libfontconfig1
38 libgbm1
39 libgcc1
40 libglib2.0-0
41 libgtk-3-0
42 libnspr4
43 libnss3
44 libpango-1.0-0
45 libpangocairo-1.0-0
46 libstdc++6
47 libx11-6
48 libx11-xcb1
49 libxcb1
50 libxcomposite1
51 libxcursor1
52 libxdamage1
53 libxext6
54 libxfixes3
55 libxi6
56 libxrandr2
57 libxrender1
58 libxss1
59 libxtst6
60 lsb-release
61 wget
62 xdg-utils
63 - npm install
64
65 script:
66 - echo "Running KorAP E2E tests against $KORAP_URL"
67 - npm run test:ci
68
69 after_script:
70 - echo "Test execution completed, checking for test results..."
71 - ls -la test-results.xml || echo "No test-results.xml found"
72
73 # Use CI variables for sensitive data
74 variables:
75 KORAP_LOGIN: $KORAP_USERNAME # Set this in GitLab CI/CD Variables
76 KORAP_PWD: $KORAP_PASSWORD # Set this in GitLab CI/CD Variables
77 SLACK_WEBHOOK_URL: $SLACK_WEBHOOK # Optional: Set for Slack notifications
78
79 # Generate test artifacts - always keep results even on test failure
80 artifacts:
81 when: always # Collect artifacts on success, failure, and cancellation
82 reports:
83 junit: test-results.xml # GitLab will parse this for test reporting
84 paths:
85 - "test-results.xml" # Keep the raw XML file as well
86 - "failed_*.png" # Screenshots of failed tests
87 expire_in: 1 week
88
89 # Retry on failure (network issues, etc.)
90 retry:
91 max: 2
92 when:
93 - unknown_failure
94 - api_failure
95 - runner_system_failure
96
97 # Pipeline trigger rules
98 rules:
99 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
100 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
101 - if: $CI_PIPELINE_SOURCE == "schedule" # Allow scheduled runs
102 - when: manual
103
104 # Set timeout
105 timeout: 5 minutes
106
107# Optional: Scheduled test job for regular monitoring
108scheduled_tests:
109 extends: e2e_tests
110 rules:
111 - if: $CI_PIPELINE_SOURCE == "schedule"
112 variables:
113 SLACK_WEBHOOK_URL: $SLACK_WEBHOOK # Enable notifications for scheduled runs