Skip to content

Commit 3a40b6a

Browse files
authored
Merge pull request IvorySQL#1180 from OreoYang/feat/meson_test_by_bigmodel
fix: use PostgreSQL mode for meson test initdb template
2 parents b1a4272 + 7a827cc commit 3a40b6a

9 files changed

Lines changed: 143 additions & 162 deletions

File tree

.github/workflows/meson_build.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: meson_build
2+
3+
on:
4+
push:
5+
branches: [ master , IVORY_REL_4_STABLE ]
6+
pull_request:
7+
branches: [ master , IVORY_REL_4_STABLE ]
8+
9+
jobs:
10+
meson_build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: dependency - linux
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y build-essential git lcov bison flex \
22+
libkrb5-dev libssl-dev libldap-dev libpam-dev python3-dev \
23+
tcl-dev libperl-dev gettext libxml2-dev libxslt-dev \
24+
libreadline-dev libedit-dev uuid-dev libossp-uuid-dev \
25+
libipc-run-perl libtime-hires-perl libtest-simple-perl \
26+
libgssapi-krb5-2 libicu-dev
27+
curl -L "https://github.com/mesonbuild/meson/releases/download/1.0.1/meson-1.0.1.tar.gz" -o meson-1.0.1.tar.gz
28+
curl -L "https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-linux.zip" -o ninja-linux.zip
29+
unzip -o ninja-linux.zip
30+
sudo cp ninja /usr/bin/
31+
tar xzf meson-1.0.1.tar.gz
32+
cd meson-1.0.1
33+
sudo python3 setup.py install
34+
35+
- name: configure - linux
36+
if: ${{ matrix.os == 'ubuntu-latest' }}
37+
run: |
38+
meson setup build \
39+
-Dcassert=true \
40+
-Dbuildtype=debug
41+
42+
- name: compile
43+
run: |
44+
cd build && ninja
45+
46+
- name: run postgres test
47+
id: test_postgres
48+
run: |
49+
cd build
50+
meson test --verbose --no-rebuild
51+
timeout-minutes: 30
52+
53+
- name: collect test logs
54+
if: always()
55+
run: |
56+
mkdir -p ${{ github.workspace }}/test-logs
57+
58+
# Collect Meson test logs
59+
if [ -d build/meson-logs ] && [ "$(ls -A build/meson-logs 2>/dev/null)" ]; then
60+
cp build/meson-logs/* ${{ github.workspace }}/test-logs/ 2>/dev/null || true
61+
echo "Copied meson log"
62+
else
63+
echo "No meson log found"
64+
fi
65+
66+
# test results
67+
if [ -d build/testrun ]; then
68+
find build/testrun -type f \( -name "*.log" -o -name "*.diff" -o -name "regression.diffs" \) -exec cp {} ${{ github.workspace }}/test-logs/ \; 2>/dev/null || true
69+
echo "Collected test run logs"
70+
fi
71+
72+
# create summary
73+
{
74+
echo "IvorySQL Meson Test Summary"
75+
echo "=========================="
76+
echo "Workflow: ${{ github.workflow }}"
77+
echo "Run ID: ${{ github.run_id }}"
78+
echo "Run Number: ${{ github.run_number }}"
79+
echo "Commit: ${{ github.sha }}"
80+
echo "Branch: ${{ github.ref }}"
81+
echo "Event: ${{ github.event_name }}"
82+
echo "Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
83+
} > ${{ github.workspace }}/test-logs/SUMMARY.txt
84+
85+
# Compress logs
86+
cd ${{ github.workspace }}
87+
tar -czf test-logs.tar.gz test-logs/
88+
echo "Compressed test logs: $(du -h test-logs.tar.gz | cut -f1)"
89+
90+
- name: upload failure logs (raw directories for deep debugging)
91+
if: failure()
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: postgres-test-failures-${{ github.sha }}.raw
95+
path: |
96+
build/meson-logs/
97+
build/testrun/
98+
retention-days: 30
99+
compression-level: 6

contrib/ivorysql_ora/gensql.pl

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -80,46 +80,31 @@ sub sql_merge
8080
shift @ARGV;
8181
foreach my $v (@ARGV)
8282
{
83-
# Delete ivorysql_ora--x.x(--x.x).sql files generated before.
84-
unlink(File::Spec->rel2abs("ivorysql_ora--$v.sql"))
85-
if (-e File::Spec->rel2abs("ivorysql_ora--$v.sql"));
83+
# For Make mode, delete the old file first.
84+
if ($first_arg ne 'meson') {
85+
unlink(File::Spec->rel2abs("ivorysql_ora--$v.sql"))
86+
if (-e File::Spec->rel2abs("ivorysql_ora--$v.sql"));
8687

87-
# Open(create if necessary) ivorysql_ora--x.x(--x.x).sql.
88-
if ($first_arg eq 'meson'){
89-
open(OUTFILE, ">contrib/ivorysql_ora/ivorysql_ora--$v.sql")
90-
|| croak "Could not open ivorysql_ora--$v.sql : $!";
91-
}
92-
else {
88+
# Open output file for Make mode (meson mode uses STDOUT captured by meson)
9389
open(OUTFILE, ">ivorysql_ora--$v.sql")
94-
|| croak "Could not open ivorysql_ora--$v.sql : $!";
90+
|| croak "Could not open ivorysql_ora--$v.sql : $!";
9591
}
9692

97-
# Write "extension file loading information" into it.
93+
# Write "extension file loading information".
9894
# Create extension when this version is "x.x".
9995
if ($v =~ /^\d+\.\d+$/)
10096
{
101-
if ($first_arg eq 'meson'){
102-
print STDOUT '\echo Use "CREATE EXTENSION ivorysql_ora"';
103-
print STDOUT " to load this file. \\quit\n";
104-
}
105-
else
106-
{
107-
print OUTFILE '\echo Use "CREATE EXTENSION ivorysql_ora"';
108-
print OUTFILE " to load this file. \\quit\n";
109-
}
97+
my $fh = ($first_arg eq 'meson') ? *STDOUT : *OUTFILE;
98+
print $fh '\echo Use "CREATE EXTENSION ivorysql_ora"';
99+
print $fh " to load this file. \\quit\n";
110100
}
111101
# Update extension when this version is "x.x--x.x".
112102
elsif ($v =~ /^\d+\.\d+\-\-\d+\.\d+$/)
113103
{
114104
my $up2ver = (split("--", $v))[1];
115-
if ($first_arg eq 'meson'){
116-
print STDOUT '\echo Use "ALTER EXTENSION ivorysql_ora UPDATE';
117-
print STDOUT " TO \'$up2ver\'\" to load this file. \\quit\n";
118-
}
119-
else{
120-
print OUTFILE '\echo Use "ALTER EXTENSION ivorysql_ora UPDATE';
121-
print OUTFILE " TO \'$up2ver\'\" to load this file. \\quit\n";
122-
}
105+
my $fh = ($first_arg eq 'meson') ? *STDOUT : *OUTFILE;
106+
print $fh '\echo Use "ALTER EXTENSION ivorysql_ora UPDATE';
107+
print $fh " TO \'$up2ver\'\" to load this file. \\quit\n";
123108
}
124109
else
125110
{
@@ -135,25 +120,23 @@ sub sql_merge
135120
if (-e "$set--$v.sql")
136121
{
137122
# Add a newline.
138-
print OUTFILE "\n";
123+
my $fh = ($first_arg eq 'meson') ? *STDOUT : *OUTFILE;
124+
print $fh "\n";
125+
139126
# Open a sql file.
140127
open(INFILE, "<", File::Spec->rel2abs("$set--$v.sql"));
141128
while (my $line = <INFILE>)
142129
{
143130
# Delete the last tailing "\n" of this line.
144131
chomp($line);
145132
# Write.
146-
if ($first_arg eq 'meson'){
147-
print STDOUT "$line\n";
148-
}
149-
else{
150-
print OUTFILE "$line\n";
151-
}
133+
print $fh "$line\n";
152134
}
153135
close INFILE;
154136
}
155137
}
156138

157-
close OUTFILE;
139+
# Close OUTFILE for Make mode (meson mode doesn't open it)
140+
close OUTFILE if ($first_arg ne 'meson');
158141
}
159142
}

contrib/ivorysql_ora/meson.build

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,3 @@ install_data(
5959
'preload_ora_misc.sql',
6060
install_dir: dir_data,
6161
)
62-
63-
tests += {
64-
'name': 'ivorysql_ora',
65-
'sd': meson.current_source_dir(),
66-
'bd': meson.current_build_dir(),
67-
'regress': {
68-
'sql': [
69-
'check',
70-
'check_btree',
71-
'check_heap',
72-
],
73-
},
74-
'tap': {
75-
'tests': [
76-
't/001_verify_heapam.pl',
77-
't/002_cic.pl',
78-
't/003_cic_2pc.pl',
79-
],
80-
},
81-
}

contrib/ora_btree_gin/meson.build

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,3 @@ install_data(
2222
'ora_btree_gin--1.0.sql',
2323
kwargs: contrib_data_args,
2424
)
25-
26-
tests += {
27-
'name': 'ora_btree_gin',
28-
'sd': meson.current_source_dir(),
29-
'bd': meson.current_build_dir(),
30-
'regress': {
31-
'sql': [
32-
'init',
33-
'number',
34-
'varchar2',
35-
'binary_float',
36-
'binary_double',
37-
'date',
38-
'timestamp',
39-
'timestamptz',
40-
'timestampltz',
41-
],
42-
},
43-
}

contrib/ora_btree_gist/meson.build

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,3 @@ install_data(
3333
'ora_btree_gist--1.0.sql',
3434
kwargs: contrib_data_args,
3535
)
36-
37-
tests += {
38-
'name': 'ora_btree_gist',
39-
'sd': meson.current_source_dir(),
40-
'bd': meson.current_build_dir(),
41-
'regress': {
42-
'sql': [
43-
'init',
44-
'number',
45-
'varchar2',
46-
'binary_float',
47-
'binary_double',
48-
'date',
49-
'timestamp',
50-
'timestamptz',
51-
'timestampltz',
52-
'yminterval',
53-
'dsinterval',
54-
],
55-
},
56-
}

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3595,6 +3595,7 @@ sys.exit(sp.returncode)
35953595
''',
35963596
test_initdb_template,
35973597
temp_install_bindir / 'initdb',
3598+
'-m', 'pg',
35983599
'--auth', 'trust', '--no-sync', '--no-instructions', '--lc-messages=C',
35993600
'--no-clean'
36003601
],

src/backend/utils/mb/conversion_procs/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ encodings = {
1010
'euc_tw_and_big5/euc_tw_and_big5.c',
1111
'euc_tw_and_big5/big5.c',
1212
],
13+
'gb18030_and_gbk': ['gb18030_and_gbk/gb18030_and_gbk.c'],
1314
'latin2_and_win1250': ['latin2_and_win1250/latin2_and_win1250.c'],
1415
'latin_and_mic': ['latin_and_mic/latin_and_mic.c'],
1516
'utf8_and_big5': ['utf8_and_big5/utf8_and_big5.c'],

src/pl/plisql/src/meson.build

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,28 @@ install_headers(
7373
install_dir: dir_include_server
7474
)
7575

76-
77-
tests += {
78-
'name': 'plisql',
79-
'sd': meson.current_source_dir(),
80-
'bd': meson.current_build_dir(),
81-
'regress': {
82-
'sql': [
83-
'plisql_array',
84-
'plisql_call',
85-
'plisql_control',
86-
'plisql_copy',
87-
'plisql_domain',
88-
'plisql_record',
89-
'plisql_cache',
90-
'plisql_simple',
91-
'plisql_transaction',
92-
'plisql_trap',
93-
'plisql_trigger',
94-
'plisql_varprops',
95-
],
96-
},
97-
}
76+
# IvorySQL: plisql is Oracle-compatible procedural language, not needed in meson test
77+
# Use 'make oracle-check' to run plisql tests
78+
# tests += {
79+
# 'name': 'plisql',
80+
# 'sd': meson.current_source_dir(),
81+
# 'bd': meson.current_build_dir(),
82+
# 'regress': {
83+
# 'sql': [
84+
# 'plisql_array',
85+
# 'plisql_call',
86+
# 'plisql_control',
87+
# 'plisql_copy',
88+
# 'plisql_domain',
89+
# 'plisql_record',
90+
# 'plisql_cache',
91+
# 'plisql_simple',
92+
# 'plisql_transaction',
93+
# 'plisql_trap',
94+
# 'plisql_trigger',
95+
# 'plisql_varprops',
96+
# ],
97+
# },
98+
# }
9899

99100
subdir('po', if_found: libintl)

0 commit comments

Comments
 (0)