-
Notifications
You must be signed in to change notification settings - Fork 16
98 lines (77 loc) · 3.99 KB
/
integration_tests.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
name: Basic Integration Tests
on:
pull_request:
push:
branches:
- main
jobs:
config:
strategy:
fail-fast: false
matrix:
psql_version: ['12.13', '13.9', '14.4', '15.1']
python_version: ['3.6', '3.8', '3.9', '3.10']
# Python 3.6 is not available on ubuntu-22.04
# see: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
name: PostgreSQL ${{ matrix.psql_version }} and Python ${{ matrix.python_version }} integration test
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Show Python version
run: python --version
- name: Install needed tools
run: |
sudo apt install python3-bpfcc systemtap-sdt-dev flex bison lcov build-essential libxml2-dev libssl-dev zlib1g-dev libreadline-dev
- name: Cache PostgreSQL build ${{ matrix.psql_version }}
id: postgresql-cache
uses: actions/cache@v3
with:
path: ~/postgresql
key: postgresql-${{ matrix.psql_version }}-${{ hashFiles('.github/workflows/*') }}
- name: Build PostgreSQL
if: steps.postgresql-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/postgresql
mkdir -p ~/postgresql/src/${{ matrix.psql_version }}
mkdir -p ~/postgresql/bin/${{ matrix.psql_version }}
# Data dir is not part of the cache
mkdir -p ~/postgresql_data/${{ matrix.psql_version }}
cd ~/postgresql/src/${{ matrix.psql_version }}
wget -q -O postgresql.tar.bz2 https://ftp.postgresql.org/pub/source/v${{ matrix.psql_version }}/postgresql-${{ matrix.psql_version }}.tar.bz2
tar jxf postgresql.tar.bz2 --strip-components 1 -C .
CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer" ./configure --prefix=$HOME/postgresql/bin/${{ matrix.psql_version }} --with-openssl --with-readline --with-zlib --with-libxml --enable-dtrace
make -j 8
- name: Install PostgreSQL
run: |
cd ~/postgresql/src/${{ matrix.psql_version }}
make install
~/postgresql/bin/${{ matrix.psql_version }}/bin/initdb -D ~/postgresql_data/${{ matrix.psql_version }}
~/postgresql/bin/${{ matrix.psql_version }}/bin/pg_ctl -D ~/postgresql_data/${{ matrix.psql_version }} start
#sudo apt install curl ca-certificates gnupg
#sudo curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
#sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
#sudo apt update
#sudo apt install postgresql-${{ matrix.psql_version }} postgresql-${{ matrix.psql_version }}-dbgsym
#sudo /etc/init.d/postgresql start ${{ matrix.psql_version }}
#dpkg -L postgresql-${{ matrix.psql_version }}-dbgsym
#readelf --string-dump=.gnu_debuglink /usr/lib/postgresql/${{ matrix.psql_version }}/bin/postgres
#objdump -TC /usr/lib/postgresql/${{ matrix.psql_version }}/bin/postgres
- name: Install package
run: sudo python -m pip install .
- name: Check that pg_lock_tracer can be executed
run: |
pg_lock_tracer --version
sudo pg_lock_tracer -x ~/postgresql/bin/${{ matrix.psql_version }}/bin/postgres -v -p $(pidof postgres) --statistics --dry-run
- name: Check that pg_lw_lock_tracer can be executed
run: |
pg_lw_lock_tracer --version
sudo pg_lw_lock_tracer -p $(pidof postgres) --dry-run
- name: Check that animate_lock_graph can be executed
run: |
animate_lock_graph --version
animate_lock_graph -o animation.html -i examples/create_table_trace.json
diff animation.html -i examples/create_table_trace.html