Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4177,9 +4177,9 @@ jobs:
uses: ./.github/workflows/regression.yml
secrets: inherit
with:
runner_type: altinity-on-demand, altinity-regression-tester
runner_type: altinity-regression-tester
commit: 8d2c6d2072771d450a47faca38966da7493821e1
arch: release
arch: x86
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout_minutes: 300
workflow_config: ${{ needs.config_workflow.outputs.data }}
Expand All @@ -4189,7 +4189,7 @@ jobs:
uses: ./.github/workflows/regression.yml
secrets: inherit
with:
runner_type: altinity-on-demand, altinity-regression-tester-aarch64
runner_type: altinity-regression-tester-aarch64
commit: 8d2c6d2072771d450a47faca38966da7493821e1
arch: aarch64
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4133,9 +4133,9 @@ jobs:
uses: ./.github/workflows/regression.yml
secrets: inherit
with:
runner_type: altinity-on-demand, altinity-regression-tester
runner_type: altinity-regression-tester
commit: 8d2c6d2072771d450a47faca38966da7493821e1
arch: release
arch: x86
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout_minutes: 300
workflow_config: ${{ needs.config_workflow.outputs.data }}
Expand All @@ -4145,7 +4145,7 @@ jobs:
uses: ./.github/workflows/regression.yml
secrets: inherit
with:
runner_type: altinity-on-demand, altinity-regression-tester-aarch64
runner_type: altinity-regression-tester-aarch64
commit: 8d2c6d2072771d450a47faca38966da7493821e1
arch: aarch64
build_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
Expand Down
192 changes: 192 additions & 0 deletions .github/workflows/regression-reusable-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
name: Regression suite
on:
workflow_call:
inputs:
ref:
description: "Commit SHA to checkout. Default: current (empty string)."
type: string
default: ""
workflow_config:
required: true
type: string
flags:
required: false
type: string
output_format:
required: true
type: string
extra_args:
required: false
type: string
suite_name:
required: true
type: string
suite_executable:
required: false
type: string
default: "regression.py"
timeout_minutes:
required: true
type: number
storage_path:
required: false
type: string
default: ""
regression_args:
required: false
type: string
default: ""
runner_type:
required: false
type: string
default: ""
runner_arch:
required: false
type: string
default: "x86"
job_name:
required: false
type: string
default: ""
part:
required: false
type: string
default: ""
build_sha:
required: false
type: string
default: ""
set_commit_status:
required: false
type: boolean
default: false
jobs:
suite:
name: ${{ format('{0}{1}', inputs.job_name != '' && inputs.job_name || inputs.suite_name, inputs.part != '' && format('_{0}', inputs.part) || '') }}
runs-on: [
"self-hosted",
"altinity-on-demand",
"${{ inputs.runner_type }}",
]
timeout-minutes: ${{ inputs.timeout_minutes }}
env:
SUITE: ${{ inputs.suite_name }}
SUITE_EXECUTABLE: ${{ inputs.suite_executable }}
STORAGE: ${{ inputs.storage_path }}
PART: ${{ inputs.part }}
# AWS credentials
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_REPORT_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_REPORT_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REPORT_REGION }}
# Docker credentials
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# Database credentials
CHECKS_DATABASE_HOST: ${{ secrets.CHECKS_DATABASE_HOST }}
CHECKS_DATABASE_USER: ${{ secrets.CLICKHOUSE_TEST_STAT_LOGIN }}
CHECKS_DATABASE_PASSWORD: ${{ secrets.CLICKHOUSE_TEST_STAT_PASSWORD }}
# LocalStack token
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
# Python encoding
PYTHONIOENCODING: utf-8
build_sha: ${{ inputs.build_sha }}
pr_number: ${{ github.event.number }}
artifacts: builds
# Args
args: --test-to-end
--no-colors
--local
--collect-service-logs
--output ${{ inputs.output_format }}
--attr project="${GITHUB_REPOSITORY}" project.id="${GITHUB_REPOSITORY_ID}" user.name="${GITHUB_ACTOR}" version="${{ fromJson(inputs.workflow_config).custom_data.version.string }}" package="$clickhouse_path" repository="https://github.com/Altinity/clickhouse-regression" commit.hash="$(git rev-parse HEAD)" job.name=$GITHUB_JOB job.retry=$GITHUB_RUN_ATTEMPT job.url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" arch="$(uname -i)"
--cicd
--log raw.log
${{ inputs.flags != 'none' && inputs.flags || ''}}
${{ inputs.extra_args }}
artifact_paths: |
./report.html
./*.log.txt
./*.log
./*.html
./*/_instances/*.log
./*/_instances/*/logs/*.log
./*/*/_instances/*/logs/*.log
./*/*/_instances/*.log

steps:
- name: ⤵️ Checkout
uses: actions/checkout@v4
with:
repository: Altinity/clickhouse-regression
ref: ${{ inputs.ref }}

- name: ♻️ Cache setup
uses: ./.github/actions/cache-setup

- name: 🛠️ Setup
run: .github/setup.sh

- name: 📦 Get deb url
env:
S3_BASE_URL: https://altinity-build-artifacts.s3.amazonaws.com/
PR_NUMBER: ${{ github.event.pull_request.number || 0 }}
run: |
REPORTS_PATH=${{ runner.temp }}/reports_dir
mkdir -p $REPORTS_PATH
cat > $REPORTS_PATH/workflow_config.json << 'EOF'
${{ inputs.workflow_config }}
EOF

python3 .github/get-deb-url.py --github-env $GITHUB_ENV --workflow-config $REPORTS_PATH/workflow_config.json --s3-base-url $S3_BASE_URL --pr-number $PR_NUMBER --branch-name ${{ github.ref_name }} --commit-hash ${{ inputs.build_sha || github.sha }} --binary

- name: 🔄 Process regression args
run: |
REGRESSION_ARGS='${{ inputs.regression_args }}'
# AWS replacements
REGRESSION_ARGS="${REGRESSION_ARGS//'{{AWS_BUCKET}}'/${{ secrets.REGRESSION_AWS_S3_BUCKET }}}"
REGRESSION_ARGS="${REGRESSION_ARGS//'{{AWS_REGION}}'/${{ secrets.REGRESSION_AWS_S3_REGION }}}"
REGRESSION_ARGS="${REGRESSION_ARGS//'{{AWS_KEY_ID}}'/${{ secrets.REGRESSION_AWS_S3_KEY_ID }}}"
REGRESSION_ARGS="${REGRESSION_ARGS//'{{AWS_ACCESS_KEY}}'/${{ secrets.REGRESSION_AWS_S3_SECRET_ACCESS_KEY }}}"
# GCS replacements
REGRESSION_ARGS="${REGRESSION_ARGS//'{{GCS_URI}}'/${{ secrets.REGRESSION_GCS_URI }}}"
REGRESSION_ARGS="${REGRESSION_ARGS//'{{GCS_KEY_ID}}'/${{ secrets.REGRESSION_GCS_KEY_ID }}}"
REGRESSION_ARGS="${REGRESSION_ARGS//'{{GCS_KEY_SECRET}}'/${{ secrets.REGRESSION_GCS_KEY_SECRET }}}"
# Azure replacements
REGRESSION_ARGS="${REGRESSION_ARGS//'{{AZURE_ACCOUNT_NAME}}'/${{ secrets.AZURE_ACCOUNT_NAME }}}"
REGRESSION_ARGS="${REGRESSION_ARGS//'{{AZURE_STORAGE_KEY}}'/${{ secrets.AZURE_STORAGE_KEY }}}"
REGRESSION_ARGS="${REGRESSION_ARGS//'{{AZURE_CONTAINER_NAME}}'/${{ secrets.AZURE_CONTAINER_NAME }}}"
echo "REGRESSION_ARGS=$REGRESSION_ARGS" >> $GITHUB_ENV

- name: 🧪 Run ${{ env.SUITE }} suite
id: run_suite
run: python3
-u ${{ env.SUITE }}/${{ env.SUITE_EXECUTABLE }}
--clickhouse ${{ env.clickhouse_path }}
${{ env.REGRESSION_ARGS }}
${{ env.args }} || EXITCODE=$?;
.github/add_link_to_logs.sh
exit $EXITCODE

- name: 📊 Set Commit Status
if: always() && inputs.set_commit_status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JOB_OUTCOME: ${{ steps.run_suite.outcome }}
SUITE_NAME: ${{ format('Regression {0} {1}{2}', inputs.runner_arch, inputs.job_name != '' && inputs.job_name || inputs.suite_name, inputs.part != '' && format('-{0}', inputs.part) || '') }}
run: python3 .github/set_builds_status.py

- name: 📝 Create and upload logs
if: always()
run: .github/create_and_upload_logs.sh ${{ vars.UPLOAD_LOGS }}

- name: 📤 Upload logs to results database
if: always()
timeout-minutes: 20
run: .github/upload_results_to_database.sh ${{ vars.UPLOAD_LOGS }}

- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ format('{0}{1}-artifacts-{2}{3}', inputs.job_name != '' && inputs.job_name || inputs.suite_name, inputs.part != '' && format('_{0}', inputs.part) || '', inputs.runner_arch, contains(inputs.extra_args, '--use-keeper') && '_keeper' || '_zookeeper') }}
path: ${{ env.artifact_paths }}

Loading
Loading