Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kong 1.0 rc3 Postgres migrations failing in custom tests #4033

Closed
mars opened this issue Nov 29, 2018 · 1 comment
Closed

Kong 1.0 rc3 Postgres migrations failing in custom tests #4033

mars opened this issue Nov 29, 2018 · 1 comment
Labels

Comments

@mars
Copy link
Contributor

mars commented Nov 29, 2018

This issue is similar in context to #4031, but a different issue.

Summary

When running custom tests with a Postgres backend in this Kong app (uses the spec/helpers.lua & a bin/busted runner modeled after the one in Kong master), the tests error.

Locally these tests work with a local Postgres database (solved in #4031), but fail in this different way when run by Heroku CI tests with hosted, cloud Postgres:

$ bin/test -o gtest -v
[==========] Running tests from scanned files.
[----------] Global test environment setup.
[----------] Running tests from spec/integration/kong/plugins/hello-world-header_spec.lua
2018/11/28 23:39:25 [warn] 2876#0: *2 [lua] connector.lua:196: setkeepalive(): unable to close postgres connection, context: ngx.timer
2018/11/28 23:39:25 [warn] 2876#0: *2 [lua] connector.lua:196: setkeepalive(): unable to close postgres connection, context: ngx.timer
./spec/helpers.lua:156: [postgres error] Error during migration 2016-05-04-160000_resp_trans_schema_changes: [postgres] ERROR: column "run_on" does not exist (154)
stack traceback:
	./spec/helpers.lua:156: in function 'get_db_utils'
	spec/integration/kong/plugins/hello-world-header_spec.lua:11: in function <spec/integration/kong/plugins/hello-world-header_spec.lua:10>
[----------] 0 tests from spec/integration/kong/plugins/hello-world-header_spec.lua (3966.10 ms total)

I've confirmed that the database is empty before the tests run.

Why would these test migrations fail like this?

Steps To Reproduce

  1. Deploy to Heroku a Kong app from this commit (in the kong-1.0 branch)
  2. Add the app to a new Heroku Pipeline
  3. Connect the Pipeline with your own GitHub fork of heroku-kong
  4. Enable Tests in the Pipeline
  5. Start a new test on the kong-1.0 branch
  6. Watch the test fail

Additional Details & Logs

  • Kong version 1.0.0rc3
  • Operating system Heroku-18 (Ubuntu 18.04)
@mars
Copy link
Contributor Author

mars commented Dec 19, 2018

This is no longer an issue, after updating to Kong master (1.0.0rc4 plus a few more commits leading up to 1.0.0), and also updating our custom integration specs to follow Kong's new integration spec usage patterns/signatures.

@mars mars closed this as completed Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants