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

module_utils.postgres: added unittests #56381

Merged
merged 6 commits into from May 18, 2019

Conversation

Projects
None yet
4 participants
@Andersson007
Copy link
Contributor

commented May 14, 2019

SUMMARY
  1. Unit tests for module_utils.postgres
  2. Using LooseVersion instead of string comparison

+label: postgresql
+label: databases

ISSUE TYPE
  • Bugfix Pull Request

@Andersson007 Andersson007 force-pushed the Andersson007:postgres_unittest branch from 416462d to aa4e79b May 14, 2019

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

ready_for_review

try:
cursor.execute('SET ROLE %s' % module.params['session_role'])
except Exception as e:
module.fail_json(msg="Could not switch role: %s" % to_native(e))
cursor.close()
finally:

This comment has been minimized.

Copy link
@andytom

andytom May 14, 2019

Contributor

👍, this is a nice little refactor.

@ansibot ansibot removed the needs_triage label May 14, 2019

@andytom

This comment has been minimized.

Copy link
Contributor

commented May 14, 2019

LGTM

@ansibot ansibot added shipit and removed core_review labels May 14, 2019

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2019

@andytom , thank you for reviewing!
I changed yield_fixture pytest decorators to just fixture by last commit because it is depricated (thanks @mattclay for pointing out).

@ansibot ansibot added core_review and removed shipit labels May 15, 2019

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2019

@mattclay , it is shipit'ed by andytom, a member of our Postgres team, could you merge it please?

After that I can remove ensure_libs (depricated function) and its test file test/units/module_utils/test_postgresql.py from the source code by particular PR.

@andytom

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

shipit

@ansibot ansibot added shipit and removed core_review labels May 15, 2019

@ansibot ansibot added core_review and removed shipit labels May 16, 2019

@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented May 16, 2019

ready_for_review

@andytom

This comment has been minimized.

Copy link
Contributor

commented May 16, 2019

shipit

@ansibot ansibot added shipit and removed core_review labels May 16, 2019

@mattclay mattclay merged commit 386cef1 into ansible:devel May 18, 2019

1 check passed

Shippable Run 123111 status is SUCCESS.
Details
@Andersson007

This comment has been minimized.

Copy link
Contributor Author

commented May 18, 2019

@andytom , thank you for reviewing
@mattclay , thank you for reviewing and merging.
Feel free if you need some reviews or other help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.