-
Notifications
You must be signed in to change notification settings - Fork 79
Travis: Build agains multiple Postgres version + fix bugs #61
Conversation
This support multiple version of Postgres (from 8.4 to latest)
There's a feature flags system which allows to manage multiple Postgres versions but the parsed version was not correctly set in Client. So all the `featureSupported(XXX)` was returning false.
Some of the SQL queries were wrong as they were using statement parameters (i.e.: $1) where it's not possible to do so.
The postgresql_extension resource uses "CREATE EXTENSION" command which is not available before Postgres 9.1 This also disables tests (for the same versions) in order to build travis tests against multiple versions of Postgres (including 8.4)
@@ -0,0 +1,6 @@ | |||
export TF_ACC=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need this here if you are running make testacc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paultyng Indeed, but when I run some tests manually during development I use to source tests/env.sh
then I'm able to run go test ...
to target specific tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I typically just do:
TESTARGS="-cover -run 'MyTest'" make testacc
But feel free to merge if you prefer your style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment on an env var duplication, but otherwise I think this is a great, so nice to run the full acc test suite on every PR.
Acceptance tests was not run in Travis so I configured Travis to start Postgres server in a Docker container (with a Matrix of versions from 8.4 to latest) and enable acceptance tests against it.
By running these tests, I discovered multiple bugs that I fixed:
CREATE EXTENSION
does not exists before this version)fix #35