fix: use PostgreSQL mode for meson test initdb template#1180
fix: use PostgreSQL mode for meson test initdb template#1180gaoxueyu merged 5 commits intoIvorySQL:masterfrom
Conversation
IvorySQL's initdb defaults to Oracle mode (-m oracle), which caused meson tests to fail because the initdb template contained Oracle- specific types and extensions (oracharchar, number, dual table, etc.). Changes: - Add `-m pg` option to initdb_cache test in meson.build - Remove Oracle-specific tests from meson (ivorysql_ora, ora_btree_gin, ora_btree_gist, plisql) - they are still available via make - Add missing gb18030_and_gbk encoding to meson.build Test results: - Regression tests: 228/228 passed - Full meson test: 315 passed, 24 skipped, 0 failed
📝 WalkthroughWalkthroughRemoved Meson test declarations from three contrib modules, added a multibyte encoding entry, changed an initdb invocation to include Changes
Sequence Diagram(s)sequenceDiagram
participant GH as "GitHub Actions\n(runner)" rgba(59,130,246,0.5)
participant Meson as "Meson/Ninja build" rgba(16,185,129,0.5)
participant InitDB as "initdb (-m pg)" rgba(234,88,12,0.5)
participant Test as "meson test\n(regress/TAP runner)" rgba(168,85,247,0.5)
participant Artifacts as "Artifact storage\n/log collector" rgba(250,204,21,0.5)
GH->>Meson: configure (build dir, cassert=true, buildtype=debug)
GH->>Meson: ninja build
Meson->>InitDB: start cluster (test_initdb_cache with -m pg)
Meson->>Test: run tests (meson test)
Test->>Artifacts: stream logs
GH->>Artifacts: compress & upload test-logs.tar.gz on failure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/meson_build_pg_test.yml:
- Around line 46-51: The CI step named "run postgres test" currently uses both
"meson test || true" and "continue-on-error: true", which hides failures; to
make test failures visible but non-blocking, remove the "|| true" from the run
command so the step records a failure (retain continue-on-error: true to keep
the job continuing), or if you want CI to fail on test failures remove
"continue-on-error: true" instead; update the run block for the "run postgres
test" step accordingly.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/meson_build_pg_test.yml:
- Line 18: The job name value "dependancy - linux" contains a typo; update the
YAML key value for the job name (the 'name' entry currently set to "dependancy -
linux") to read "dependency - linux" so the workflow label is spelled correctly.
🧹 Nitpick comments (3)
.github/workflows/meson_build_pg_test.yml (3)
17-17: Consider updating toactions/checkout@v4.Version 4 is the current release with improved performance and Node.js 20 support.
Suggested change
- - uses: actions/checkout@v3 + - uses: actions/checkout@v4
27-33: Usepip installinstead of deprecatedsetup.py install.
setup.py installis deprecated. Consider using pip for a more maintainable and modern installation approach.Suggested fix
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 curl -L "https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-linux.zip" -o ninja-linux.zip unzip -o ninja-linux.zip sudo cp ninja /usr/bin/ - tar xzf meson-1.0.1.tar.gz - cd meson-1.0.1 - sudo python3 setup.py install + sudo pip3 install meson==1.0.1Alternatively, consider using GitHub-hosted runner's package manager or a setup action for reproducible tooling.
90-99: Consider uploading a minimal artifact on success for audit/debugging.Currently, artifacts are only uploaded on failure. The compressed
test-logs.tar.gzis created in the prior step but not uploaded on success. For traceability of flaky tests or historical debugging, consider adding a conditional upload-on-success with shorter retention.Example addition for success case
- name: upload test summary if: success() uses: actions/upload-artifact@v4 with: name: postgres-test-summary-${{ github.sha }} path: ${{ github.workspace }}/test-logs/SUMMARY.txt retention-days: 7
In meson mode, the script was opening the output file with truncate mode (>), which created an empty file before meson could capture the STDOUT output. This resulted in an empty extension file. Now in meson mode: - Do not open the output file (avoiding the truncate) - Output all content to STDOUT, which meson captures via --capture Make mode remains unchanged - it opens and writes to the file directly. This aligns with the pattern used by other scripts like generate-plerrcodes.pl and gb18030_2022's generation.
Summary
-m pg) when creating initdb templatemake oracle-check)gb18030_and_gbkencoding to meson buildProblem
IvorySQL's
initdbdefaults to Oracle mode (-m oracle). The meson build creates an initdb template without specifying the mode, which resulted in:Solution
Add
-m pgoption to theinitdb_cachetest inmeson.buildto create the template in PostgreSQL mode.Test Plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.