19 Commits

Author SHA1 Message Date
Sven Klemm
666369ea2e Migrate update test to GitHub actions
This patch migrates the update tests from Travis to GitHub actions.
2020-07-06 14:21:00 +02:00
Erik Nordström
f64fd4247f Make image build script work with remote Docker
This change tweaks the `docker-build.sh` script to work against remote
Docker daemons. This is useful when testing on minikube and you want
to quickly build and deploy a new image with the current code without
having to push to a remote registry.
2020-05-27 17:31:09 +02:00
Ruslan Fomkin
403782a589 Run regression test on latest PG versions
Docker images are build with latest versions of PostgreSQL, thus
updating regression tests to run on the latest PG versions. Fixing
authentication for PG docker images, since it is required after a
recent change in docker-library/postgres@42ce743.

Running isolation tests on new versions of PG produces additional
output:
- Notifications are not missed to print postgres/postgres@ebd4992
- Notifications are prefixed with session name
postgres/postgres@a28e10e
- Timeout cancellation is printed in isolation tests
postgres/postgres@b578404

The expected outputs are modified to succeed on latest PG versions,
while the affected isolation tests are disabled for earlier versions
of PG.
2020-04-02 08:57:28 +02:00
Mats Kindahl
d1f8f9d326 CMake check for necessary testing tools
Adding checks for `pg_isolation_regress` and `pg_regress` and not
running the tests if the programs cannot be found either installed in
default directories or provided with the `PG_PATH` variable, or the
`PG_SOURCE_DIR` variable.
2019-06-28 13:47:28 +02:00
Joshua Lockerman
4ff6ac7b91 Initial Timescale-Licensed-Module and License-Key Implementation
This commit adds support for dynamically loaded submodules to timescaledb
as well an initial license-key implementation in the tsl subdirectory.
Dynamically loaded modules allow our users to determine which licenses they
wish to use for their version of timescaledb; if they wish to only use
Apache-Licensed code, they do not load the Timescale-Licensed submodule. Calls
from the Apache-Licensed code into the Timescale-Licensed submodule are
handled via dynamicaly-set function pointers; see tsl/src/Readme.module.md for
more details.

This commit also adds code for license keys for the ApacheOnly, Community, and
Enterprise editions. The license key determines which features are enabled,
and controls loading the submodule: when a license key that requires the
sub-module is installed, the module is automatically loaded.
Currently the ApacheOnly and Community license-keys are hardcoded to be
"ApacheOnly" and "Community" respectively. The first version of the enterprise
license-key is described in tsl/src/Readme.module.md
2019-01-02 15:43:48 -05:00
Sven Klemm
981147fd8b Fall back to commit hash in update tests
Travis CI occasionally has trouble figuring out the branch, so this
change makes sure it falls back to using at least a commit hash
2018-12-12 19:55:57 +01:00
Erik Nordström
b7a4851cd0 Run update tests in parallel
This change makes the update tests from each prior version of
TimescaleDB to run in parallel instead of in serial order.

This speeds up the testing significantly.
2018-10-29 15:19:16 +01:00
Erik Nordström
7fb6fbacdd Refactor docker-build.sh to reuse images
The docker-build.sh script, which is used to build a Docker image from
the currently checked-out source code, has been refactored to make
better use of cached images. This speeds up the build process and allows
faster Travis builds.
2018-10-29 15:19:16 +01:00
Sven Klemm
119963a334 Replace hardcoded bash path in shell scripts 2018-10-10 17:55:39 +02:00
Matvey Arye
f662ae1191 Add telemetry job and turn off default jobs in tests
This adds the telemetry job to the job scheduler. Telemetry is
scheduled to run every 24 hours with a 1 hour exponential backoff
retry period. Additional fixes related to the  telemetry job:

- Add separate ID space to the bgw_job table for default jobs. We do not dump this ID space inside pg_dump to prevent job insertion conflicts.
- Add check to update scripts for default jobs.
- Change shmem_callback so that it doesn't modify state since state transitions are not atomic with respect to interrupts and interrupt callbacks.
- Disable default telemetry job in regression and docker tests.
2018-09-10 13:29:59 -04:00
Erik Nordström
ebe0915669 Refactor telemetry and fixes
The installation metadata has been refactored:

- The installation metadata store now takes Datums of any
  type as input and output
- Move metadata functions from uuid.c -> metadata.c
- Make metadata functions return native types rather than text,
  including for tests

Telemetry tests for ssl and nossl have been combined.

Note that PG 9.6 does not have pg_backend_random() that gives us a
secure random numbers for UUIDs that we send in telemetry. Therefore,
we fall back to the generating the UUID from the timestamp if we are
on PG 9.6.

This change also fixes a number of test issues. For instance, in the
telemetry test the escape char `E` was passed on as part of the
response string when set as a variable with `\set`. This was not
detected before because the response parser didn't parse the start of
the response properly.

A number of fixes have been made to the formatting of log messages for
telemetry to conform to the PostgreSQL standard as well as being
consistent with other messages.

Numerous build issues on Windows have been resolved. There is also new
functionality to get OS version info on Windows (for telemetry),
including a SQL function get_os_info() to retrieve this information.

The net library will now allow connecting to a servicename, e.g., http
or https. A port is resolved from this service name via getaddrinfo().
An explicit port can still be given, and it that case it will not
resolve the service name.

Databases the are updated to the new version of the extension will
have an install_timestamp in their installation metadata that does not
reflect the actual original install date of the extension. To be able
to distinguish these updated installations from those that are freshly
installed, we add a bogus "epoch" install_timestamp in the update
script.

Parsing of the version string in the telemetry response has been
refactored to be more amenable to testing. Tests have been added.
2018-09-10 13:29:59 -04:00
Erik Nordström
69d7d5800c Add pgindent target to format C source
The C source files can now be formatted with pgindent using
a new CMake build target.

The location of pgindent and dependencies are auto-discovered
by CMake or can be overridden on the command line.
2017-11-17 09:43:04 +01:00
Erik Nordström
500563ffe5 Add support for PostgreSQL 10
The extension now works with PostgreSQL 10, while
retaining compatibility with version 9.6.

PostgreSQL 10 has numerous internal changes to functions and
APIs, which necessitates various glue code and compatibility
wrappers to seamlessly retain backwards compatiblity with older
versions.

Test output might also differ between versions. In particular,
the psql client generates version-specific output with `\d` and
EXPLAINs might differ due to new query optimizations. The test
suite has been modified as follows to handle these issues. First,
tests now use version-independent functions to query system
catalogs instead of using `\d`. Second, changes have been made to
the test suite to be able to verify some test outputs against
version-dependent reference files.
2017-11-10 09:44:20 +01:00
Erik Nordström
b1ec4fa179 Refactor build system to use CMake
Moving the build system to CMake allows easy cross-platform
compiles, dependency checks, and more. In particular, CMake
allows us to easily build on Windows, and Visual Studio now
has native CMake support.
2017-10-16 20:50:16 +02:00
Erik Nordström
bf6fd3158f Tweak the docker image build script
- Save an intermediate build image to avoid having to download APK
  packages for every build
- Add debug symbols and assertions to extension build
- Install git and gdb by default for easier debugging
2017-10-02 11:01:31 +02:00
Olof Rensfelt
6cc5aa19bb Add update scripts from earlier versions to the extension.
To allow upgrading versions older than the most recent one,
update scripts from older versions need to be added to the
extension. This is now done by including all files in the
file extra_extension_files.txt to the extension. Currently
that file needs to be manually updated when a new release
is built.
2017-07-18 10:27:36 +02:00
Matvey Arye
3c1f7522bb Make travis run update tests 2017-07-13 08:33:08 -04:00
Olof Rensfelt
4d2a65daa6 Add infrastructure to build update script files.
SQL code is now split into setup, functions, and init files to
allow a subset to be run when the extension is updated. During
build, an update script is now also generated.
2017-07-12 13:00:29 -04:00
Erik Nordström
3192c8a6bf Remove Dockerfile and docker.mk
Release Docker builds are now provided in a separate repository,
https://github.com/timescale/timescaledb-docker.

Tests and development builds for Docker are now provided
by two new scripts in the scripts directory:

- `docker-build.sh` to build a development image from current sources.
- `docker-run-tests.sh` to run tests for current sources through a Docker container.
2017-06-19 22:30:46 +02:00