Skip to content

Commit

Permalink
WIP: Add support for testing upgrade scripts (yugabyte#128)
Browse files Browse the repository at this point in the history
Add support for testing of pgTap update scripts.

This commit adds several new make targets:

- make uninstall-all: remove ALL installed pgtap code. Unlike `make unintall`, this removes pgtap*, not just our defined targets. Useful when testing multiple versions of pgtap.
- make regress: run installcheck then print any diffs from expected output.
- make updatecheck: install an older version of pgTap from PGXN (controlled by $UPDATE_FROM; 0.95.0 by default), update to the current version via ALTER EXTENSION, then run installcheck.
- make results: runs `make test` and copies all result files to test/expected/. DO NOT RUN THIS UNLESS YOU'RE CERTAIN ALL YOUR TESTS ARE PASSING!

In addition to these changes, `make installcheck` now runs as many tests as possible in parallel. This is much faster than running them sequentially. The degree of parallelism can be controlled via `$PARALLEL_CONN`. Setting `$PARALLEL_CONN` to `1` will go back to a serial test schedule.
  • Loading branch information
decibel authored Nov 7, 2019
1 parent 7e93fa5 commit d60b8f5
Show file tree
Hide file tree
Showing 24 changed files with 602 additions and 91 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# THERE IS ANOTHER .gitignore IN test/sql!

.*.swp
pgtap.sql
pgtap-core.sql
pgtap-schema.sql
uninstall_pgtap.sql
test/setup.sql
results
pgtap.so
regression.*
*.html
*.html1
*.sql.orig
bbin

/sql/pgtap--?.??.?.sql
/sql/pgtap--?.?.?.sql
/sql/pgtap-core--*
Expand All @@ -21,6 +23,10 @@ bbin
/sql/pgtap--0.98.0--0.99.0.sql
/sql/pgtap--0.99.0--1.0.0.sql
/sql/pgtap-static.sql
/sql/pgtap-static.sql.tmp*
*.sql.orig

test/build

# Misc mac crap
.DS_Store
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
language: c
before_install:
- wget https://gist.githubusercontent.com/petere/5893799/raw/apt.postgresql.org.sh
- wget https://gist.githubusercontent.com/petere/6023944/raw/pg-travis-test.sh
- sudo sh ./apt.postgresql.org.sh
- sudo rm -vf /etc/apt/sources.list.d/pgdg-source.list
script:
- bash ./pg-travis-test.sh

env:
- PGVERSION=8.4
- PGVERSION=9.0
- PGVERSION=9.1
- PGVERSION=9.2
- PGVERSION=9.3
- PGVERSION=9.4
- PGVERSION=9.5
- PGVERSION=9.6
- PGVERSION=10
- PGVERSION=11
- PGVERSION=11 UPDATE_FROM=0.99.0
# Duplication below is via s/-/- PARALLEL_CONN=1/
- PARALLEL_CONN=1 PGVERSION=9.1
- PARALLEL_CONN=1 PGVERSION=9.2
- PARALLEL_CONN=1 PGVERSION=9.3
- PARALLEL_CONN=1 PGVERSION=9.4
- PARALLEL_CONN=1 PGVERSION=9.5
- PARALLEL_CONN=1 PGVERSION=9.6
- PARALLEL_CONN=1 PGVERSION=10
- PARALLEL_CONN=1 PGVERSION=11 UPDATE_FROM=0.99.0
script: bash ./pg-travis-test.sh
Loading

0 comments on commit d60b8f5

Please sign in to comment.