-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
156 lines (152 loc) · 4.6 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
variables:
BASE_IMAGE_NAME: "web-ui"
.parallel:
parallel:
matrix:
- COMPOSE_ALIAS: "PcsRhel10Next"
PCS_BRANCH: "main"
OS_TAG: "centos10"
- COMPOSE_ALIAS: "PcsFedoraCurrentRelease"
PCS_BRANCH: "main"
OS_TAG: "generic"
- COMPOSE_ALIAS: ["PcsRhel9CurrentRelease", "PcsRhel9Next"]
PCS_BRANCH: "pcs-0.11"
OS_TAG: [""]
rules:
# WORKERAOUND URL to a specific artifacts by a job id in case of failed pcs pipeline
# - if: $OS_TAG == "centos10"
# variables:
# PCS_ARTIFACTS_URL: "${CI_API_V4_URL}/projects/pcs%2Fpcs/jobs/23333413/artifacts"
- if: $OS_TAG != ""
variables:
PCS_ARTIFACTS_URL: "${CI_API_V4_URL}/projects/pcs%2Fpcs/jobs/artifacts/${PCS_BRANCH}/download?job=rpm_build%3A%20%5B${COMPOSE_ALIAS}%2C%20${OS_TAG}%5D"
- if: $OS_TAG == ""
variables:
PCS_ARTIFACTS_URL: "${CI_API_V4_URL}/projects/pcs%2Fpcs/jobs/artifacts/${PCS_BRANCH}/download?job=rpm_build%3A%20%5B${COMPOSE_ALIAS}%5D"
# avoid running duplicate pipelines
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
pcsd_integration_test:
extends: .parallel
script:
#
#
# check no nexus proxy in resoulved urls in package-lock.json files
#
- make check_sources
#
#
# install playwright dependencies
#
- dnf install -y
alsa-lib
atk
at-spi2-atk
at-spi2-core
cairo
cups-libs
libdrm
libwayland-client
libX11
libxcb
libXcomposite
libXdamage
libXext
libXfixes
libxkbcommon
libXrandr
mesa-libgbm
pango
#
#
# install other dependencies
#
- dnf install -y
npm
cockpit-bridge
fence-agents-all
#
#
# install current version of pcs
#
# https://docs.gitlab.com/ee/api/job_artifacts.html#download-the-artifacts-archive
- "curl --fail-with-body --location --insecure --output artifacts.zip --header \"JOB-TOKEN: ${CI_JOB_TOKEN}\" \"${PCS_ARTIFACTS_URL}\""
- unzip artifacts.zip
- "dnf install -y rpms/pcs-*.rpm"
- rm -rf rpms/ artifacts.zip
#
#
# build and install webui
#
- make init_nexus NEXUS_CERT_PATH="${NEXUS_CERT_PATH}"
- make modules-prepare
- make modules-patch
- export BUILD_USE_CURRENT_NODE_MODULES=true
#
- export BUILD_DIR="$(pwd)"/build-standalone
- make build
- mv "$BUILD_DIR" /usr/lib64/pcsd/public/ui
#
- export BUILD_FOR_COCKPIT=true
- export BUILD_DIR="$(pwd)"/build-cockpit
- make build
- mv "$BUILD_DIR" /usr/share/cockpit/ha-cluster
#
#
# prepare environment for test (all)
#
- make test-modules-prepare
- export PCSD_PROTOCOL_1=https
- export PCSD_HOST_1=localhost
- export PCSD_NODE_1=wuitest
- export PCSD_USERNAME_1="hacluster"
- export PCSD_PASSWORD_1=hh
- export PCS_WUI_TESTS_HEADLESS=true
- export PCS_WUI_TESTS_VIDEO_DIR=.test-records
- export PCS_WUI_TEST_TIMEOUT=1000000
- systemctl enable pcsd --now
# hacluster user should already exists
- echo "$PCSD_PASSWORD_1" | passwd "$PCSD_USERNAME_1" --stdin
# tests expects that pcs is authenticated against the node
- echo "127.0.0.1 $PCSD_NODE_1" >> /etc/hosts
- pcs host auth "$PCSD_NODE_1" -u "$PCSD_USERNAME_1" -p "$PCSD_PASSWORD_1"
- mkdir "$PCS_WUI_TESTS_VIDEO_DIR"
- ln /var/log/pcsd/pcsd.log "$PCS_WUI_TESTS_VIDEO_DIR/pcsd.log"
#
#
# test (standalone)
#
- export PCS_WUI_TEST_TYPE="standalone"
- export PCSD_PORT_1=2224
- make ci-cluster-test
#
#
# test (cockpit)
#
# It is disabled for now. The main reason is that tests require to wait for
# a response e.g. `await page.waitForResponse(/.*\/imported-cluster-list$/)`
# after cluster setup before continue. These responses are encapsulated in
# cockpit mechanism, so are invisible for playwright. There are more options
# how to deal with it:
# 1) introduce extra events for cockpit (and playwright will wait for it)
# 2) rewrite test to eliminate a need to wait for a response if it is
# feasible (e.g. when something appear in the page).
#
# - systemctl enable cockpit --now
# - usermod --shell /bin/bash "$PCSD_USERNAME_1"
# - export PCS_WUI_TEST_TYPE="cockpit"
# - export PCSD_PORT_1=9090
# - make ci-cluster-test
artifacts:
when: on_failure
paths:
- .test-records/
exclude:
- node_modules/
- .npmrc
expire_in: 1 week