125 Commits

Author SHA1 Message Date
Sven Klemm
81d5db662a Fix export_prefix_check script
The export_prefix_check script would not set proper exit code
depending on the found exported functions.
2019-10-15 14:42:02 +02:00
Mats Kindahl
3fa3822d08 Only update reformatted files
When running `make format` it will update all files. If a file does not
actually require reformatting, it will trigger a re-build of the entire
code base.

This commit instead compare the re-formatted file with the existing one
and does not update it unless it has actually changed.
2019-10-03 17:32:40 +02:00
Joshua Lockerman
1cc1b7c14e Fix memory leaks part 1: BGWs
This commit fixes memory leaks in the Background Worker infrastructure.
Notably, it fixes a leak in the launcher and BGW scheduler where shared
message queue handles would not be freed, and it fixes a leak where
BackgroundWorkerHandles were not freed in the scheduler.
2019-10-02 15:54:39 -04:00
Sven Klemm
b2d7be31bb Add 1.4.2 to update test scripts 2019-09-12 14:53:59 +02:00
Sven Klemm
ee9fc6af4c Add 1.4.1 to update test scripts 2019-08-02 15:00:05 +02:00
Sven Klemm
f8f5a73fd2 Add 1.4.0 to update test scripts 2019-07-18 21:14:14 +02:00
Sven Klemm
70fd8df015 Add missing license information
Add license information to files missing it and fix the license
check script to honor the return code of both the apache license
check and the TSL license check. Previously errors occurring during
apache license check would not be reflected in the return code of
the script, so only the TSL license check was effective.
2019-07-13 17:18:57 +02:00
Mats Kindahl
368a5c80cb Disable tool checks for test_sanitizers.sh
The `test_sanitizers.sh` script do not require regress tools, so
turning off regress tools check when calling CMake.
2019-07-09 15:40:35 +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
Sven Klemm
743a22f1fa Add 1.3.2 to update test scripts 2019-06-25 05:11:32 +02:00
Matvey Arye
33d28d2217 Test continuous aggs with extension updates
Add a v3 update test that makes sure that continuous aggregates
continue to work after extensions are updated.
2019-06-12 09:43:35 -04:00
Sven Klemm
70a02b5410 Add 1.3.1 to update test scripts 2019-06-10 21:15:56 +02:00
Matvey Arye
5e10efdff3 Run ABI tests on consistent alpine versions
Previously the compile image for the ABI tests was based on a different
postgres image than the run image (e.g. 10-alpine vs 10.2-alpine). This
created dependency problems between different version of ssl packages
that may be available under different alpine versions.

We fix this by forcing the run image to be based off of the same image
as the compile version.
2019-05-29 20:55:25 -04:00
Matvey Arye
5917938569 Fix ABI smoke test
This fix makes the smoke test return the correct exit code. It also
adds libssl1.0, which is needed for some openssl functionality.
2019-05-29 13:31:07 -04:00
Sven Klemm
bfabb30be0 Release 1.3.0 2019-05-07 02:47:13 +02:00
Joshua Lockerman
d5716fe200 Fix sanitizer and release tests
We were not building timescaledb with debug enabled in the sanitizer
tests, causing tests which needed debug symbols to fail. This commit
changes the sanitizer tests to include such symbols. We still enable
optimizations, as that results in more realistic build environment for
memory tests.
This commit also ensures some tests which should only be run in debug
builds are in fact only run in debug builds.
2019-04-29 15:02:05 -04:00
Sven Klemm
5695e32858 Fix syntax error in commit hook 2019-04-09 13:45:20 +02:00
Sven Klemm
0823498b25 Stop processing commit message on scissors line
The commit message template may include the actual diff to be
committed separated with a special scissors line. This patch adds
support for the scissors line to the commit hook otherwise
the diff content may trigger any of the rules.
2019-04-09 11:07:30 +02:00
Erik Nordström
18a8afd1f8 Add a gitignore for Git hook tests
Running the git hook tests will leave some Python byte code files
lying around. This change hides those using a gitignore file.
2019-04-08 14:01:00 +02:00
Erik Nordström
881e3729c4 Add a Git commit hook to validate commit messages
Our coding guidelines recommend following "The seven rules of a great
Git commit message" by Chris Beams:

https://chris.beams.io/posts/git-commit/

This change adds a Git commit hook that validates all Git commit
messages according to these rules (at least to the extent possible).
Currently, the hook simply prints a warning and a list of violations
in case of a non-conforming Git commit message. The commit is
otherwise accepted. This could be changed to entirely fail the commit,
or, via another hook, fail to push any code that is non-conformant.

The hook will be installed on a CMake run or when the hook source
changes.
2019-04-08 10:38:41 +02:00
Sven Klemm
e6dec5fff3 Improve information displayed on sanitizer test failure
Only print postgres log and regression diff for the instance
that actually failed for regresscheck and regresscheck-t
respectively.
2019-04-04 23:31:33 +02:00
Joshua Lockerman
dbe2bab392 Add array_unnest to alignment supressions it looks like trigger lookup triggers it 2019-04-01 12:14:16 -04:00
Sven Klemm
fcb5d8a41a Print regresscheck-t diff after sanitizer test
Change test_sanitizers.sh to always run regresscheck-t even when
regresscheck fails and print regresscheck-t diff on errors.
2019-03-30 02:11:51 +01:00
Sven Klemm
f2aea211bd Add 1.2.2 to update test scripts 2019-03-14 19:23:11 +01:00
Joshua Lockerman
72f4692c21 Add the ability to set the number of parallel tests from cmake and have sanitizer tests do so
With the forthcoming new sanitizer image running tests in parallel
causes machines to run out of resources, and fail tests spuriously
This commit forces test_sanitizers.sh to run tests sequentially to
prevent this.
2019-02-21 10:37:06 -05:00
Sven Klemm
33ef1de542 Add treat_null_as_missing option to locf
When doing a gapfill query with multiple columns that may contain
NULLs it is not trivial to remove NULL values from individual columns
with a WHERE clause, this new locf option allows those NULL values
to be ignored in gapfill queries with locf.

We drop the old locf function because we dont want 2 locf functions.
Unfortunately this means any views using locf have to be dropped.
2019-02-16 00:09:38 +01:00
Joshua Lockerman
bf3b3b8a69 Add sanitizer based tests
This commit adds a sanitizer run script, and updates travis to
run it in our nightly builds. Valgrind has been very slow and
unstable, so much so that we only run it during pre-release
tests, and even then it doesn't necissarily provide useful
output. The sanitizer tests run about 10x faster, and seem
stable.

We currently only run ASan and UBSan, as MSan has too many
issues within postgres's own initialization functions. As MSan
cannot be added to a binary that enables ASan, it would require
separate jobs anyway.
2019-02-13 18:12:43 -05:00
Joshua Lockerman
73e4adb598 Prepare the repo for the next development cycle 2019-02-11 13:07:34 -05:00
Erik Nordström
ed30358f7b Exclude hidden and CMake directories when formatting code
The script for running clang-format on the source code now properly
excludes hidden directories and CMake directories from the source code
scan. Including these directories may otherwise break clang-format
because hidden directories are often used for IDE/tools caches (e.g.,
`cquery`) where the cache files have the same ending as the source
code.
2019-02-07 13:24:36 +01:00
Matvey Arye
cc52a78b9b Add scripts for clang-format
We are switching from pgindent to clang-format for several
reasons:
1) pgindent is harder to set up and depends on other tools
like gobjdump that differ between OSes making it harder
to set up a proper development environment.
2) clang-format is more standard and works better
with various IDEs and editors.

Our clang-format wrapper script is transactional in that this
version of the script copies all files to a temporary directory,
runs clang-format in the temp dir, and only then copies the files
back. This should prevent mis-formatting when the script is cancled
in the middle of running.

We changes travis to use clang-format instead of pgindent
and thus it uses a different docker image to do the format test.
We also changes travis to use the new clang docker
image for the license check and prefix checks for consistency.
This also paves the way for us to use more clang features for tests
in the future.
2019-02-05 16:55:16 -05:00
Joshua Lockerman
c7803730d8 Fix typo failing our update 9.6 update tests 2019-02-01 13:50:31 -05:00
Joshua Lockerman
57b1d11919 Prepare the repo for the next development cycle 2019-01-29 13:23:28 -05:00
Sven Klemm
f89fd07c5b Remove year from SQL file license text
This changes the license text for SQL files to be identical
with the license text for C files.
2019-01-13 23:30:22 +01:00
Joshua Lockerman
a5bcefb0ee Copy tsl into build directory in smoketest
We need to ensure we have all the source in order
to build timescaledb. Lacking this breaks the test.
2019-01-04 13:48:23 -05:00
Rob Kiefer
f45ce14334 Remove out-dated and unused scripts
Nothing appears to use scripts/start-test-docker.sh, so it can be
safely removed. docker-run.sh was still referenced on our docs
page, but should soon be removed. It no longer actually provides
anything useful (i.e., any memory settings it used to have have
been removed) and is out-of-date with newer Docker setups. To
remove the burden of keeping it up to date, we should just remove.
2019-01-04 11:30:52 -05:00
Sven Klemm
192409257e Add update test for PostgreSQL 10
Add an update test for updating the extension on PostgreSQL 10.
Change PostgreSQL 9.6 update test to only run triggered by cron.
2019-01-04 15:37:03 +01:00
Joshua Lockerman
acc41a7712 Update license header
Only have the copyright in the NOTICE. Hopefully
only having to update one place each year will
keep it consistent.
2019-01-03 11:57:51 -05:00
Sven Klemm
f73d5931aa Fix ORS in check_file_license.sh 2019-01-02 15:43:48 -05:00
Amy Tai
1b41b14994 Update licensecheck to look for correct string
Previously, files under tsl/test/ were expected to have "Apache" rather than "Timescale" license in their license header. This has been fixed.
2019-01-02 15:43:48 -05: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
43eb4ffba6 Fix update test script
Remove EXIT trap handler because it seems to occasionally capture exit
code from something that is not an update test resulting in error
state even though all update tests were successful.
2018-12-31 18:15:10 +01:00
Erik Nordström
73b81bb892 Do not exit immediately on failure in update test script
This fixes a number of issues with the update test script that
prohibited it from displaying a log of any failing tests. In
particular, the script needs to be run with `set +e` to ensure a test
error doesn't immediately cause an exit without recording the failed
log.
2018-12-21 10:31:31 +01:00
Joshua Lockerman
d4f0cbd0d3 Prepare the repo for the 1.2.0 development cycle 2018-12-14 10:01:03 -05:00
Joshua Lockerman
a7b54b159b Have prefix check verify all functions in headers and clean up missings
This commit makes four changes:
1. Adds the ts_ prefix to some functions that were missed in the last
   pass
2. Adds static to some variables that were confined to a single file but
   missing it
3. Adds the ability to disable using "hidden" visibility by default by
   setting the USE_DEFAULT_VISIBILITY variable
4. Switches the prefix-check in travis to use the flag defined in 3 so
   that the checker now checks all non-static symbols we define
2018-12-12 17:22:24 -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
Joshua Lockerman
bb6efbef0d Check that functions start with the ts_ prefix in travis 2018-12-11 17:02:00 -05:00
Sven Klemm
3686ff5b81 Set ORS to empty string instead of NUL in license check script
This fixes multiple warnings in bash 4.4:
scripts/check_file_license_apache.sh: line 22: warning: command substitution: ignored null byte in input
and is also more correct since we dont want to inject 0-Bytes into the string
2018-11-26 16:38:17 +01:00
Joshua Lockerman
e06733acf0 Fix casing in SQL license header to be consistent with elsewhere 2018-11-15 15:18:58 -05:00
Rob Kiefer
cac0791a5c Prepare the repo for next development cycle 2018-11-01 10:34:08 -04:00
Joshua Lockerman
d4f2a37e4b Add automated license check to travis 2018-10-29 13:28:19 -04:00