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

[PoC] Write PostgreSQL spec tests using Testinfra to compare with Serverspec #2672

Closed
5 tasks
to-bar opened this issue Oct 6, 2021 · 1 comment
Closed
5 tasks

Comments

@to-bar
Copy link
Contributor

to-bar commented Oct 6, 2021

Is your spike related to a problem or idea? Please describe.

  1. Serverspec has no integration with Ansible - inventory is parsed by additional Ruby code (spec_helper.rb)
  2. Running remote commands (in order to gather facts) inside a test is not supported. Instead "external" methods are used (which is not convenient) which use lower level calls (e.g. Specinfra.backend.run_command or Net::SSH.start).
  3. Tests are not always concise. When you need to perform any processing on the output (e.g. stdout.force_encoding('UTF-8')), you have to use RSpec (longer) syntax.
  4. Serverspec is Ruby based which requires knowing additional language and having additional developer tools (VS Code extensions, linting rules).

Describe the outcome you'd like

  • Comparison of tools: ServerSpec vs Testinfra based on real life case (PostgreSQL tests).

What is the reason or source for the spike

  • It is supposed that using Testinfra instead of Serverspec can give us some significant benefits.

Additional context
Example of migration from ServerSpec to Testinfra:
freedomofpress/securedrop#1616

Molecule uses Testinfra as the default verifier (Serverspec is also available), see docs.

Additional info
https://testinfra.readthedocs.io/en/latest/
https://dev.to/koh_sh/using-testinfra-with-ansible-4n7b

Ansible integration
https://testinfra.readthedocs.io/en/latest/backends.html#ansible
https://testinfra.readthedocs.io/en/latest/modules.html#ansible


DoD checklist

  • Reader is able to understand the results of spike
  • The results of the spike are presented in a table (to show simply what are compared or researched parameters) / not applicable
  • Each value / cell in the results table is described more deeply below
  • Demo of the spike (automated as much as possible)
  • Design doc updated
@seriva
Copy link
Collaborator

seriva commented Nov 16, 2022

Not going todo anymore spikes for Epiphany.

@seriva seriva closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants