Skip to content

Commit 561ee8f

Browse files
committed
meson: ci: test extensions
1 parent 6b336d8 commit 561ee8f

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.cirrus.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,32 @@ task:
378378
type: text/plain
379379

380380

381+
task:
382+
<<: *linux_opensuse_template
383+
384+
name: Linux - OpenSuse Tumbleweed Test Extensions (LLVM) - Meson
385+
386+
configure_script:
387+
- su postgres -c 'meson setup --buildtype debug -Dcassert=true -Dssl=openssl -Duuid=e2fs -Dllvm=enabled build'
388+
389+
build_script: su postgres -c 'ninja -C build'
390+
391+
install_script: ninja -C build install
392+
393+
dont_ask_sudo_pw_script:
394+
- echo "postgres ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/postgres
395+
396+
install_extensions_script: su postgres -c 'python3 src/tools/ci/test_extensions'
397+
398+
on_failure:
399+
<<: *on_failure
400+
401+
always:
402+
meson_log_artifacts:
403+
path: "build/meson-logs/*.txt"
404+
type: text/plain
405+
406+
381407
linux_rhel_template: &linux_rhel_template
382408
env:
383409
CPUS: 4

src/tools/ci/docker/linux_opensuse_tumbleweed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ RUN \
1212
meson \
1313
perl-IPC-Run \
1414
shadow \
15+
sudo \
1516
systemd-devel \
1617
util-linux \
1718
\

src/tools/ci/test_extensions

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import shutil
5+
import subprocess
6+
7+
clone_path = '/tmp/extension'
8+
extensions = []
9+
10+
# add pg_cron
11+
extensions.append(
12+
{
13+
'extension_name': 'pg_cron',
14+
'git_url': 'https://github.com/citusdata/pg_cron.git',
15+
'build_command': [
16+
['make'],
17+
['sudo', 'make', 'install']
18+
],
19+
'test_command': [
20+
['make', 'installcheck'],
21+
]
22+
}
23+
)
24+
25+
for extension in extensions:
26+
print('\n\n##### {} #####\n'.format(extension['extension_name']), flush=True)
27+
28+
# clear clone path
29+
if os.path.exists(clone_path) and os.path.isdir(clone_path):
30+
print('### Clearing {} ###'.format(clone_path), flush=True)
31+
shutil.rmtree(clone_path)
32+
33+
34+
# clone extension to the clone path
35+
print('\n\n### Cloning {} ###\n'.format(extension['extension_name']), flush=True)
36+
clone_command = ['git', 'clone', extension['git_url'], clone_path]
37+
subprocess.run(clone_command, check=True)
38+
39+
# build extension
40+
print('\n\n### Building {} ###\n'.format(extension['extension_name']), flush=True)
41+
for build_command in extension['build_command']:
42+
subprocess.run(build_command, check=True, cwd=clone_path)
43+
44+
# running extension tests
45+
print('\n\n### Running {} tests ###\n'.format(extension['extension_name']), flush=True)
46+
for test_command in extension['test_command']:
47+
subprocess.run(test_command, check=True, cwd=clone_path)
48+
49+
print('\n##### {} is completed #####\n\n'.format(extension['extension_name']), flush=True)

0 commit comments

Comments
 (0)