Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

Travis: Build agains multiple Postgres version + fix bugs #61

Merged
merged 7 commits into from
Feb 12, 2019

Conversation

cyrilgdn
Copy link
Contributor

@cyrilgdn cyrilgdn commented Feb 7, 2019

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:

  • The version features flags system was not working because the detected version was not correctly set in the Client struct...
  • Database update was not working because of invalid SQL queries (using of statement parameters syntax "$1" but not for parameters...)
  • Disable postgresql_extension resource (and associated tests) for Postgres < 9.1 (CREATE EXTENSION does not exists before this version)
  • Add a replication flag (available for >=9.1)

fix #35

Cyril Gaudin and others added 5 commits February 7, 2019 22:08
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)
@cyrilgdn cyrilgdn added the bug label Feb 7, 2019
@ghost ghost added the size/L label Feb 7, 2019
@@ -0,0 +1,6 @@
export TF_ACC=true
Copy link

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

Copy link
Contributor Author

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.

Copy link

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.

Copy link

@paultyng paultyng left a 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.

@cyrilgdn cyrilgdn merged commit f85c3d5 into master Feb 12, 2019
@cyrilgdn cyrilgdn deleted the test-travis branch March 31, 2019 16:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update of CONNECTION LIMIT for database fails
2 participants