-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
executable file
·148 lines (139 loc) · 5 KB
/
.gitlab-ci.yml
File metadata and controls
executable file
·148 lines (139 loc) · 5 KB
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
include:
- project: 'shared/gitlab-ci-includes'
ref: main
file:
- '/base.yml'
- '/pypi-packages.yml'
- '/debian-packages.yml'
- '/python.yml'
variables:
APTLY_BASE_REPOSITORY: common
stages:
- test
- build
- publish
.unit test and feature test base:
script:
- !reference [.add repositories, script]
- pip install --no-cache-dir -r requirements/test.txt
- pip install .
.unit test and feature test add mariadb repository:
script:
- |
cat > /etc/apt/sources.list.d/mariadb.sources << EOF
Architectures: amd64 arm64 ppc64el
Components: main
X-Repolib-Name: mariadb
Signed-By: /etc/apt/keyrings/mariadb.asc
Suites: $DEBIAN_CODENAME
Types: deb
URIs: https://mirror.mariadb.org/repo/$MARIADB_VERSION/debian
EOF
- curl https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/keyrings/mariadb.asc
- apt-get update
- apt-get -y install mariadb-server
.unit test and feature test add postgresql repository:
script:
- |
cat > /etc/apt/sources.list.d/postgresql.sources << EOF
Components: main
X-Repolib-Name: postgresql
Signed-By: /etc/apt/keyrings/postgresql.asc
Suites: $DEBIAN_CODENAME-pgdg
Types: deb
URIs: http://apt.postgresql.org/pub/repos/apt
EOF
- curl https://www.postgresql.org/media/keys/ACCC4CF8.asc -o /etc/apt/keyrings/postgresql.asc
- apt-get update
- apt-get -y install postgresql-$POSTGRESQL_VERSION
unit test and feature test postgresql:
stage: test
image: python:3.13
services:
- name: postgres:$POSTGRESQL_VERSION
alias: postgres-gw0
- name: postgres:$POSTGRESQL_VERSION
alias: postgres-gw1
- name: postgres:$POSTGRESQL_VERSION
alias: postgres-gw2
variables:
POSTGRES_PASSWORD: 'AxXpDrd8hdEequRTNzKE6U6k'
script:
- !reference [.unit test and feature test base, script]
- !reference [.unit test and feature test add postgresql repository, script]
# -n may not be higher than the amount of services above
- pytest -n 3 tests/ -m postgresql -vvv --junitxml=report-pytest.xml
--mariadb-server-host=mariadb --postgresql-server-host=postgres --postgresql-server-password='AxXpDrd8hdEequRTNzKE6U6k' --mariadb-server-password='D8nngLmktFW7ACDWHvdRtmrV'
artifacts:
reports:
junit: report-*.xml
parallel:
matrix:
# Supported versions
- POSTGRESQL_VERSION: '13'
- POSTGRESQL_VERSION: '14'
- POSTGRESQL_VERSION: '15'
- POSTGRESQL_VERSION: '16'
unit test and feature test mariadb:
stage: test
image: python:3.13
services:
- name: mariadb:$MARIADB_VERSION
alias: mariadb-gw0
- name: mariadb:$MARIADB_VERSION
alias: mariadb-gw1
- name: mariadb:$MARIADB_VERSION
alias: mariadb-gw2
variables:
MYSQL_ROOT_PASSWORD: 'D8nngLmktFW7ACDWHvdRtmrV'
MYSQL_ROOT_HOST: '%'
script:
- !reference [.unit test and feature test base, script]
- !reference [.unit test and feature test add mariadb repository, script]
# -n may not be higher than the amount of services above
- pytest -n 3 tests/ -m mariadb -vvv --junitxml=report-pytest.xml
--mariadb-server-host=mariadb --postgresql-server-host=postgres --postgresql-server-password='AxXpDrd8hdEequRTNzKE6U6k' --mariadb-server-password='D8nngLmktFW7ACDWHvdRtmrV'
artifacts:
reports:
junit: report-*.xml
parallel:
matrix:
# LTS versions
- MARIADB_VERSION: '11.8'
# Previous unit tests and feature tests run for multiple versions of specific database server
# software. As those unit tests and feature tests run for specific pytest markers, they do not
# run with coverage. This unit test and feature test runs all tests for the most commonly used
# server software, with coverage.
unit test and feature test:
stage: test
image: python:3.13
services:
# Latest major versions
- name: mariadb:11.5
alias: mariadb-gw0
- name: mariadb:11.5
alias: mariadb-gw1
- name: mariadb:11.5
alias: mariadb-gw2
- name: postgres:18
alias: postgres-gw0
- name: postgres:18
alias: postgres-gw1
- name: postgres:18
alias: postgres-gw2
variables:
POSTGRES_PASSWORD: 'AxXpDrd8hdEequRTNzKE6U6k'
MYSQL_ROOT_PASSWORD: 'D8nngLmktFW7ACDWHvdRtmrV'
MYSQL_ROOT_HOST: '%'
script:
- export MARIADB_VERSION=11.8
- export POSTGRESQL_VERSION=14
- !reference [.unit test and feature test base, script]
- !reference [.unit test and feature test add mariadb repository, script]
- !reference [.unit test and feature test add postgresql repository, script]
# -n may not be higher than the amount of services above
- pytest -n 3 tests/ -vvv --cov-branch --cov=cyberfusion.DatabaseSupport --cov-config=.coveragerc --cov-fail-under=100 --junitxml=report-pytest.xml
--mariadb-server-host=mariadb --postgresql-server-host=postgres --postgresql-server-password='AxXpDrd8hdEequRTNzKE6U6k' --mariadb-server-password='D8nngLmktFW7ACDWHvdRtmrV'
artifacts:
reports:
junit: report-*.xml