mirror of https://github.com/citusdata/citus.git
Disable CircleCI (#7276)
We are switching to Github Actions. In the test period it has worked well enough, so now we can stop using CircleCI.
(cherry picked from commit ce58c04304
)
pull/7308/head
parent
a342c0e777
commit
8700e9d946
|
@ -1,999 +0,0 @@
|
||||||
version: 2.1
|
|
||||||
orbs:
|
|
||||||
codecov: codecov/codecov@1.1.1
|
|
||||||
azure-cli: circleci/azure-cli@1.0.0
|
|
||||||
|
|
||||||
parameters:
|
|
||||||
image_suffix:
|
|
||||||
type: string
|
|
||||||
default: '-vc4b1573'
|
|
||||||
pg13_version:
|
|
||||||
type: string
|
|
||||||
default: '13.10'
|
|
||||||
pg14_version:
|
|
||||||
type: string
|
|
||||||
default: '14.7'
|
|
||||||
pg15_version:
|
|
||||||
type: string
|
|
||||||
default: '15.2'
|
|
||||||
upgrade_pg_versions:
|
|
||||||
type: string
|
|
||||||
default: '13.10-14.7-15.2'
|
|
||||||
style_checker_tools_version:
|
|
||||||
type: string
|
|
||||||
default: '0.8.18'
|
|
||||||
flaky_test:
|
|
||||||
type: string
|
|
||||||
default: ''
|
|
||||||
flaky_test_runs_per_job:
|
|
||||||
type: integer
|
|
||||||
default: 50
|
|
||||||
skip_flaky_tests:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
commands:
|
|
||||||
install_extension:
|
|
||||||
parameters:
|
|
||||||
pg_major:
|
|
||||||
description: 'postgres major version to use'
|
|
||||||
type: integer
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
name: 'Install Extension'
|
|
||||||
command: |
|
|
||||||
tar xfv "${CIRCLE_WORKING_DIRECTORY}/install-<< parameters.pg_major >>.tar" --directory /
|
|
||||||
|
|
||||||
configure:
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
name: 'Configure'
|
|
||||||
command: |
|
|
||||||
chown -R circleci .
|
|
||||||
gosu circleci ./configure --without-pg-version-check
|
|
||||||
|
|
||||||
enable_core:
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
name: 'Enable core dumps'
|
|
||||||
command: |
|
|
||||||
ulimit -c unlimited
|
|
||||||
|
|
||||||
save_regressions:
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
name: 'Regressions'
|
|
||||||
command: |
|
|
||||||
if [ -f "src/test/regress/regression.diffs" ]; then
|
|
||||||
cat src/test/regress/regression.diffs
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
when: on_fail
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save regressions'
|
|
||||||
path: src/test/regress/regression.diffs
|
|
||||||
|
|
||||||
save_logs_and_results:
|
|
||||||
steps:
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save mitmproxy output (failure test specific)'
|
|
||||||
path: src/test/regress/proxy.output
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save results'
|
|
||||||
path: src/test/regress/results/
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save coordinator log'
|
|
||||||
path: src/test/regress/tmp_check/master/log
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save worker1 log'
|
|
||||||
path: src/test/regress/tmp_check/worker.57637/log
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save worker2 log'
|
|
||||||
path: src/test/regress/tmp_check/worker.57638/log
|
|
||||||
|
|
||||||
stack_trace:
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
name: 'Print stack traces'
|
|
||||||
command: |
|
|
||||||
./ci/print_stack_trace.sh
|
|
||||||
when: on_fail
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
parameters:
|
|
||||||
flags:
|
|
||||||
description: 'codecov flags'
|
|
||||||
type: string
|
|
||||||
steps:
|
|
||||||
- codecov/upload:
|
|
||||||
flags: '<< parameters.flags >>'
|
|
||||||
- run:
|
|
||||||
name: 'Create codeclimate coverage'
|
|
||||||
command: |
|
|
||||||
lcov --directory . --capture --output-file lcov.info
|
|
||||||
lcov --remove lcov.info -o lcov.info '/usr/*'
|
|
||||||
sed "s=^SF:$PWD/=SF:=g" -i lcov.info # relative pats are required by codeclimate
|
|
||||||
mkdir -p /tmp/codeclimate
|
|
||||||
# We started getting permissions error. This fixes them and since
|
|
||||||
# weqre not on a multi-user system so this is safe to do.
|
|
||||||
git config --global --add safe.directory /home/circleci/project
|
|
||||||
cc-test-reporter format-coverage -t lcov -o /tmp/codeclimate/$CIRCLE_JOB.json lcov.info
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: /tmp
|
|
||||||
paths:
|
|
||||||
- codeclimate/*.json
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
description: Build the citus extension
|
|
||||||
parameters:
|
|
||||||
pg_major:
|
|
||||||
description: postgres major version building citus for
|
|
||||||
type: integer
|
|
||||||
image:
|
|
||||||
description: docker image to use for the build
|
|
||||||
type: string
|
|
||||||
default: citus/extbuilder
|
|
||||||
image_tag:
|
|
||||||
description: tag to use for the docker image
|
|
||||||
type: string
|
|
||||||
docker:
|
|
||||||
- image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>'
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: 'Configure, Build, and Install'
|
|
||||||
command: |
|
|
||||||
./ci/build-citus.sh
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: .
|
|
||||||
paths:
|
|
||||||
- build-<< parameters.pg_major >>/*
|
|
||||||
- install-<<parameters.pg_major >>.tar
|
|
||||||
|
|
||||||
check-style:
|
|
||||||
docker:
|
|
||||||
- image: 'citus/stylechecker:<< pipeline.parameters.style_checker_tools_version >><< pipeline.parameters.image_suffix >>'
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: 'Check Style'
|
|
||||||
command: citus_indent --check
|
|
||||||
- run:
|
|
||||||
name: 'Fix whitespace'
|
|
||||||
command: ci/editorconfig.sh && git diff --exit-code
|
|
||||||
- run:
|
|
||||||
name: 'Remove useless declarations'
|
|
||||||
command: ci/remove_useless_declarations.sh && git diff --cached --exit-code
|
|
||||||
- run:
|
|
||||||
name: 'Normalize test output'
|
|
||||||
command: ci/normalize_expected.sh && git diff --exit-code
|
|
||||||
- run:
|
|
||||||
name: 'Check for C-style comments in migration files'
|
|
||||||
command: ci/disallow_c_comments_in_migrations.sh && git diff --exit-code
|
|
||||||
- run:
|
|
||||||
name: 'Check for comment--cached ns that start with # character in spec files'
|
|
||||||
command: ci/disallow_hash_comments_in_spec_files.sh && git diff --exit-code
|
|
||||||
- run:
|
|
||||||
name: 'Check for gitignore entries .for source files'
|
|
||||||
command: ci/fix_gitignore.sh && git diff --exit-code
|
|
||||||
- run:
|
|
||||||
name: 'Check for lengths of changelog entries'
|
|
||||||
command: ci/disallow_long_changelog_entries.sh
|
|
||||||
- run:
|
|
||||||
name: 'Check for banned C API usage'
|
|
||||||
command: ci/banned.h.sh
|
|
||||||
- run:
|
|
||||||
name: 'Check for tests missing in schedules'
|
|
||||||
command: ci/check_all_tests_are_run.sh
|
|
||||||
- run:
|
|
||||||
name: 'Check if all CI scripts are actually run'
|
|
||||||
command: ci/check_all_ci_scripts_are_run.sh
|
|
||||||
- run:
|
|
||||||
name: 'Check if all GUCs are sorted alphabetically'
|
|
||||||
command: ci/check_gucs_are_alphabetically_sorted.sh
|
|
||||||
|
|
||||||
check-sql-snapshots:
|
|
||||||
docker:
|
|
||||||
- image: 'citus/extbuilder:latest'
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: 'Check Snapshots'
|
|
||||||
command: ci/check_sql_snapshots.sh
|
|
||||||
|
|
||||||
test-pg-upgrade:
|
|
||||||
description: Runs postgres upgrade tests
|
|
||||||
parameters:
|
|
||||||
old_pg_major:
|
|
||||||
description: 'postgres major version to use before the upgrade'
|
|
||||||
type: integer
|
|
||||||
new_pg_major:
|
|
||||||
description: 'postgres major version to upgrade to'
|
|
||||||
type: integer
|
|
||||||
image:
|
|
||||||
description: 'docker image to use as for the tests'
|
|
||||||
type: string
|
|
||||||
default: citus/pgupgradetester
|
|
||||||
image_tag:
|
|
||||||
description: 'docker image tag to use'
|
|
||||||
type: string
|
|
||||||
docker:
|
|
||||||
- image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>'
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- install_extension:
|
|
||||||
pg_major: << parameters.old_pg_major >>
|
|
||||||
- install_extension:
|
|
||||||
pg_major: << parameters.new_pg_major >>
|
|
||||||
- configure
|
|
||||||
- enable_core
|
|
||||||
- run:
|
|
||||||
name: 'Install and test postgres upgrade'
|
|
||||||
command: |
|
|
||||||
gosu circleci \
|
|
||||||
make -C src/test/regress \
|
|
||||||
check-pg-upgrade \
|
|
||||||
old-bindir=/usr/lib/postgresql/<< parameters.old_pg_major >>/bin \
|
|
||||||
new-bindir=/usr/lib/postgresql/<< parameters.new_pg_major >>/bin
|
|
||||||
no_output_timeout: 2m
|
|
||||||
- run:
|
|
||||||
name: 'Copy pg_upgrade logs for newData dir'
|
|
||||||
command: |
|
|
||||||
mkdir -p /tmp/pg_upgrade_newData_logs
|
|
||||||
if ls src/test/regress/tmp_upgrade/newData/*.log 1> /dev/null 2>&1; then
|
|
||||||
cp src/test/regress/tmp_upgrade/newData/*.log /tmp/pg_upgrade_newData_logs
|
|
||||||
fi
|
|
||||||
when: on_fail
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save pg_upgrade logs for newData dir'
|
|
||||||
path: /tmp/pg_upgrade_newData_logs
|
|
||||||
- save_logs_and_results
|
|
||||||
- save_regressions
|
|
||||||
- stack_trace
|
|
||||||
- coverage:
|
|
||||||
flags: 'test_<< parameters.old_pg_major >>_<< parameters.new_pg_major >>,upgrade'
|
|
||||||
|
|
||||||
test-arbitrary-configs:
|
|
||||||
description: Runs tests on arbitrary configs
|
|
||||||
parallelism: 6
|
|
||||||
parameters:
|
|
||||||
pg_major:
|
|
||||||
description: 'postgres major version to use'
|
|
||||||
type: integer
|
|
||||||
image:
|
|
||||||
description: 'docker image to use as for the tests'
|
|
||||||
type: string
|
|
||||||
default: citus/failtester
|
|
||||||
image_tag:
|
|
||||||
description: 'docker image tag to use'
|
|
||||||
type: string
|
|
||||||
docker:
|
|
||||||
- image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>'
|
|
||||||
resource_class: xlarge
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- install_extension:
|
|
||||||
pg_major: << parameters.pg_major >>
|
|
||||||
- configure
|
|
||||||
- enable_core
|
|
||||||
- run:
|
|
||||||
name: 'Test arbitrary configs'
|
|
||||||
command: |
|
|
||||||
TESTS=$(src/test/regress/citus_tests/print_test_names.py | circleci tests split)
|
|
||||||
# Our test suite expects comma separated values
|
|
||||||
TESTS=$(echo $TESTS | tr ' ' ',')
|
|
||||||
# TESTS will contain subset of configs that will be run on a container and we use multiple containers
|
|
||||||
# to run the test suite
|
|
||||||
gosu circleci \
|
|
||||||
make -C src/test/regress \
|
|
||||||
check-arbitrary-configs parallel=4 CONFIGS=$TESTS
|
|
||||||
no_output_timeout: 2m
|
|
||||||
- run:
|
|
||||||
name: 'Show regressions'
|
|
||||||
command: |
|
|
||||||
find src/test/regress/tmp_citus_test/ -name "regression*.diffs" -exec cat {} +
|
|
||||||
lines=$(find src/test/regress/tmp_citus_test/ -name "regression*.diffs" | wc -l)
|
|
||||||
if [ $lines -ne 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
when: on_fail
|
|
||||||
- run:
|
|
||||||
name: 'Copy logfiles'
|
|
||||||
command: |
|
|
||||||
mkdir src/test/regress/tmp_citus_test/logfiles
|
|
||||||
find src/test/regress/tmp_citus_test/ -name "logfile_*" -exec cp -t src/test/regress/tmp_citus_test/logfiles/ {} +
|
|
||||||
when: on_fail
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save logfiles'
|
|
||||||
path: src/test/regress/tmp_citus_test/logfiles
|
|
||||||
- save_logs_and_results
|
|
||||||
- stack_trace
|
|
||||||
- coverage:
|
|
||||||
flags: 'test_<< parameters.pg_major >>,upgrade'
|
|
||||||
|
|
||||||
test-citus-upgrade:
|
|
||||||
description: Runs citus upgrade tests
|
|
||||||
parameters:
|
|
||||||
pg_major:
|
|
||||||
description: 'postgres major version'
|
|
||||||
type: integer
|
|
||||||
image:
|
|
||||||
description: 'docker image to use as for the tests'
|
|
||||||
type: string
|
|
||||||
default: citus/citusupgradetester
|
|
||||||
image_tag:
|
|
||||||
description: 'docker image tag to use'
|
|
||||||
type: string
|
|
||||||
docker:
|
|
||||||
- image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>'
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- configure
|
|
||||||
- enable_core
|
|
||||||
- run:
|
|
||||||
name: 'Install and test citus upgrade'
|
|
||||||
command: |
|
|
||||||
# run make check-citus-upgrade for all citus versions
|
|
||||||
# the image has ${CITUS_VERSIONS} set with all verions it contains the binaries of
|
|
||||||
for citus_version in ${CITUS_VERSIONS}; do \
|
|
||||||
gosu circleci \
|
|
||||||
make -C src/test/regress \
|
|
||||||
check-citus-upgrade \
|
|
||||||
bindir=/usr/lib/postgresql/${PG_MAJOR}/bin \
|
|
||||||
citus-old-version=${citus_version} \
|
|
||||||
citus-pre-tar=/install-pg${PG_MAJOR}-citus${citus_version}.tar \
|
|
||||||
citus-post-tar=/home/circleci/project/install-$PG_MAJOR.tar; \
|
|
||||||
done;
|
|
||||||
|
|
||||||
# run make check-citus-upgrade-mixed for all citus versions
|
|
||||||
# the image has ${CITUS_VERSIONS} set with all verions it contains the binaries of
|
|
||||||
for citus_version in ${CITUS_VERSIONS}; do \
|
|
||||||
gosu circleci \
|
|
||||||
make -C src/test/regress \
|
|
||||||
check-citus-upgrade-mixed \
|
|
||||||
citus-old-version=${citus_version} \
|
|
||||||
bindir=/usr/lib/postgresql/${PG_MAJOR}/bin \
|
|
||||||
citus-pre-tar=/install-pg${PG_MAJOR}-citus${citus_version}.tar \
|
|
||||||
citus-post-tar=/home/circleci/project/install-$PG_MAJOR.tar; \
|
|
||||||
done;
|
|
||||||
no_output_timeout: 2m
|
|
||||||
- save_logs_and_results
|
|
||||||
- save_regressions
|
|
||||||
- stack_trace
|
|
||||||
- coverage:
|
|
||||||
flags: 'test_<< parameters.pg_major >>,upgrade'
|
|
||||||
|
|
||||||
test-citus:
|
|
||||||
description: Runs the common tests of citus
|
|
||||||
parameters:
|
|
||||||
pg_major:
|
|
||||||
description: 'postgres major version'
|
|
||||||
type: integer
|
|
||||||
image:
|
|
||||||
description: 'docker image to use as for the tests'
|
|
||||||
type: string
|
|
||||||
default: citus/exttester
|
|
||||||
image_tag:
|
|
||||||
description: 'docker image tag to use'
|
|
||||||
type: string
|
|
||||||
make:
|
|
||||||
description: 'make target'
|
|
||||||
type: string
|
|
||||||
docker:
|
|
||||||
- image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>'
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- install_extension:
|
|
||||||
pg_major: << parameters.pg_major >>
|
|
||||||
- configure
|
|
||||||
- enable_core
|
|
||||||
- run:
|
|
||||||
name: 'Run Test'
|
|
||||||
command: |
|
|
||||||
gosu circleci make -C src/test/regress << parameters.make >>
|
|
||||||
no_output_timeout: 2m
|
|
||||||
- save_logs_and_results
|
|
||||||
- save_regressions
|
|
||||||
- stack_trace
|
|
||||||
- coverage:
|
|
||||||
flags: 'test_<< parameters.pg_major >>,<< parameters.make >>'
|
|
||||||
|
|
||||||
tap-test-citus:
|
|
||||||
description: Runs tap tests for citus
|
|
||||||
parameters:
|
|
||||||
pg_major:
|
|
||||||
description: 'postgres major version'
|
|
||||||
type: integer
|
|
||||||
image:
|
|
||||||
description: 'docker image to use as for the tests'
|
|
||||||
type: string
|
|
||||||
default: citus/exttester
|
|
||||||
image_tag:
|
|
||||||
description: 'docker image tag to use'
|
|
||||||
type: string
|
|
||||||
suite:
|
|
||||||
description: 'name of the tap test suite to run'
|
|
||||||
type: string
|
|
||||||
make:
|
|
||||||
description: 'make target'
|
|
||||||
type: string
|
|
||||||
default: installcheck
|
|
||||||
docker:
|
|
||||||
- image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>'
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- install_extension:
|
|
||||||
pg_major: << parameters.pg_major >>
|
|
||||||
- configure
|
|
||||||
- enable_core
|
|
||||||
- run:
|
|
||||||
name: 'Run Test'
|
|
||||||
command: |
|
|
||||||
gosu circleci make -C src/test/<< parameters.suite >> << parameters.make >>
|
|
||||||
no_output_timeout: 2m
|
|
||||||
- store_artifacts:
|
|
||||||
name: 'Save tap logs'
|
|
||||||
path: /home/circleci/project/src/test/<< parameters.suite >>/tmp_check/log
|
|
||||||
- save_logs_and_results
|
|
||||||
- stack_trace
|
|
||||||
- coverage:
|
|
||||||
flags: 'test_<< parameters.pg_major >>,tap_<< parameters.suite >>_<< parameters.make >>'
|
|
||||||
|
|
||||||
check-merge-to-enterprise:
|
|
||||||
docker:
|
|
||||||
- image: citus/extbuilder:<< pipeline.parameters.pg13_version >>
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
command: |
|
|
||||||
ci/check_enterprise_merge.sh
|
|
||||||
|
|
||||||
ch_benchmark:
|
|
||||||
docker:
|
|
||||||
- image: buildpack-deps:stretch
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- azure-cli/install
|
|
||||||
- azure-cli/login-with-service-principal
|
|
||||||
- run:
|
|
||||||
command: |
|
|
||||||
cd ./src/test/hammerdb
|
|
||||||
sh run_hammerdb.sh citusbot_ch_benchmark_rg
|
|
||||||
name: install dependencies and run ch_benchmark tests
|
|
||||||
no_output_timeout: 20m
|
|
||||||
|
|
||||||
tpcc_benchmark:
|
|
||||||
docker:
|
|
||||||
- image: buildpack-deps:stretch
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- azure-cli/install
|
|
||||||
- azure-cli/login-with-service-principal
|
|
||||||
- run:
|
|
||||||
command: |
|
|
||||||
cd ./src/test/hammerdb
|
|
||||||
sh run_hammerdb.sh citusbot_tpcc_benchmark_rg
|
|
||||||
name: install dependencies and run ch_benchmark tests
|
|
||||||
no_output_timeout: 20m
|
|
||||||
|
|
||||||
test-flakyness:
|
|
||||||
description: Runs a test multiple times to see if it's flaky
|
|
||||||
parallelism: 32
|
|
||||||
parameters:
|
|
||||||
pg_major:
|
|
||||||
description: 'postgres major version'
|
|
||||||
type: integer
|
|
||||||
image:
|
|
||||||
description: 'docker image to use as for the tests'
|
|
||||||
type: string
|
|
||||||
default: citus/failtester
|
|
||||||
image_tag:
|
|
||||||
description: 'docker image tag to use'
|
|
||||||
type: string
|
|
||||||
test:
|
|
||||||
description: 'the test file path that should be run multiple times'
|
|
||||||
type: string
|
|
||||||
default: ''
|
|
||||||
runs:
|
|
||||||
description: 'number of times that the test should be run in total'
|
|
||||||
type: integer
|
|
||||||
default: 8
|
|
||||||
skip:
|
|
||||||
description: 'A flag to bypass flaky test detection.'
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
docker:
|
|
||||||
- image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>'
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
resource_class: small
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run:
|
|
||||||
name: 'Detect regression tests need to be ran'
|
|
||||||
command: |
|
|
||||||
skip=<< parameters.skip >>
|
|
||||||
if [ "$skip" = true ]; then
|
|
||||||
echo "Skipping flaky test detection."
|
|
||||||
circleci-agent step halt
|
|
||||||
fi
|
|
||||||
|
|
||||||
testForDebugging="<< parameters.test >>"
|
|
||||||
|
|
||||||
if [ -z "$testForDebugging" ]; then
|
|
||||||
detected_changes=$(git diff origin/main... --name-only --diff-filter=AM | (grep 'src/test/regress/sql/.*.sql\|src/test/regress/spec/.*.spec' || true))
|
|
||||||
tests=${detected_changes}
|
|
||||||
else
|
|
||||||
tests=$testForDebugging;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$tests" ]; then
|
|
||||||
echo "No test found."
|
|
||||||
circleci-agent step halt
|
|
||||||
else
|
|
||||||
echo "Detected tests " $tests
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo export tests=\""$tests"\" >> "$BASH_ENV"
|
|
||||||
source "$BASH_ENV"
|
|
||||||
- install_extension:
|
|
||||||
pg_major: << parameters.pg_major >>
|
|
||||||
- configure
|
|
||||||
- enable_core
|
|
||||||
- run:
|
|
||||||
name: 'Run minimal tests'
|
|
||||||
command: |
|
|
||||||
tests_array=($tests)
|
|
||||||
for test in "${tests_array[@]}"
|
|
||||||
do
|
|
||||||
test_name=$(echo "$test" | sed -r "s/.+\/(.+)\..+/\1/")
|
|
||||||
gosu circleci src/test/regress/citus_tests/run_test.py $test_name --repeat << parameters.runs >> --use-base-schedule --use-whole-schedule-line
|
|
||||||
done
|
|
||||||
no_output_timeout: 2m
|
|
||||||
- save_logs_and_results
|
|
||||||
- save_regressions
|
|
||||||
- stack_trace
|
|
||||||
|
|
||||||
upload-coverage:
|
|
||||||
docker:
|
|
||||||
- image: 'citus/exttester:<< pipeline.parameters.pg15_version >><< pipeline.parameters.image_suffix >>'
|
|
||||||
working_directory: /home/circleci/project
|
|
||||||
steps:
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run:
|
|
||||||
name: Upload coverage results to Code Climate
|
|
||||||
command: |
|
|
||||||
cc-test-reporter sum-coverage codeclimate/*.json -o total.json
|
|
||||||
cc-test-reporter upload-coverage -i total.json
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
flaky_test_debugging:
|
|
||||||
jobs:
|
|
||||||
- build:
|
|
||||||
name: build-flaky-15
|
|
||||||
pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
|
||||||
|
|
||||||
- test-flakyness:
|
|
||||||
name: 'test-15_flaky'
|
|
||||||
pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
|
||||||
requires: [build-flaky-15]
|
|
||||||
test: '<< pipeline.parameters.flaky_test >>'
|
|
||||||
runs: << pipeline.parameters.flaky_test_runs_per_job >>
|
|
||||||
|
|
||||||
build_and_test:
|
|
||||||
jobs:
|
|
||||||
- build:
|
|
||||||
name: build-13
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
- build:
|
|
||||||
name: build-14
|
|
||||||
pg_major: 14
|
|
||||||
image_tag: '<< pipeline.parameters.pg14_version >>'
|
|
||||||
- build:
|
|
||||||
name: build-15
|
|
||||||
pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
|
||||||
|
|
||||||
- check-style
|
|
||||||
- check-sql-snapshots
|
|
||||||
|
|
||||||
- test-citus: &test-citus-13
|
|
||||||
name: 'test-13_check-multi'
|
|
||||||
make: check-multi
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-multi-1'
|
|
||||||
make: check-multi-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-mx'
|
|
||||||
make: check-multi-mx
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-vanilla'
|
|
||||||
make: check-vanilla
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-isolation'
|
|
||||||
make: check-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-operations'
|
|
||||||
make: check-operations
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-follower-cluster'
|
|
||||||
make: check-follower-cluster
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-columnar'
|
|
||||||
make: check-columnar
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-columnar-isolation'
|
|
||||||
make: check-columnar-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-failure
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise'
|
|
||||||
make: check-enterprise
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation'
|
|
||||||
make: check-enterprise-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation-logicalrep-1'
|
|
||||||
make: check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation-logicalrep-2'
|
|
||||||
make: check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-isolation-logicalrep-3'
|
|
||||||
make: check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-enterprise-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-enterprise-failure
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-13
|
|
||||||
name: 'test-13_check-split'
|
|
||||||
make: check-split
|
|
||||||
|
|
||||||
- test-citus: &test-citus-14
|
|
||||||
name: 'test-14_check-split'
|
|
||||||
make: check-split
|
|
||||||
pg_major: 14
|
|
||||||
image_tag: '<< pipeline.parameters.pg14_version >>'
|
|
||||||
requires: [build-14]
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-enterprise'
|
|
||||||
make: check-enterprise
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-enterprise-isolation'
|
|
||||||
make: check-enterprise-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-enterprise-isolation-logicalrep-1'
|
|
||||||
make: check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-enterprise-isolation-logicalrep-2'
|
|
||||||
make: check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-enterprise-isolation-logicalrep-3'
|
|
||||||
make: check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-enterprise-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-enterprise-failure
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-multi'
|
|
||||||
make: check-multi
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-multi-1'
|
|
||||||
make: check-multi-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-mx'
|
|
||||||
make: check-multi-mx
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-vanilla'
|
|
||||||
make: check-vanilla
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-isolation'
|
|
||||||
make: check-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-operations'
|
|
||||||
make: check-operations
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-follower-cluster'
|
|
||||||
make: check-follower-cluster
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-columnar'
|
|
||||||
make: check-columnar
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-columnar-isolation'
|
|
||||||
make: check-columnar-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-14
|
|
||||||
name: 'test-14_check-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-failure
|
|
||||||
|
|
||||||
- test-citus: &test-citus-15
|
|
||||||
name: 'test-15_check-split'
|
|
||||||
make: check-split
|
|
||||||
pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
|
||||||
requires: [build-15]
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-enterprise'
|
|
||||||
make: check-enterprise
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-enterprise-isolation'
|
|
||||||
make: check-enterprise-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-enterprise-isolation-logicalrep-1'
|
|
||||||
make: check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-enterprise-isolation-logicalrep-2'
|
|
||||||
make: check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-enterprise-isolation-logicalrep-3'
|
|
||||||
make: check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-enterprise-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-enterprise-failure
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-multi'
|
|
||||||
make: check-multi
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-multi-1'
|
|
||||||
make: check-multi-1
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-mx'
|
|
||||||
make: check-multi-mx
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-vanilla'
|
|
||||||
make: check-vanilla
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-isolation'
|
|
||||||
make: check-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-operations'
|
|
||||||
make: check-operations
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-follower-cluster'
|
|
||||||
make: check-follower-cluster
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-columnar'
|
|
||||||
make: check-columnar
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-columnar-isolation'
|
|
||||||
make: check-columnar-isolation
|
|
||||||
- test-citus:
|
|
||||||
<<: *test-citus-15
|
|
||||||
name: 'test-15_check-failure'
|
|
||||||
image: citus/failtester
|
|
||||||
make: check-failure
|
|
||||||
|
|
||||||
- tap-test-citus: &tap-test-citus-13
|
|
||||||
name: 'test-13_tap-recovery'
|
|
||||||
suite: recovery
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
- tap-test-citus:
|
|
||||||
<<: *tap-test-citus-13
|
|
||||||
name: 'test-13_tap-columnar-freezing'
|
|
||||||
suite: columnar_freezing
|
|
||||||
|
|
||||||
- tap-test-citus: &tap-test-citus-14
|
|
||||||
name: 'test-14_tap-recovery'
|
|
||||||
suite: recovery
|
|
||||||
pg_major: 14
|
|
||||||
image_tag: '<< pipeline.parameters.pg14_version >>'
|
|
||||||
requires: [build-14]
|
|
||||||
- tap-test-citus:
|
|
||||||
<<: *tap-test-citus-14
|
|
||||||
name: 'test-14_tap-columnar-freezing'
|
|
||||||
suite: columnar_freezing
|
|
||||||
|
|
||||||
- tap-test-citus: &tap-test-citus-15
|
|
||||||
name: 'test-15_tap-recovery'
|
|
||||||
suite: recovery
|
|
||||||
pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
|
||||||
requires: [build-15]
|
|
||||||
- tap-test-citus:
|
|
||||||
<<: *tap-test-citus-15
|
|
||||||
name: 'test-15_tap-columnar-freezing'
|
|
||||||
suite: columnar_freezing
|
|
||||||
|
|
||||||
- test-arbitrary-configs:
|
|
||||||
name: 'test-13_check-arbitrary-configs'
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
|
|
||||||
- test-arbitrary-configs:
|
|
||||||
name: 'test-14_check-arbitrary-configs'
|
|
||||||
pg_major: 14
|
|
||||||
image_tag: '<< pipeline.parameters.pg14_version >>'
|
|
||||||
requires: [build-14]
|
|
||||||
|
|
||||||
- test-arbitrary-configs:
|
|
||||||
name: 'test-15_check-arbitrary-configs'
|
|
||||||
pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
|
||||||
requires: [build-15]
|
|
||||||
|
|
||||||
- test-pg-upgrade:
|
|
||||||
name: 'test-13-14_check-pg-upgrade'
|
|
||||||
old_pg_major: 13
|
|
||||||
new_pg_major: 14
|
|
||||||
image_tag: '<< pipeline.parameters.upgrade_pg_versions >>'
|
|
||||||
requires: [build-13, build-14]
|
|
||||||
|
|
||||||
- test-pg-upgrade:
|
|
||||||
name: 'test-14-15_check-pg-upgrade'
|
|
||||||
old_pg_major: 14
|
|
||||||
new_pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.upgrade_pg_versions >>'
|
|
||||||
requires: [build-14, build-15]
|
|
||||||
|
|
||||||
- test-citus-upgrade:
|
|
||||||
name: test-13_check-citus-upgrade
|
|
||||||
pg_major: 13
|
|
||||||
image_tag: '<< pipeline.parameters.pg13_version >>'
|
|
||||||
requires: [build-13]
|
|
||||||
|
|
||||||
- upload-coverage:
|
|
||||||
requires:
|
|
||||||
- test-13_check-multi
|
|
||||||
- test-13_check-multi-1
|
|
||||||
- test-13_check-mx
|
|
||||||
- test-13_check-vanilla
|
|
||||||
- test-13_check-isolation
|
|
||||||
- test-13_check-operations
|
|
||||||
- test-13_check-follower-cluster
|
|
||||||
- test-13_check-columnar
|
|
||||||
- test-13_check-columnar-isolation
|
|
||||||
- test-13_tap-recovery
|
|
||||||
- test-13_tap-columnar-freezing
|
|
||||||
- test-13_check-failure
|
|
||||||
- test-13_check-enterprise
|
|
||||||
- test-13_check-enterprise-isolation
|
|
||||||
- test-13_check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-13_check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-13_check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-13_check-enterprise-failure
|
|
||||||
- test-13_check-split
|
|
||||||
- test-13_check-arbitrary-configs
|
|
||||||
- test-14_check-multi
|
|
||||||
- test-14_check-multi-1
|
|
||||||
- test-14_check-mx
|
|
||||||
- test-14_check-vanilla
|
|
||||||
- test-14_check-isolation
|
|
||||||
- test-14_check-operations
|
|
||||||
- test-14_check-follower-cluster
|
|
||||||
- test-14_check-columnar
|
|
||||||
- test-14_check-columnar-isolation
|
|
||||||
- test-14_tap-recovery
|
|
||||||
- test-14_tap-columnar-freezing
|
|
||||||
- test-14_check-failure
|
|
||||||
- test-14_check-enterprise
|
|
||||||
- test-14_check-enterprise-isolation
|
|
||||||
- test-14_check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-14_check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-14_check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-14_check-enterprise-failure
|
|
||||||
- test-14_check-split
|
|
||||||
- test-14_check-arbitrary-configs
|
|
||||||
- test-15_check-multi
|
|
||||||
- test-15_check-multi-1
|
|
||||||
- test-15_check-mx
|
|
||||||
- test-15_check-vanilla
|
|
||||||
- test-15_check-isolation
|
|
||||||
- test-15_check-operations
|
|
||||||
- test-15_check-follower-cluster
|
|
||||||
- test-15_check-columnar
|
|
||||||
- test-15_check-columnar-isolation
|
|
||||||
- test-15_tap-recovery
|
|
||||||
- test-15_tap-columnar-freezing
|
|
||||||
- test-15_check-failure
|
|
||||||
- test-15_check-enterprise
|
|
||||||
- test-15_check-enterprise-isolation
|
|
||||||
- test-15_check-enterprise-isolation-logicalrep-1
|
|
||||||
- test-15_check-enterprise-isolation-logicalrep-2
|
|
||||||
- test-15_check-enterprise-isolation-logicalrep-3
|
|
||||||
- test-15_check-enterprise-failure
|
|
||||||
- test-15_check-split
|
|
||||||
- test-15_check-arbitrary-configs
|
|
||||||
- test-13-14_check-pg-upgrade
|
|
||||||
- test-14-15_check-pg-upgrade
|
|
||||||
- test-13_check-citus-upgrade
|
|
||||||
|
|
||||||
- ch_benchmark:
|
|
||||||
requires: [build-13]
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- /ch_benchmark\/.*/ # match with ch_benchmark/ prefix
|
|
||||||
- tpcc_benchmark:
|
|
||||||
requires: [build-13]
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- /tpcc_benchmark\/.*/ # match with tpcc_benchmark/ prefix
|
|
||||||
- test-flakyness:
|
|
||||||
name: 'test-15_flaky'
|
|
||||||
pg_major: 15
|
|
||||||
image_tag: '<< pipeline.parameters.pg15_version >>'
|
|
||||||
requires: [build-15]
|
|
||||||
skip: << pipeline.parameters.skip_flaky_tests >>
|
|
|
@ -14,8 +14,8 @@ ci_scripts=$(
|
||||||
grep -v -E '^(ci_helpers.sh|fix_style.sh)$'
|
grep -v -E '^(ci_helpers.sh|fix_style.sh)$'
|
||||||
)
|
)
|
||||||
for script in $ci_scripts; do
|
for script in $ci_scripts; do
|
||||||
if ! grep "\\bci/$script\\b" .circleci/config.yml > /dev/null; then
|
if ! grep "\\bci/$script\\b" -r .github > /dev/null; then
|
||||||
echo "ERROR: CI script with name \"$script\" is not actually used in .circleci/config.yml"
|
echo "ERROR: CI script with name \"$script\" is not actually used in .github folder"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! grep "^## \`$script\`\$" ci/README.md > /dev/null; then
|
if ! grep "^## \`$script\`\$" ci/README.md > /dev/null; then
|
||||||
|
|
|
@ -1,96 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Testing this script locally requires you to set the following environment
|
|
||||||
# variables:
|
|
||||||
# CIRCLE_BRANCH, GIT_USERNAME and GIT_TOKEN
|
|
||||||
|
|
||||||
# fail if trying to reference a variable that is not set.
|
|
||||||
set -u
|
|
||||||
# exit immediately if a command fails
|
|
||||||
set -e
|
|
||||||
# Fail on pipe failures
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
PR_BRANCH="${CIRCLE_BRANCH}"
|
|
||||||
ENTERPRISE_REMOTE="https://${GIT_USERNAME}:${GIT_TOKEN}@github.com/citusdata/citus-enterprise"
|
|
||||||
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source ci/ci_helpers.sh
|
|
||||||
|
|
||||||
# List executed commands. This is done so debugging this script is easier when
|
|
||||||
# it fails. It's explicitly done after git remote add so username and password
|
|
||||||
# are not shown in CI output (even though it's also filtered out by CircleCI)
|
|
||||||
set -x
|
|
||||||
|
|
||||||
check_compile () {
|
|
||||||
echo "INFO: checking if merged code can be compiled"
|
|
||||||
./configure --without-libcurl
|
|
||||||
make -j10
|
|
||||||
}
|
|
||||||
|
|
||||||
# Clone current git repo (which should be community) to a temporary working
|
|
||||||
# directory and go there
|
|
||||||
GIT_DIR_ROOT="$(git rev-parse --show-toplevel)"
|
|
||||||
TMP_GIT_DIR="$(mktemp --directory -t citus-merge-check.XXXXXXXXX)"
|
|
||||||
git clone "$GIT_DIR_ROOT" "$TMP_GIT_DIR"
|
|
||||||
cd "$TMP_GIT_DIR"
|
|
||||||
|
|
||||||
# Fails in CI without this
|
|
||||||
git config user.email "citus-bot@microsoft.com"
|
|
||||||
git config user.name "citus bot"
|
|
||||||
|
|
||||||
# Disable "set -x" temporarily, because $ENTERPRISE_REMOTE contains passwords
|
|
||||||
{ set +x ; } 2> /dev/null
|
|
||||||
git remote add enterprise "$ENTERPRISE_REMOTE"
|
|
||||||
set -x
|
|
||||||
|
|
||||||
git remote set-url --push enterprise no-pushing
|
|
||||||
|
|
||||||
# Fetch enterprise-master
|
|
||||||
git fetch enterprise enterprise-master
|
|
||||||
|
|
||||||
|
|
||||||
git checkout "enterprise/enterprise-master"
|
|
||||||
|
|
||||||
if git merge --no-commit "origin/$PR_BRANCH"; then
|
|
||||||
echo "INFO: community PR branch could be merged into enterprise-master"
|
|
||||||
# check that we can compile after the merge
|
|
||||||
if check_compile; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "WARN: Failed to compile after community PR branch was merged into enterprise"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# undo partial merge
|
|
||||||
git merge --abort
|
|
||||||
|
|
||||||
# If we have a conflict on enterprise merge on the master branch, we have a problem.
|
|
||||||
# Provide an error message to indicate that enterprise merge is needed to fix this check.
|
|
||||||
if [[ $PR_BRANCH = master ]]; then
|
|
||||||
echo "ERROR: Master branch has merge conflicts with enterprise-master."
|
|
||||||
echo "Try re-running this CI job after merging your changes into enterprise-master."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! git fetch enterprise "$PR_BRANCH" ; then
|
|
||||||
echo "ERROR: enterprise/$PR_BRANCH was not found and community PR branch could not be merged into enterprise-master"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Show the top commit of the enterprise PR branch to make debugging easier
|
|
||||||
git log -n 1 "enterprise/$PR_BRANCH"
|
|
||||||
|
|
||||||
# Check that this branch contains the top commit of the current community PR
|
|
||||||
# branch. If it does not it means it's not up to date with the current PR, so
|
|
||||||
# the enterprise branch should be updated.
|
|
||||||
if ! git merge-base --is-ancestor "origin/$PR_BRANCH" "enterprise/$PR_BRANCH" ; then
|
|
||||||
echo "ERROR: enterprise/$PR_BRANCH is not up to date with community PR branch"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Now check if we can merge the enterprise PR into enterprise-master without
|
|
||||||
# issues.
|
|
||||||
git merge --no-commit "enterprise/$PR_BRANCH"
|
|
||||||
# check that we can compile after the merge
|
|
||||||
check_compile
|
|
Loading…
Reference in New Issue