Merge pull request #2616 from citusdata/circleci

Enable CircleCI
pull/2618/head
Jason Petersen 2019-02-26 23:48:11 -07:00 committed by GitHub
commit bf9a119b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 162 additions and 34 deletions

96
.circleci/config.yml Normal file
View File

@ -0,0 +1,96 @@
version: 2.1
orbs:
codecov: codecov/codecov@1.0.4
jobs:
build:
docker:
- {image: 'citusdata/extbuilder:latest'}
steps:
- checkout
- {run: {name: 'Configure, Build, and Install', command: build-ext}}
- {persist_to_workspace: {root: ., paths: [.]}}
check-style:
docker:
- {image: 'citusdata/stylechecker:latest'}
steps:
- checkout
- {run: {name: 'Check Style', command: citus_indent --check}}
test-10_check-multi:
docker:
- {image: 'citusdata/exttester-10:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-multi)', command: 'install-and-test-ext check-multi'}}
- {codecov/upload: {flags: 'test_10,multi'}}
test-10_check-tt-van-mx:
docker:
- {image: 'citusdata/exttester-10:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-tt-van-mx)', command: 'install-and-test-ext check-multi-task-tracker-extra check-vanilla check-multi-mx'}}
- {codecov/upload: {flags: 'test_10,tracker,vanilla,mx'}}
test-10_check-iso-work-fol:
docker:
- {image: 'citusdata/exttester-10:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-iso-work-fol)', command: 'install-and-test-ext check-isolation check-worker check-follower-cluster'}}
- {codecov/upload: {flags: 'test_10,isolation,worker,follower'}}
test-10_check-failure:
docker:
- {image: 'citusdata/failtester-10:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-failure)', command: 'install-and-test-ext check-failure'}}
test-11_check-multi:
docker:
- {image: 'citusdata/exttester-11:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-multi)', command: 'install-and-test-ext check-multi'}}
- {codecov/upload: {flags: 'test_11,multi'}}
test-11_check-tt-van-mx:
docker:
- {image: 'citusdata/exttester-11:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-tt-van-mx)', command: 'install-and-test-ext check-multi-task-tracker-extra check-vanilla check-multi-mx'}}
- {codecov/upload: {flags: 'test_11,tracker,vanilla,mx'}}
test-11_check-iso-work-fol:
docker:
- {image: 'citusdata/exttester-11:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-iso-work-fol)', command: 'install-and-test-ext check-isolation check-worker check-follower-cluster'}}
- {codecov/upload: {flags: 'test_11,isolation,worker,follower'}}
test-11_check-failure:
docker:
- {image: 'citusdata/failtester-11:latest'}
working_directory: /home/circleci/project
steps:
- {attach_workspace: {at: .}}
- {run: {name: 'Install and Test (check-failure)', command: 'install-and-test-ext check-failure'}}
workflows:
version: 2
build_and_test:
jobs:
- build
- check-style
- {test-10_check-multi: {requires: [build]}}
- {test-10_check-tt-van-mx: {requires: [build]}}
- {test-10_check-iso-work-fol: {requires: [build]}}
- {test-10_check-failure: {requires: [build]}}
- {test-11_check-multi: {requires: [build]}}
- {test-11_check-tt-van-mx: {requires: [build]}}
- {test-11_check-iso-work-fol: {requires: [build]}}
- {test-11_check-failure: {requires: [build]}}

View File

@ -49,8 +49,7 @@ install:
apt-get download "postgresql-${PGVERSION}-topn=2.2.0"
sudo dpkg --force-confold --force-confdef --force-all -i *topn*.deb
fi
before_script: citus_indent --quiet --check
before_script: citus_indent --quiet --check || echo 'Ignoring indent failures'
script: CFLAGS=-Werror pg_travis_multi_test check
after_success:
- sync_to_enterprise
- bash <(curl -s https://codecov.io/bash)

View File

@ -69,7 +69,7 @@ endif
# Add options passed to configure or computed therein, to CFLAGS/CPPFLAGS/...
override CFLAGS += @CFLAGS@ @CITUS_CFLAGS@
override CPPFLAGS := @CPPFLAGS@ -I '${citus_abs_top_srcdir}/src/include' -I'${citus_top_builddir}/src/include' $(CPPFLAGS)
override CPPFLAGS := @CPPFLAGS@ @CITUS_CPPFLAGS@ -I '${citus_abs_top_srcdir}/src/include' -I'${citus_top_builddir}/src/include' $(CPPFLAGS)
override LDFLAGS += @LDFLAGS@ @CITUS_LDFLAGS@
# optional file with user defined, additional, rules

9
configure vendored
View File

@ -625,6 +625,7 @@ LIBOBJS
POSTGRES_BUILDDIR
POSTGRES_SRCDIR
CITUS_LDFLAGS
CITUS_CPPFLAGS
CITUS_CFLAGS
EGREP
GREP
@ -4052,7 +4053,9 @@ if test "${enable_coverage+set}" = set; then :
fi
if test "$enable_coverage" = yes; then
CITUS_CFLAGS="$CITUS_CFLAGS -fprofile-arcs -ftest-coverage"
CITUS_CFLAGS="$CITUS_CFLAGS -O0 -g --coverage"
CITUS_CPPFLAGS="$CITUS_CPPFLAGS -DNDEBUG"
CITUS_LDFLAGS="$CITUS_LDFLAGS --coverage"
fi
#
@ -4183,7 +4186,9 @@ _ACEOF
CITUS_CFLAGS="$CITUS_CFLAGS"
CITUS_LDFLAGS="$LIBS"
CITUS_CPPFLAGS="$CITUS_CPPFLAGS"
CITUS_LDFLAGS="$LIBS $CITUS_LDFLAGS"
POSTGRES_SRCDIR="$POSTGRES_SRCDIR"

View File

@ -170,7 +170,9 @@ CITUSAC_PROG_CC_CFLAGS_OPT([-Werror=vla]) # visual studio does not support thes
#
AC_ARG_ENABLE([coverage], AS_HELP_STRING([--enable-coverage], [build with coverage testing instrumentation]))
if test "$enable_coverage" = yes; then
CITUS_CFLAGS="$CITUS_CFLAGS -fprofile-arcs -ftest-coverage"
CITUS_CFLAGS="$CITUS_CFLAGS -O0 -g --coverage"
CITUS_CPPFLAGS="$CITUS_CPPFLAGS -DNDEBUG"
CITUS_LDFLAGS="$CITUS_LDFLAGS --coverage"
fi
#
@ -201,7 +203,8 @@ AC_DEFINE_UNQUOTED(REPORTS_BASE_URL, "$REPORTS_BASE_URL",
[Base URL for statistics collection and update checks])
AC_SUBST(CITUS_CFLAGS, "$CITUS_CFLAGS")
AC_SUBST(CITUS_LDFLAGS, "$LIBS")
AC_SUBST(CITUS_CPPFLAGS, "$CITUS_CPPFLAGS")
AC_SUBST(CITUS_LDFLAGS, "$LIBS $CITUS_LDFLAGS")
AC_SUBST(POSTGRES_SRCDIR, "$POSTGRES_SRCDIR")
AC_SUBST(POSTGRES_BUILDDIR, "$POSTGRES_BUILDDIR")

View File

@ -33,7 +33,7 @@ CitusSetTag(Node *node, int tag)
#define DECLARE_FROM_AND_NEW_NODE(nodeTypeName) \
nodeTypeName * newnode = (nodeTypeName *) \
nodeTypeName *newnode = (nodeTypeName *) \
CitusSetTag((Node *) target_node, T_ ## nodeTypeName); \
nodeTypeName *from = (nodeTypeName *) source_node

View File

@ -15,7 +15,7 @@ endif
##
MULTI_INSTALLDIR=$(CURDIR)/tmp_check/install
pg_regress_multi_check = $(PERL) $(citus_abs_srcdir)/pg_regress_multi.pl --pgxsdir="$(pgxsdir)" --bindir="$(bindir)" --libdir="$(libdir)" --majorversion="$(MAJORVERSION)" --postgres-builddir="$(postgres_abs_builddir)" --postgres-srcdir="$(postgres_abs_srcdir)"
MULTI_REGRESS_OPTS = --inputdir=$(citus_abs_srcdir) $(pg_regress_locale_flags)
MULTI_REGRESS_OPTS = --inputdir=$(citus_abs_srcdir) $(pg_regress_locale_flags) --launcher="$(citus_abs_srcdir)/log_test_times"
# XXX: Can't actually do useful testruns against install - $libdir
# etc will point to the directory configured during postgres'

View File

@ -0,0 +1,4 @@
#!/bin/bash
export TIMEFORMAT="${PG_MAJOR}/${PGAPPNAME} %6R"
{ { time "$@" 1>&3- 2>&4-; } 2>> test_times.log; } 3>&1 4>&2

View File

@ -16,6 +16,7 @@ use warnings;
use Fcntl;
use Getopt::Long;
use File::Basename;
use File::Spec::Functions;
use File::Path qw(make_path remove_tree);
use Config;
@ -151,6 +152,11 @@ else
$plainRegress = "$pgxsdir/src/test/regress/pg_regress";
$isolationRegress = "${postgresBuilddir}/src/test/isolation/pg_isolation_regress";
$pgConfig = "$bindir/pg_config";
if (-x "$pgxsdir/src/test/isolation/pg_isolation_regress")
{
$isolationRegress = "$pgxsdir/src/test/isolation/pg_isolation_regress";
}
}
if ($isolationtester && ! -f "$isolationRegress")
@ -171,7 +177,9 @@ MESSAGE
}
my $vanillaRegress = catfile("${postgresBuilddir}", "src", "test", "regress", "pg_regress");
if ($vanillatest && ! -f "$vanillaRegress")
my $vanillaSchedule = catfile(dirname("${pgxsdir}"), "regress", "parallel_schedule");
if ($vanillatest && ! (-f "$vanillaRegress" or -f "$vanillaSchedule"))
{
die <<"MESSAGE";
@ -796,8 +804,21 @@ if ($vanillatest)
$ENV{PGPORT} = $masterPort;
$ENV{PGUSER} = $user;
if (-f "$vanillaSchedule")
{
rmdir "./testtablespace";
mkdir "./testtablespace";
my $pgregressdir=catfile(dirname("$pgxsdir"), "regress");
system("$plainRegress", ("--inputdir", $pgregressdir),
("--schedule", catfile("$pgregressdir", "parallel_schedule"))) == 0
or die "Could not run vanilla tests";
}
else
{
system("make", ("-C", catfile("$postgresBuilddir", "src", "test", "regress"), "installcheck-parallel")) == 0
or die "Could not run vanilla tests";
}
}
elsif ($isolationtester)
{