Skip to content

Commit

Permalink
ci: support precheck for v15
Browse files Browse the repository at this point in the history
Also, some issue is fixed. Temporarily disable pgvector due to it is
unstable.
  • Loading branch information
mrdrivingduck authored and polardb-bot[bot] committed Sep 5, 2024
1 parent ade7f2d commit a3ba87d
Show file tree
Hide file tree
Showing 55 changed files with 3,513 additions and 19 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. xxx
2. xxx
3. xxx

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. CentOS 7]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Question
about: Ask question about anything here.
title: "[Question]"
labels: question
assignees: ''

---

**Describe the problem**

...
90 changes: 90 additions & 0 deletions .github/workflows/precheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: precheck

on:
push:
branches: [ POLARDB_15_STABLE ]
paths:
- '.github/workflows/precheck.yml'
- 'config/**'
- 'contrib/**'
- 'external/**'
- 'src/**'
- 'configure*'
- 'build.sh'
pull_request:
branches: [ POLARDB_15_STABLE ]
paths:
- '.github/workflows/precheck.yml'
- 'config/**'
- 'contrib/**'
- 'external/**'
- 'src/**'
- 'configure*'
- 'build.sh'
# trigger testing manually
workflow_dispatch:

jobs:
regression:
runs-on: ubuntu-latest
strategy:
matrix:
container_image: [ rocky8, rocky9, ubuntu22.04 ]
rules: [ precheck-main, plcheck ]
debug_mode: [ on, off ]
steps:
- name: fetch source code
uses: actions/checkout@v4

- name: free disk space
run: |
df -h
sudo rm -rf .git
sudo swapoff -a
sudo rm -f /swapfile
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
sudo apt autoremove -y
sudo apt clean -y
docker rmi $(docker image ls -aq)
df -h
- name: limit WAL size
run: |
grep -n "DEFAULT_XLOG_SEG_SIZE" src/include/pg_config_manual.h | cut -d: -f1 | xargs -I {} sed -i '{}s/.*/#define DEFAULT_XLOG_SEG_SIZE (16*1024*1024)/' src/include/pg_config_manual.h
- name: ignore unstable cases
run: |
sed -i 's/SUBDIRS += pgvector/# &/' external/Makefile
- name: create and start the container
run: |
docker create \
-t \
--name polardb_${{ matrix.container_image }} \
-v `pwd`:/home/postgres/PolarDB-for-PostgreSQL \
polardb/polardb_pg_devel:${{ matrix.container_image }} \
bash && \
docker start polardb_${{ matrix.container_image }}
- name: change ownership of the source code
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
sudo chown -R postgres:postgres ./"
- name: build and run checks
run: |
docker exec \
polardb_${{ matrix.container_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \
./build.sh --wr=1 --debug=${{ matrix.debug_mode }} --ec='--enable-tap-tests' && \
make ${{ matrix.rules }} -j4"
- name: change ownership of the source code back
run: |
sudo chown -R runner:runner `pwd`
42 changes: 42 additions & 0 deletions .github/workflows/sync-postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: sync with postgres upstream

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
repo-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: repo-sync-master
uses: repo-sync/github-sync@v2
with:
source_repo: https://github.com/postgres/postgres.git
source_branch: master
destination_branch: master
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: repo-sync-17
uses: repo-sync/github-sync@v2
with:
source_repo: https://github.com/postgres/postgres.git
source_branch: REL_17_STABLE
destination_branch: REL_17_STABLE
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: repo-sync-16
uses: repo-sync/github-sync@v2
with:
source_repo: https://github.com/postgres/postgres.git
source_branch: REL_16_STABLE
destination_branch: REL_16_STABLE
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: repo-sync-15
uses: repo-sync/github-sync@v2
with:
source_repo: https://github.com/postgres/postgres.git
source_branch: REL_15_STABLE
destination_branch: REL_15_STABLE
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ cpluspluscheck: submake-generated-headers
# POLAR
#
LAST_COMMIT = HEAD~1
PROVE_FLAGS = "--timer -j4"
PROVE_FLAGS = "--timer"

precheck-main: | temp-install
$(MAKE) check-world EXTRA_TESTS=numeric_big PG_TEST_EXTRA='kerberos ldap ssl' USE_MODULE_DB=1 PROVE_FLAGS=$(PROVE_FLAGS)
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function compile() {
configure_flag+=" --prefix=$base_dir --with-pgport=$port ${extra_configure_flag-}"
info "Begin configure, flag: $configure_flag"
./configure $configure_flag
info "Begin compile and install PolarDB"
info "Begin compile and install PolarDB, flag: $make_flag"
make install-world-bin $make_flag
}

Expand Down
4 changes: 1 addition & 3 deletions external/hll/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
/log/
/results/
/tmp_check/
regression.out
regression.diffs

binary.dat
.deps/
*.sql
/*.sql
75 changes: 75 additions & 0 deletions external/hll/sql/add_agg.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
-- ----------------------------------------------------------------
-- Regression tests for add aggregate hashval function.
-- ----------------------------------------------------------------

SELECT hll_set_output_version(1);

DROP TABLE IF EXISTS test_khvengxf;

CREATE TABLE test_khvengxf (
val integer
);

insert into test_khvengxf(val) values (1), (2), (3);

-- Check default and explicit signatures.

select hll_print(hll_add_agg(hll_hash_integer(val)))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4, 512))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4, -1))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4, 512, 0))
from test_khvengxf;

-- Check range checking.

select hll_print(hll_add_agg(hll_hash_integer(val), -1))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 32))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, -1))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 8))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4, -2))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4, 8589934592))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4, 512, -1))
from test_khvengxf;

select hll_print(hll_add_agg(hll_hash_integer(val), 10, 4, 512, 2))
from test_khvengxf;

-- Check that we return hll_empty on null input.

select hll_print(hll_add_agg(NULL));

select hll_print(hll_add_agg(NULL, 10));

select hll_print(hll_add_agg(NULL, 10, 4));

select hll_print(hll_add_agg(NULL, 10, 4, 512));

select hll_print(hll_add_agg(NULL, 10, 4, -1));

select hll_print(hll_add_agg(NULL, 10, 4, 512, 0));

DROP TABLE test_khvengxf;
Loading

0 comments on commit a3ba87d

Please sign in to comment.