Compare commits

...

33 Commits

Author SHA1 Message Date
Andrey Taranik
b66d4e0bdc Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-20 15:45:42 +03:00
Andrey Taranik
6d9fd2bbb5 Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-20 00:27:01 +03:00
Andrey Taranik
e5d9c003f5 try new qemu based runners 2024-08-19 17:10:17 +03:00
Andrey Taranik
290ce3ed46 try aws arm64 8 core 2024-08-18 02:45:55 +03:00
Andrey Taranik
1138e286b9 try aws arm64 16core runners 2024-08-17 23:04:50 +03:00
Andrey Taranik
9173847f81 try 80 core metal again 2024-08-17 20:20:07 +03:00
Andrey Taranik
6ae62574d0 try 16 core hcloud again 2024-08-17 19:34:31 +03:00
Andrey Taranik
5e074d8536 Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-17 17:49:47 +03:00
Andrey Taranik
3a22daf33e runner lables fix 2024-08-17 16:37:17 +03:00
Andrey Taranik
f40f627730 tey aws arm64 runners 2024-08-17 16:30:24 +03:00
Andrey Taranik
56b94b7d1b return to large-arm64 2024-08-16 14:18:01 +03:00
Andrey Taranik
fe445b2945 more parallelism 2024-08-16 13:21:19 +03:00
Andrey Taranik
7f49f45a53 tune parallelism 2024-08-16 13:08:36 +03:00
Andrey Taranik
980b212789 try more parallelism 2024-08-16 11:56:11 +03:00
Andrey Taranik
2b17a03911 arm64 80 cores debian 12 2024-08-16 10:20:23 +03:00
Andrey Taranik
b50a9d84d4 Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-16 09:06:09 +03:00
Andrey Taranik
6fd3c9daa5 trigger build 2024-08-15 20:27:24 +03:00
Andrey Taranik
409171ab08 try 16 cores 2024-08-15 16:46:57 +03:00
Andrey Taranik
f26240c9dc Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-15 16:46:00 +03:00
Andrey Taranik
1c771267ab Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-15 16:15:17 +03:00
Andrey Taranik
9f1b7b72ed Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-15 14:56:37 +03:00
Andrey Taranik
2476f7ef74 try arm64 with 80 cores 2024-08-15 14:56:14 +03:00
Andrey Taranik
f555cb3970 try cloud arm64 servers 2024-08-15 03:36:00 +03:00
Andrey Taranik
10a726503a Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-15 03:34:07 +03:00
Andrey Taranik
7ba86e15fa debug arm64 builds 2024-08-14 18:57:28 +03:00
Andrey Taranik
7ba42bfdb4 Merge branch 'main' into cicd/debug-regress-tests-on-arm 2024-08-14 18:33:19 +03:00
Andrey Taranik
4f8a39d6c6 try metal arm64 runners 2024-08-14 17:46:13 +03:00
Alexander Bayandin
54c5da3981 CI(build-and-test): set RUSTFLAGS for ARM 2024-08-14 13:57:20 +01:00
Alexander Bayandin
c1378dc43b CI: don't collect code coverage on arm64 runners 2024-08-14 13:53:16 +01:00
Alexander Bayandin
50b9fb430a test_runner: add __arch parameter to Allure report 2024-08-14 13:53:16 +01:00
Alexander Bayandin
486eaba028 CI(build-and-test): run regression tests on arm 2024-08-14 13:53:16 +01:00
Alexander Bayandin
d4d70cc314 CI(build-and-test): make pg-versions configurable 2024-08-14 13:53:16 +01:00
Alexander Bayandin
176eefa47a CI(regress-tests): run debug builds only with the latest Postgres version 2024-08-14 13:53:16 +01:00
6 changed files with 60 additions and 13 deletions

View File

@@ -6,6 +6,10 @@ self-hosted-runner:
- small
- small-arm64
- us-east-2
- aws-arm64-8core
- aws-arm64-16core
- aws-arm64-32core
- qemu-arm64
config-variables:
- BENCHMARK_PROJECT_ID_PUB
- BENCHMARK_PROJECT_ID_SUB

View File

@@ -131,7 +131,7 @@ runs:
fi
if [[ "${{ inputs.run_in_parallel }}" == "true" ]]; then
# -n sets the number of parallel processes that pytest-xdist will run
EXTRA_PARAMS="-n12 $EXTRA_PARAMS"
EXTRA_PARAMS="-n auto $EXTRA_PARAMS"
# --dist=loadgroup points tests marked with @pytest.mark.xdist_group
# to the same worker to make @pytest.mark.order work with xdist
@@ -169,10 +169,8 @@ runs:
EXTRA_PARAMS="--durations-path $TEST_OUTPUT/benchmark_durations.json $EXTRA_PARAMS"
fi
if [[ "${{ inputs.build_type }}" == "debug" ]]; then
if [[ $BUILD_TYPE == "debug" && $RUNNER_ARCH == 'X64' ]]; then
cov_prefix=(scripts/coverage "--profraw-prefix=$GITHUB_JOB" --dir=/tmp/coverage run)
elif [[ "${{ inputs.build_type }}" == "release" ]]; then
cov_prefix=()
else
cov_prefix=()
fi

View File

@@ -36,7 +36,7 @@ env:
jobs:
build-neon:
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large')) }}
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'qemu-arm64' || 'large')) }}
container:
image: ${{ inputs.build-tools-image }}
credentials:
@@ -94,11 +94,16 @@ jobs:
# We run tests with addtional features, that are turned off by default (e.g. in release builds), see
# corresponding Cargo.toml files for their descriptions.
- name: Set env variables
env:
ARCH: ${{ inputs.arch }}
run: |
CARGO_FEATURES="--features testing"
if [[ $BUILD_TYPE == "debug" ]]; then
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' ]]; then
cov_prefix="scripts/coverage --profraw-prefix=$GITHUB_JOB --dir=/tmp/coverage run"
CARGO_FLAGS="--locked"
elif [[ $BUILD_TYPE == "debug" ]]; then
cov_prefix=""
CARGO_FLAGS="--locked"
elif [[ $BUILD_TYPE == "release" ]]; then
cov_prefix=""
CARGO_FLAGS="--locked --release"
@@ -110,6 +115,11 @@ jobs:
echo "CARGO_HOME=${GITHUB_WORKSPACE}/.cargo"
} >> $GITHUB_ENV
# See https://github.com/aws/aws-graviton-getting-started/blob/57dc813626d0266f1cc12ef83474745bb1f31fb4/rust.md
- name: Set RUSTFLAGS for ARM
if: inputs.arch == 'arm64'
run: echo "RUSTFLAGS=-Ctarget-feature=+lse -Ctarget-cpu=neoverse-n1" >> $GITHUB_ENV
- name: Cache postgres v14 build
id: cache_pg_14
uses: actions/cache@v4
@@ -153,11 +163,13 @@ jobs:
run: |
PQ_LIB_DIR=$(pwd)/pg_install/v16/lib
export PQ_LIB_DIR
${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_FEATURES --bins --tests
${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_FEATURES --bins --tests -j$(nproc)
# Do install *before* running rust tests because they might recompile the
# binaries with different features/flags.
- name: Install rust binaries
env:
ARCH: ${{ inputs.arch }}
run: |
# Install target binaries
mkdir -p /tmp/neon/bin/
@@ -172,7 +184,7 @@ jobs:
done
# Install test executables and write list of all binaries (for code coverage)
if [[ $BUILD_TYPE == "debug" ]]; then
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' ]]; then
# Keep bloated coverage data files away from the rest of the artifact
mkdir -p /tmp/coverage/
@@ -243,10 +255,10 @@ jobs:
uses: ./.github/actions/save-coverage-data
regress-tests:
# Run test on x64 only
if: inputs.arch == 'x64'
# Don't run regression tests on debug arm64 builds
if: inputs.build-type != 'debug' || inputs.arch != 'arm64'
needs: [ build-neon ]
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'large-arm64' || 'large')) }}
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', inputs.arch == 'arm64' && 'qemu-arm64' || 'large')) }}
container:
image: ${{ inputs.build-tools-image }}
credentials:

View File

@@ -198,7 +198,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [ x64 ]
arch: [ x64, arm64 ]
# Do not build or run tests in debug for release branches
build-type: ${{ fromJson((startsWith(github.ref_name, 'release') && github.event_name == 'push') && '["release"]' || '["debug", "release"]') }}
include:

View File

@@ -18,6 +18,7 @@ import psycopg2
from psycopg2.extras import execute_values
CREATE_TABLE = """
CREATE TYPE arch AS ENUM ('ARM64', 'X64', 'UNKNOWN');
CREATE TABLE IF NOT EXISTS results (
id BIGSERIAL PRIMARY KEY,
parent_suite TEXT NOT NULL,
@@ -28,6 +29,7 @@ CREATE TABLE IF NOT EXISTS results (
stopped_at TIMESTAMPTZ NOT NULL,
duration INT NOT NULL,
flaky BOOLEAN NOT NULL,
arch arch DEFAULT 'X64',
build_type TEXT NOT NULL,
pg_version INT NOT NULL,
run_id BIGINT NOT NULL,
@@ -35,7 +37,7 @@ CREATE TABLE IF NOT EXISTS results (
reference TEXT NOT NULL,
revision CHAR(40) NOT NULL,
raw JSONB COMPRESSION lz4 NOT NULL,
UNIQUE (parent_suite, suite, name, build_type, pg_version, started_at, stopped_at, run_id)
UNIQUE (parent_suite, suite, name, arch, build_type, pg_version, started_at, stopped_at, run_id)
);
"""
@@ -50,6 +52,7 @@ class Row:
stopped_at: datetime
duration: int
flaky: bool
arch: str
build_type: str
pg_version: int
run_id: int
@@ -121,6 +124,14 @@ def ingest_test_result(
raw.pop("labels")
raw.pop("extra")
# All allure parameters are prefixed with "__", see test_runner/fixtures/parametrize.py
parameters = {
p["name"].removeprefix("__"): p["value"]
for p in test["parameters"]
if p["name"].startswith("__")
}
arch = parameters.get("arch", "UNKNOWN").strip("'")
build_type, pg_version, unparametrized_name = parse_test_name(test["name"])
labels = {label["name"]: label["value"] for label in test["labels"]}
row = Row(
@@ -132,6 +143,7 @@ def ingest_test_result(
stopped_at=datetime.fromtimestamp(test["time"]["stop"] / 1000, tz=timezone.utc),
duration=test["time"]["duration"],
flaky=test["flaky"] or test["retriesStatusChange"],
arch=arch,
build_type=build_type,
pg_version=pg_version,
run_id=run_id,

View File

@@ -1,6 +1,7 @@
import os
from typing import Any, Dict, Optional
import allure
import pytest
import toml
from _pytest.python import Metafunc
@@ -91,3 +92,23 @@ def pytest_generate_tests(metafunc: Metafunc):
and (platform := os.getenv("PLATFORM")) is not None
):
metafunc.parametrize("platform", [platform.lower()])
@pytest.hookimpl(hookwrapper=True, tryfirst=True)
def pytest_runtest_makereport(*args, **kwargs):
# Add test parameters to Allue report to distinguish the same tests with different parameters.
# Names has `__` prefix to avoid conflicts with `pytest.mark.parametrize` parameters
# A mapping between `uname -m` and `RUNNER_ARCH` values.
# `RUNNER_ARCH` environment variable is set on GitHub Runners,
# possible values are X86, X64, ARM, or ARM64.
# See https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
uname_m = {
"aarch64": "ARM64",
"arm64": "ARM64",
"x86_64": "X64",
}.get(os.uname().machine, "UNKNOWN")
arch = os.getenv("RUNNER_ARCH", uname_m)
allure.dynamic.parameter("__arch", arch)
yield