Compare commits

...

120 Commits

Author SHA1 Message Date
Anastasia Lubennikova
e7ffa85b71 Bump vendor/postgres to include extenision path fix 2024-09-20 13:10:41 +01:00
a-masterov
e530b6e6ba Merge branch 'main' into amasterov/regress-arm 2024-09-20 09:41:41 +02:00
a-masterov
df92c40306 Merge branch 'main' into amasterov/regress-arm 2024-09-19 15:00:33 +02:00
Alexey Masterov
494c60f9d3 Revert "change local branch"
This reverts commit feb6eaa7a5.
2024-09-19 14:53:43 +02:00
Alexey Masterov
0e2110523d Revert "change submodules"
This reverts commit f08e6ab370.
2024-09-19 14:53:06 +02:00
Alexey Masterov
feb6eaa7a5 change local branch 2024-09-19 12:26:27 +02:00
Alexey Masterov
72c99f8260 Clarify ambiguous messages and comments 2024-09-18 16:43:16 +02:00
a-masterov
6b90ea836f Update .github/workflows/cloud-regress.yml
Change from the step to the env variable

Co-authored-by: Alexander Bayandin <alexander@neon.tech>
2024-09-18 16:39:20 +02:00
Alexey Masterov
f08e6ab370 change submodules 2024-09-18 15:28:14 +02:00
a-masterov
bf008b8f99 Merge branch 'main' into amasterov/regress-arm 2024-09-18 15:25:30 +02:00
Alexey Masterov
9353b8ee07 Revert "Switch the submodule branch for tests"
This reverts commit 234d3287ed.
2024-09-18 15:25:10 +02:00
Alexey Masterov
46348cf8c1 Revert "tc"
This reverts commit d753fd9c80.
2024-09-18 15:24:24 +02:00
Alexey Masterov
d753fd9c80 tc 2024-09-18 14:39:06 +02:00
Alexey Masterov
234d3287ed Switch the submodule branch for tests 2024-09-18 14:14:09 +02:00
Alexey Masterov
24431cfbdf Finally add the mask 2024-09-18 10:33:57 +02:00
Alexey Masterov
0ec1d6f73f an attempt 2024-09-18 10:30:57 +02:00
Alexey Masterov
cdd6a978b9 an attempt 2024-09-18 10:21:34 +02:00
Alexey Masterov
b2a8d96262 an attempt 2024-09-17 17:17:55 +02:00
Alexey Masterov
caaa399293 an attempt 2024-09-17 17:12:34 +02:00
Alexey Masterov
81e1001ae5 Fix add mask 2024-09-17 17:09:48 +02:00
Alexey Masterov
76016391ee Fix the actionlint warnings 2024-09-17 16:45:06 +02:00
Alexey Masterov
f4493a65db Refactor the workflow 2024-09-17 16:35:38 +02:00
a-masterov
9b6e46969e Update .github/workflows/cloud-regress.yml
Co-authored-by: Alexander Bayandin <alexander@neon.tech>
2024-09-17 16:23:01 +02:00
Alexey Masterov
8b04fc469d Fix the complains 2024-09-10 14:30:40 +02:00
a-masterov
f8b9ec0dd0 Merge branch 'main' into amasterov/regress-arm 2024-09-10 14:29:04 +02:00
Alexey Masterov
b45560db75 Fix the error 2024-09-10 13:18:47 +02:00
Alexey Masterov
c4d98915ff Refactoring 2024-09-10 13:12:46 +02:00
Alexey Masterov
9ac06ea3d9 Debug 2024-09-10 13:04:04 +02:00
Alexey Masterov
841b39f7c5 Some refactoring 2024-09-10 12:52:46 +02:00
Alexey Masterov
fe8fee0b88 Add debug 2024-09-10 12:26:22 +02:00
Alexey Masterov
dbde226f38 Add debug 2024-09-10 12:21:09 +02:00
Alexey Masterov
01c37c6c6c Refactor, delete roles accidentally left into a project 2024-09-10 12:04:15 +02:00
Alexey Masterov
e989bf1887 remove unused import os 2024-09-10 11:17:55 +02:00
Alexey Masterov
84ca400dcf We are going to calculate md5 sum dynamically 2024-09-10 11:10:11 +02:00
Alexey Masterov
c7157d1c01 Update the patch 2024-09-09 18:28:49 +02:00
Alexey Masterov
b74d463b15 Update the patch 2024-09-09 17:37:15 +02:00
Alexey Masterov
e127e97797 Fix the security problem 2024-09-09 17:00:51 +02:00
Alexey Masterov
b04995f10f Fix the security problem 2024-09-09 16:44:33 +02:00
Alexey Masterov
287e05f49d Fix the error 2024-09-09 16:22:04 +02:00
Alexey Masterov
650fb7b2d7 Drop subscriptions if exist 2024-09-09 16:18:26 +02:00
Alexey Masterov
c29f78acc4 Fix errors 2024-09-09 14:17:30 +02:00
Alexey Masterov
b7fd9e5123 Fix an error 2024-09-09 13:55:00 +02:00
Alexey Masterov
b4d9632b19 Fix an error 2024-09-09 13:28:51 +02:00
Alexey Masterov
3b6449fb7b Fix an error 2024-09-09 12:48:37 +02:00
Alexey Masterov
130066898e Fix an error 2024-09-09 12:09:55 +02:00
Alexey Masterov
6f2d7b4662 Try to avoid passwords in clean text 2024-09-09 11:58:18 +02:00
Alexey Masterov
8a00cc817c Revert "make the test fail for debug purposes"
This reverts commit 9d8ba21f65.
2024-09-06 15:54:31 +02:00
Alexey Masterov
7469656b72 Add regression.out to allure reports 2024-09-06 15:49:43 +02:00
Alexey Masterov
9d8ba21f65 make the test fail for debug purposes 2024-09-06 15:01:15 +02:00
Alexey Masterov
e54f8bc5ff Change the workdir to test_output_dir 2024-09-06 14:53:40 +02:00
Alexey Masterov
ac72832589 Change the runner 2024-09-06 14:33:35 +02:00
Alexey Masterov
2098184d67 Revert "Revert "Fix an error in the path""
This reverts commit c7f2a26cb9.
2024-09-06 13:56:20 +02:00
Alexey Masterov
c7f2a26cb9 Revert "Fix an error in the path"
This reverts commit ebdd187398.
2024-09-06 13:51:15 +02:00
Alexey Masterov
ebdd187398 Fix an error in the path 2024-09-06 13:36:49 +02:00
Alexey Masterov
6c679f722c Fix an error in the path 2024-09-06 13:27:05 +02:00
Alexey Masterov
d0cf670b76 Fix an error in the path 2024-09-06 13:19:06 +02:00
Alexey Masterov
6d66a2ebe7 Fix an error in the path 2024-09-06 13:01:43 +02:00
Alexey Masterov
a8d1cbe376 Change the directories calculation 2024-09-06 12:58:10 +02:00
Alexey Masterov
222f483ce8 Add a debug 2024-09-06 12:19:08 +02:00
Alexey Masterov
6f6d5f1ea3 Add AWS access keys 2024-09-06 12:03:54 +02:00
Alexey Masterov
7cd76ee351 add an allure report and slack posting 2024-09-06 11:52:04 +02:00
Alexey Masterov
0510676a3f Some refactoring 2024-09-06 11:30:21 +02:00
Alexey Masterov
c7d9eda56a Some refactoring 2024-09-06 11:25:59 +02:00
Alexey Masterov
6140e3b6b1 Some refactoring 2024-09-06 11:09:26 +02:00
Alexey Masterov
74eec88125 Some refactoring 2024-09-06 11:08:33 +02:00
Alexey Masterov
195c7a359d Some refactoring 2024-09-06 11:06:43 +02:00
Alexey Masterov
8bb0e97880 Some refactoring 2024-09-06 11:03:29 +02:00
Alexey Masterov
243db8ab4a Some refactoring 2024-09-05 17:06:56 +02:00
a-masterov
815d7d6ab1 Merge branch 'main' into amasterov/regress-arm 2024-09-05 15:30:05 +02:00
Alexey Masterov
226464e6b5 Fix format 2024-09-05 12:53:39 +02:00
Alexey Masterov
e4dc7fe4a5 Remove running the cloud test on a pull request 2024-09-05 12:28:07 +02:00
Alexey Masterov
7a324f84e4 Fix Line 2024-09-05 12:22:13 +02:00
Alexey Masterov
b54a919d51 Fix Line 2024-09-05 12:19:32 +02:00
Alexey Masterov
afd25c896c Get rid of redundant local variables 2024-09-05 12:14:54 +02:00
Alexey Masterov
99f9ab2c07 Fix regex 2024-09-05 12:04:16 +02:00
Alexey Masterov
e8676ffff7 Remove regress.so form image as we use the extension for this now 2024-09-05 11:58:13 +02:00
Alexey Masterov
9e61284d10 fix mypy warnings 2024-09-05 11:55:23 +02:00
Alexey Masterov
288388f14e remove the temp script 2024-09-05 11:11:26 +02:00
Alexey Masterov
bfb7bf92f2 fix linters' warnings 2024-09-05 11:07:51 +02:00
Alexey Masterov
f8c9966aff modify the patch 2024-09-05 10:10:54 +02:00
Alexey Masterov
2e1725c570 modify the patch 2024-09-05 09:56:48 +02:00
Alexey Masterov
9414976c4c uncomment the extension creation 2024-09-04 17:36:48 +02:00
Alexey Masterov
777c01938d fix 2024-09-04 15:42:19 +02:00
Alexey Masterov
302a2203a1 change path 2024-09-04 15:27:36 +02:00
Alexey Masterov
bc1697ab28 change path 2024-09-04 15:18:22 +02:00
Alexey Masterov
61f3ac3fbf change path 2024-09-04 14:58:41 +02:00
Alexey Masterov
f7f0be8727 Temporary disable the extension. 2024-09-04 14:55:02 +02:00
Alexey Masterov
c34323eb80 Fix the test selection 2024-09-04 13:48:19 +02:00
Alexey Masterov
4104b1cbd4 Add CONNSTR 2024-09-04 13:29:08 +02:00
Alexey Masterov
d143822f64 update patches 2024-09-04 12:36:08 +02:00
Alexey Masterov
6ff6843dbb add submodules 2024-09-04 11:23:35 +02:00
Alexey Masterov
c14d53b923 debug 2024-09-04 11:20:32 +02:00
Alexey Masterov
c7dde2e784 fix an obvious error 2024-09-04 11:05:05 +02:00
Alexey Masterov
173aef925c directory change 2024-09-04 11:03:06 +02:00
Alexey Masterov
b2af44f027 debug 2024-09-04 11:00:03 +02:00
Alexey Masterov
a07fda3a86 debug 2024-09-04 10:57:22 +02:00
Alexey Masterov
6b5d33de7d debug 2024-09-04 10:55:36 +02:00
Alexey Masterov
16450111c9 Fix a syntax error 2024-09-04 10:53:52 +02:00
Alexey Masterov
e8775dda76 Add patch 2024-09-04 10:42:45 +02:00
Alexey Masterov
8959cb1219 change on: 2024-09-03 19:16:23 +02:00
Alexey Masterov
ecf20bb6fa Add the workflow file 2024-09-03 17:21:33 +02:00
Alexey Masterov
5a4a2ae4cd Fix the trailing space 2024-09-02 10:52:22 +02:00
Alexey Masterov
d4f656daa2 Change the python file 2024-09-02 09:07:11 +02:00
Alexey Masterov
e2921e352c Change the patch file 2024-09-02 09:06:19 +02:00
Alexey Masterov
8fb8ec57ea Add python script, rename patch file 2024-08-30 16:39:07 +02:00
Alexey Masterov
0c6b34b5a0 New patch 2024-08-30 13:22:50 +02:00
Alexey Masterov
b3d90a7d7d Merge branch 'main' into amasterov/regress-arm 2024-08-29 09:19:34 +02:00
Alexey Masterov
9b0e277514 New patch 2024-08-28 18:14:52 +02:00
Alexey Masterov
362f411735 renew patches 2024-08-22 17:03:14 +02:00
Alexey Masterov
fc89b662a3 renew patches 2024-08-20 16:06:13 +02:00
a-masterov
b1c5330241 Merge branch 'main' into amasterov/regress-arm 2024-08-16 16:03:02 +02:00
Alexey Masterov
8e90dba6b4 renew patches 2024-08-16 14:11:14 +02:00
Alexey Masterov
5315a78bbe renew patches 2024-08-15 13:05:28 +02:00
Alexey Masterov
95ef3e8d21 renew patches 2024-08-14 18:53:54 +02:00
Alexey Masterov
236e8551fa renew patches 2024-08-14 17:43:08 +02:00
Alexey Masterov
e42dbae4a7 Add regress.so to the image 2024-08-14 13:37:35 +02:00
Alexey Masterov
1dba8846f8 Add regress.so to the image 2024-08-14 12:08:03 +02:00
a-masterov
224564e2e0 Merge branch 'main' into amasterov/regress-arm 2024-08-14 10:55:39 +02:00
Alexey Masterov
82ba1155f9 Add regress.so to the image 2024-08-09 16:29:04 +02:00
Alexey Masterov
418ccba23b First attempt 2024-08-09 15:51:16 +02:00
9 changed files with 4170 additions and 9 deletions

104
.github/workflows/cloud-regress.yml vendored Normal file
View File

@@ -0,0 +1,104 @@
name: Cloud Regression Test
on:
push:
branches: [amasterov/regress-arm]
schedule:
# * is a special character in YAML so you have to quote this string
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 3 * * *' # run once a day, timezone is utc
workflow_dispatch: # adds ability to run this manually
defaults:
run:
shell: bash -euxo pipefail {0}
concurrency:
# Allow only one workflow
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
regress:
env:
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
DEFAULT_PG_VERSION: 16
TEST_OUTPUT: /tmp/test_output
BUILD_TYPE: remote
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_DEV }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY_DEV }}
runs-on: us-east-2
container:
image: neondatabase/build-tools:pinned
options: --init
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Patch the test
run: |
cd "vendor/postgres-v${DEFAULT_PG_VERSION}"
patch -p1 < "../../patches/cloud_regress_pg${DEFAULT_PG_VERSION}.patch"
- name: Generate a random password
id: pwgen
run: |
set +x
DBPASS=$(dd if=/dev/random bs=48 count=1 2>/dev/null | base64)
echo "::add-mask::${DBPASS//\//}"
echo DBPASS="${DBPASS//\//}" >> "${GITHUB_OUTPUT}"
- name: Change tests according to the generated password
env:
DBPASS: ${{ steps.pwgen.outputs.DBPASS }}
run: |
cd vendor/postgres-v"${DEFAULT_PG_VERSION}"/src/test/regress
for fname in sql/*.sql expected/*.out; do
sed -i.bak s/NEON_PASSWORD_PLACEHOLDER/"'${DBPASS}'"/ "${fname}"
done
for ph in $(grep NEON_MD5_PLACEHOLDER expected/password.out | awk '{print $3;}' | sort | uniq); do
USER=$(echo "${ph}" | cut -c 22-)
MD5=md5$(echo -n "${DBPASS}${USER}" | md5sum | awk '{print $1;}')
sed -i.bak "s/${ph}/${MD5}/" expected/password.out
done
- name: Download Neon artifact
uses: ./.github/actions/download
with:
name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
path: /tmp/neon/
prefix: latest
- name: Run the regression tests
uses: ./.github/actions/run-python-test-set
with:
build_type: ${{ env.BUILD_TYPE }}
test_selection: cloud_regress
pg_version: ${{ env.DEFAULT_PG_VERSION }}
extra_params: -m remote_cluster
env:
BENCHMARK_CONNSTR: ${{ secrets.PG_REGRESS_CONNSTR }}
- name: Create Allure report
id: create-allure-report
if: ${{ !cancelled() }}
uses: ./.github/actions/allure-report-generate
- name: Post to a Slack channel
if: ${{ github.event.schedule && failure() }}
uses: slackapi/slack-github-action@v1
with:
channel-id: "C033QLM5P7D" # on-call-staging-stream
slack-message: |
Periodic pg_regress on staging: ${{ job.status }}
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
<${{ steps.create-allure-report.outputs.report-url }}|Allure report>
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,108 @@
"""
Run the regression tests on the cloud instance of Neon
"""
from pathlib import Path
from typing import Any
import psycopg2
import pytest
from fixtures.log_helper import log
from fixtures.neon_fixtures import RemotePostgres
from fixtures.pg_version import PgVersion
@pytest.fixture
def setup(remote_pg: RemotePostgres):
"""
Setup and teardown of the tests
"""
with psycopg2.connect(remote_pg.connstr()) as conn:
with conn.cursor() as cur:
cur = conn.cursor()
log.info("Creating the extension")
cur.execute("CREATE EXTENSION IF NOT EXISTS regress_so")
conn.commit()
log.info("Looking for subscriptions in the regress database")
cur.execute(
"SELECT subname FROM pg_catalog.pg_subscription WHERE "
"subdbid = (SELECT oid FROM pg_catalog.pg_database WHERE datname='regression');"
)
if cur.rowcount > 0:
with psycopg2.connect(
dbname="regression",
host=remote_pg.default_options["host"],
user=remote_pg.default_options["user"],
password=remote_pg.default_options["password"],
) as regress_conn:
with regress_conn.cursor() as regress_cur:
for sub in cur:
regress_cur.execute(f"ALTER SUBSCRIPTION {sub[0]} DISABLE")
regress_cur.execute(
f"ALTER SUBSCRIPTION {sub[0]} SET (slot_name = NONE)"
)
regress_cur.execute(f"DROP SUBSCRIPTION {sub[0]}")
regress_conn.commit()
# This is also a workaround for the full path problem
# If we specify the full path in the command, the library won't be downloaded
# So we specify the name only for the first time
log.info("Creating a C function to check availability of regress.so")
cur.execute(
"CREATE FUNCTION get_columns_length(oid[]) "
"RETURNS int AS 'regress.so' LANGUAGE C STRICT STABLE PARALLEL SAFE;"
)
conn.rollback()
yield
log.info("Looking for extra roles...")
with psycopg2.connect(remote_pg.connstr()) as conn:
with conn.cursor() as cur:
cur.execute(
"SELECT rolname FROM pg_catalog.pg_roles WHERE oid > 16384 AND rolname <> 'neondb_owner'"
)
roles: list[Any] = []
for role in cur:
log.info("Role found: %s", role[0])
roles.append(role[0])
for role in roles:
cur.execute(f"DROP ROLE {role}")
conn.commit()
@pytest.mark.timeout(7200)
@pytest.mark.remote_cluster
def test_cloud_regress(
setup,
remote_pg: RemotePostgres,
pg_version: PgVersion,
pg_distrib_dir: Path,
base_dir: Path,
test_output_dir: Path,
):
"""
Run the regression tests
"""
regress_bin = (
pg_distrib_dir / f"{pg_version.v_prefixed}/lib/postgresql/pgxs/src/test/regress/pg_regress"
)
test_path = base_dir / f"vendor/postgres-{pg_version.v_prefixed}/src/test/regress"
env_vars = {
"PGHOST": remote_pg.default_options["host"],
"PGPORT": str(
remote_pg.default_options["port"] if "port" in remote_pg.default_options else 5432
),
"PGUSER": remote_pg.default_options["user"],
"PGPASSWORD": remote_pg.default_options["password"],
"PGDATABASE": remote_pg.default_options["dbname"],
}
regress_cmd = [
str(regress_bin),
f"--inputdir={test_path}",
f"--bindir={pg_distrib_dir}/{pg_version.v_prefixed}/bin",
"--dlpath=/usr/local/lib",
"--max-concurrent-tests=20",
f"--schedule={test_path}/parallel_schedule",
"--max-connections=5",
]
remote_pg.pg_bin.run(regress_cmd, env=env_vars, cwd=test_output_dir)

View File

@@ -236,7 +236,7 @@ def get_scale_for_db(size_mb: int) -> int:
ATTACHMENT_NAME_REGEX: re.Pattern = re.compile( # type: ignore[type-arg]
r"regression\.diffs|.+\.(?:log|stderr|stdout|filediff|metrics|html|walredo)"
r"regression\.(diffs|out)|.+\.(?:log|stderr|stdout|filediff|metrics|html|walredo)"
)

View File

@@ -1,18 +1,18 @@
{
"v17": [
"17rc1",
"9156d63ce253bed9d1f76355ceec610e444eaffa"
"dadd6fe208bb906cc0a48980f2ab4e13c47ba3ad"
],
"v16": [
"16.4",
"0baa7346dfd42d61912eeca554c9bb0a190f0a1e"
"d009084a745cb4d5e6de222c778b2a562c8b2767"
],
"v15": [
"15.8",
"6f6d77fb5960602fcd3fd130aca9f99ecb1619c9"
"1dbd6f316416c8360bbd4f3d6db956cf70937cf0"
],
"v14": [
"14.13",
"a317b9b5b96978b49e78986697f3dd80d06f99a7"
"f9c51c12438b20049b6905eb4e43d321defd6ff2"
]
}