246 Commits

Author SHA1 Message Date
Sven Klemm
6b69c781ba Add PG14 to our CI 2021-10-05 20:20:57 +02:00
Sven Klemm
6838fcf906 Post 2.4.2 release
Update version numbers and add 2.4.2 to update tests.

We have to put the DROP FUNCTION back in latest-dev because
2.4.2 did not include the commit which removed the function
definitions.
2021-09-22 18:20:30 +02:00
Mats Kindahl
592e0bd46e Rename on all continuous aggregate objects
When renaming a column on a continuous aggregate, only the user view
column was renamed. This commit changes this by applying the rename on
the materialized table, the user view, the direct view, and the partial
view, as well as the column name in the dimension table.

Since this also changes some of the table definitions, we need to
perform the same rename in the update scripts as well, which is done by
comparing the direct view and the user view to decide what columns that
require a rename and then executing that rename on the direct view,
partial view, and materialization table, as well as updating the column
name in the dimension table.

When renaming columns in tables with indexes, the column in the table
is renamed but not the column in the index, which keeps the same name.
When restoring from a dump, however, the column name of the table is
used, which create a diff in the update test. For that reason, we
change the update tests to not list index definitions as part of the
comparison. The existance of the indexes is still tracked and compared
since the indexes for a hypertable is listed as part of the output.

If a downgrade does not revert some changes, this will cause a diff in
the downgrade test. Since the rename is benign and not easy to revert,
this will cause test failure. Instead, we add a file to do extra
actions during a clean-rerun to prevent these diffs. In this case,
applying the same renames as the update script.

Fixes #3405
2021-09-20 12:18:52 +02:00
Sven Klemm
2ee30f9d81 Run CI against PG snapshots
Run CI against PG snapshots to discover potential issues with
upcoming PG releases earlier.
2021-08-30 19:30:31 +02:00
Mats Kindahl
86cd8f6532 Post 2.4.1 release
Updates `version.config` and adds new version to update tests.
2021-08-24 10:42:29 +02:00
Sven Klemm
c5ecbbc25b Bump postgres versions used in CI to latest
Since the isolationtester got modified to improve the query result
output which got backported in to PG12 and PG13 we have to adjust
all isolationtester output.

https://github.com/postgres/postgres/commit/4a05406
2021-08-17 18:06:03 +02:00
Mats Kindahl
bff87a8e2b Disable tests by default if tools are not found
If tools like `pg_regress` or `pg_isolation_regress` are not found, an
error is generated telling you that you need to disable the tests
explicitly using `REGRESS_CHECKS`. This is an inconvenience for the
user since in most cases you just want to build the system with what
you have.

This commit changes that by automatically disabling regression tests,
isolation tests, TAP tests, and formatting targets when tools cannot be
found, which means that users do not normally have to disable tests
explicitly. A notice is still printed that the targets are not added.

In addition, the commit adds an option `REQUIRE_ALL_TESTS` for the rare
case when you want to make sure that all tests are indeed executed (for
example, in CI runs), which by default is off.
2021-08-11 15:28:09 +02:00
gayyappan
9ea77fb97f Post release 2.4.0
Add tests to update from 2.4.0
Fix up version.config
Fix view creation stmt in views_experimental.sql that
causes extension update failures.
2021-07-30 17:51:30 -04:00
Mats Kindahl
b5ffc71071 Post-release steps for release 2.3.1
Add 2.3.1 to the update tests and update the downgrade target for the
downgrade version. This commit also fixes two issues that were fixed in
the release branch:

1. Drop `_timescaledb_internal.refresh_continuous_aggregate`
2. Update the changelog to match the release branch.
2021-07-08 14:31:01 +02:00
Mats Kindahl
a58ebdb3b4 Split update and downgrade version
During an update, it is not possible to run the downgrade scripts until
the release has been tagged, but the update scripts can be run. This
means that we need to split the previous version into two different
fields: one for running the update tests and one for running the
downgrade tests.
2021-07-01 16:05:31 +02:00
Mats Kindahl
e28b9d0d60 Export variables to docker-build
This commit export the `GENERATE_DOWNGRADE_SCRIPT` and `PG_VERSION`
variables from `test_downgrade_to_tag.sh` to `docker-build.sh`.
2021-06-29 09:42:35 +02:00
Markos Fountoulakis
20db06891a Fix ABI breakage test in CI
Add the files that had been missing from the docker environment since
the introduction of the downgrade scripts.
2021-06-25 12:13:54 +03:00
Mats Kindahl
15b46818ea Generate downgrade script
This commit add functions and code to generate a downgrade script from
the current version to the previous version. This requires execution
from a Git repository since it retrieves the prolog and epilog for the
"downgrade" file from the version given by `update_from_version` in the
`version.config` file.

The commit adds several CMake functions that simplifies the composition
of script files, but these are not used to generate the update scripts.
A potential improvement is to use the scripts to also generate the
update scripts.

This commit supports generating a downgrade script from the
current version to the previous version. Other versions are handled
using a variable containing file names of reverse update
scripts and  the source and target version is extracted from the file
names, which is assumed to be of the form
`<source-version>--<target-version>.sql`.

In addition to adding support for generating downgrade scripts, the
commit adds a downgrade test file that tests a release in a similar way
to the update script and adds it as a workflow.
2021-06-24 11:10:25 +02:00
Markos Fountoulakis
59d868bdf1 Run sanitizer tests on PG12
Change sanitizer test to run on PG12 and make it use the same
infrastructure as the other linux regression tests.

Co-authored-by: Sven Klemm <sven@timescale.com>
2021-06-22 11:42:48 +03:00
Nikhil
8aaef4ae14 Fix update tests to handle sequences
The post-update script was handling preserving initprivs for newly
added catalog tables and views. However, newly added catalog sequences
need separate handling otherwise update tests start failing. We also
now grant privileges for all future sequences in the update tests.

In passing, default the PG_VERSION in the update tests to 12 since we
don't work with PG11 anymore.
2021-06-21 13:22:08 +05:30
Mats Kindahl
71e8f13871 Add workflow and CMake support for formatting
Add a workflow to check that CMake files are correctly formatted as
well as a custom target to format CMake files in the repository. This
commit also runs the formatting on all CMake files in the repository.
2021-06-17 22:52:29 +02:00
Erik Nordström
a1cf610d3c Run ABI tests with TAP support
Install the Perl prerequisites when building the image for ABI tests,
including the `prove` binary.

Although the ABI tests currently don't run TAP tests, CMake still
failed the configuration since it expects the prerequisites to be
installed unless it is run with `-DTAP_CHECKS=off`.
2021-06-07 15:20:52 +02:00
Erik Nordström
8e1273cd13 Detect TAP test prerequisites with CMake
CMake now detects if the necessary prerequisites for running TAP
tests are installed on the local system. This includes perl
installation and other dependencies, such as the IPC::Run module and
prove binary.
2021-06-05 12:08:21 +02:00
Sven Klemm
fb863f12c7 Remove support for PG11
Remove support for compiling against PostgreSQL 11. This patch also
removes PG11 specific compatibility macros.
2021-06-01 20:21:06 +02:00
Sven Klemm
22ceabcb83 Remove PG11 specific test output files 2021-06-01 20:21:06 +02:00
Sven Klemm
e9066d5531 Remove PG11 from CI
Remove all CI runs against postgres 11
2021-06-01 20:21:06 +02:00
Erik Nordström
ec06f9a7d0 Add 2.3.0 to update test scripts
The update tests for PG11, PG12, and PG13 are updated to include
release 2.3.0.
2021-05-27 16:41:28 +02:00
Sven Klemm
72ed3a81c5 Explicitly install clang-9 in CI ubuntu images
GitHub removed default installation of clang-9 from the ubuntu
images but those are required to build postgres with llvm so we have
to explicitly install the required packages.

https://github.com/actions/virtual-environments/pull/3381
2021-05-20 21:26:47 +02:00
Nikhil
4efa51cd8d Add tap tests infrastructure support
The TAP testing PG framework meets our requirements for doing
multinode/stand-alone-binaries testing for scenarios which need
individual multiple PG instances (multi-node testing is a prime
example).

This commit adds the necessary wrappers to allow the use of the TAP
testing framework in timescale code base. The README in "test/perl"
directory gives a fair idea of how to write tap tests. A simple tap
test has been added to provide a reference point for developers to
write new ones.

One can go to "build/tsl/test" and invoke "make checkprove" to see
the tap test in action.

Also includes changes for enabling github CI to run these taptests by
installing the requisite dependencies.

Includes changes to license checking scripts to handle new *.pl and
*.pm files.

Also added a new scripts/perltidyrc to aid in formatting of these
files.
2021-05-19 13:49:02 +05:30
Sven Klemm
45384357bd Bump postgres versions used in CI
Change CI tests to run against pg 11.12, 12.7 and 13.3.

The latest postgres versions adjusts the event_trigger test to
output the list of currently defined event triggers making the
test output different when timescaledb is installed since we
define our own event triggers. Due to this change we have to
ignore the result of this test in our CI.

https://github.com/postgres/postgres/commit/f3c45378
2021-05-18 16:22:23 +02:00
Mats Kindahl
b788168e59 Propagate grants to compressed hypertable
Grants and revokes where not propagated to compressed hypertables, if
the hypertable had a compressed hypertable, meaning that `pg_dump` and
`pg_restore` would not be able to dump nor restore the compressed part
of a hypertable unless they were owners and/or was a superuser.

This commit fixes this by propagating grants and revokes on a
hypertable to the associated compressed hypertable, if one exists,
which will then include the compressed hypertable and the associated
chunks in the grant and revoke execution.

It also adds code to fix the permissions of compressed hypertables and
all associated chunks in an update and adds an update test to check
that the permissions match.

Fixes #3209
2021-05-13 08:43:07 +02:00
Mats Kindahl
ec65866890 Add 2.2.1 to update test scripts
The update tests scripts for PG11, PG12, and PG13 are updated to
include 2.2.1.
2021-05-06 15:19:01 +02:00
Mats Kindahl
aeb107659b Copy recreated object permissions on update
Tables, indexes, and sequences that are recreated as part of an update
does not propagate permissions to the recreated object. This commit
fixes that by saving away the permissions in `pg_class` temporarily and
then copying them back into the `pg_class` table.

If internal objects are created or re-created, they get the wrong
initial privileges, which result in privileges not being dumped when
using `pg_dump`. Save away the privileges before starting the update
and restore them afterwards to make sure that the privileges are
maintained over the update.

For new objects, we use the initial privileges of the `chunk` metadata
table, which should always have correct initial privileges.

Fixes #3078
2021-04-26 08:36:57 +02:00
Sven Klemm
ec733de130 Add GitHub action for posting daily CI summary
This patch adds a GitHub action that posts all failed CI jobs in
the last 24 hours with link to the failed job.
2021-04-25 16:13:31 +02:00
Mats Kindahl
e7ffedbec7 Add update smoke test script
The update smoke test script can be used to test that an extension
works correctly. It will run the normal update tests, but do it against
a single server.

It also makes some minor refactorings of the update tests to make it
possible to run the tests against different versions of the server and
also support the smoke tests where some features cannot be tested.
2021-04-23 09:57:41 +02:00
Ruslan Fomkin
baaa9abddd Add 2.2.0 to update test scripts 2021-04-13 12:37:20 +02:00
Sven Klemm
349b298a05 Install clang-8 for PG11.0 CI test
clang-8 is no longer installed by default in the ubuntu images so
we have to explicitly install it for any actions that require it.

https://github.com/actions/virtual-environments/issues/2950
2021-04-05 17:33:09 +02:00
Ruslan Fomkin
574ef87426 Add 2.1.1 to update test scripts 2021-03-31 09:36:12 +02:00
Sven Klemm
4d871cbd26 Make readme names consistant
Most places in the source tree use README.md as filename for
additional documentation. This patch changes the filenames of
files using a different capitalization.
2021-03-26 10:03:44 +01:00
Sven Klemm
c5c24616f8 Switch CI to Ubuntu 20.04
Switch CI tasks currently running on Ubuntu 18.04 to 20.04 and
also switch some tasks that dont require specific version because
they run in docker containers to use ubuntu-latest instead.
All tasks switched to ubuntu-latest are expected to be ubuntu-version
agnostic because they run their actions in docker containers.
2021-03-22 12:42:58 +01:00
Sven Klemm
f18d9bf38b Add mangle_path to ignored symbols
When building timescaledb on Ubuntu 20.04 mangle_path is present
as exported symbol in binaries, making the export prefix check fail.
This patch changes the export prefix check to ignore mangle_path.
2021-03-22 12:42:58 +01:00
Dmitry Simonenko
c09f7e4252 Add script to test recovery using restore points 2021-03-19 17:55:01 +03:00
Mats Kindahl
0bc3f0b55a Factor out repair test from update test
In order to implement repair tests, changes are made to the
`constraint_check` table to simulate a broken dependency, which
requires the constraints on that table to be dropped. This means that
the repair runs without constraints, and a bug in the update test could
potentially not get caught.

This commit fixes this by factoring out the repair tests from the
update tests and run them as a separate pass. This means that the
contraints are not dropped in the update tests and bugs there will be
caught.

In addition, some bash functions are factored out into a separate file
to avoid duplication.
2021-03-17 17:57:44 +01:00
Sven Klemm
ed62df721f Run update test in GMT timezone
Due to a validation bug involving interval validation and the current
daylight savings time switch in the 1.7 releases the update tests that
includes 1.7 versions is currently failing. This patch changes CI
to run in GMT instead.
2021-03-16 02:57:42 +01:00
Sven Klemm
72c6114c68 Add update test for PG13 2021-03-16 02:57:42 +01:00
Mats Kindahl
231549184c Break out superuser operations in update tests
In order to support smoke-testing with a single server, the update
tests are refactored to not require a `postgres` user with full
privileges.

To support both running smoke tests and update tests, the following
changes where made:

- Database creation code was factored out of tests and is only executed
  for update tests.
- Since the default for `docker_pgscript` was to use the `postgres`
  database and the database creation code also switched database to
  `single` as part of the exection, the default of `docker_pgscript` is
  now changed to `single`.
- Parts of tests that changes roles during execution was removed since
  it is more suitable for a regression test. Some `GRANT` statements
  were kept for the update tests since they test that non-superuser
  privileges are propagated correctly.
- Operations that require escalated privileges are factored out into
  support functions that execute the original code for update tests and
  are no-ops for smoke tests.
- A dedicated `test_update_smoke` script was added that can run a smoke
  test against a single server.
2021-03-05 17:50:14 +01:00
Mats Kindahl
10b3da03ec Break out multinode update tests
This commit is part of a longer sequence to refactor the update tests
for use with smoke testing.

The multinode parts of the tests are broken out into a new version to
make the logic simpler.

- All multinode tests are now added to a new version, `v7` which allow
  us to create multinode objects only for versions that support
  multinode.
- Test script `test_updates_pg11` and `test_updates_pg12` are changed
  to use `v6` for updates from versions preceeding 2.0 and `v7` for
  versions 2.0 and later.
- Setup file `post.update.sql` is not needed any more since it was used
  to "fix" a pre-2.0 updated version to add data nodes so that it
  matched the clean setup. This is not necessary any more since v6 does
  not add data nodes for some versions and not for others.
2021-03-04 11:48:49 +01:00
Mats Kindahl
38493e9ab7 Refactor update tests for smoke testing
In order to support smoke-testing with a single server, the update
tests are refactored. This is part of a longer sequence of changes to
support both running smoke tests and update tests and contain the
following changes:

- All timestamp columns now have `not null` added to avoid spamming the
  output file and help finding the real issue.
- Extension of dump files are changed from `sql` to `dump` since they
  use the custom format and are not SQL files.
2021-03-03 08:57:29 +01:00
Sven Klemm
22870cfec6 Add 2.1.0 to update test scripts 2021-02-23 17:25:40 +01:00
Sven Klemm
ab736fda90 Add 2.0.2 to update test scripts 2021-02-21 20:13:09 +01:00
Dmitry Simonenko
2fb7034c8f Add 1.7.5 to update test scripts 2021-02-18 15:28:51 +03:00
Sven Klemm
39cb98bcc4 Fix sanitizer test
The sanitizer test is running on PG11.1 where the cluster test is
expected to fail. This patch changes the sanitizer test to ignore
the test result of the cluster test.
2021-02-18 12:13:14 +01:00
Sven Klemm
240df3262b Add PG13 to 32bit tests, coverity and cron tests 2021-02-16 19:30:51 +01:00
Sven Klemm
d6cd54b5a7 Bump postgres versions used in CI
Run tests on PG 11.11, 12.6 and 13.2
2021-02-12 22:54:32 +01:00
Sven Klemm
9c7b024705 Run regresscheck-t on PG13
This patch enables running regresscheck-t on PG13
2021-02-12 22:18:06 +01:00