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

Update tests for rakeless DB admin #1

Merged
merged 8 commits into from
Jul 30, 2021
Merged

Conversation

NickLaMuro
Copy link
Owner

This includes changes to support ManageIQ/manageiq-appliance_console#160 when it is merged.

Most the the changes are removals of IO option parsing as it is assumed that the passed in file is now available on the local file system, and we don't need to connect to a URI. Some code paths are still in place to potentially test against S3/FTP/Swift in the future, but for now they are unused.

When updating the DatabaseAdmin tasks for the appliance console, there
will be less options available to input.

No longer will it ask for a type, as it will always assume you are
writing to a "local file" (whether that file is a mounted NFS/SMB/etc.
share or just a local disk will not be handled here).

As such, ApplianceConsoleRunner no longer needs to match against the
IO_MENU_OPTION_REGEXPS as it did previously, so they have been removed.
Moving forward, we will not be supporting the automatic connection of
file storage backends, so this will now need to be managed by the user
themselves.

By association, this means the tests themselves also need to manage the
connection.  To ensure the connection is working properly, we connect
once for creating the backup, and a separate time (in a new location)
when validating the DB.  This helps ensure that we are not just writing
randomly to the filesystem, but the mounted network drive as expected.
Allows running with `TESTOPTS` via rake args.  So something like:

  $ rake sync test:nfs[--name=test_nfs_database_backup]

Which allows you to test a single test at a time, and since they are
about a minute or longer per test, this is a big time saver.
This more simply allows assuming the user that we want.  If we are the
`vagrant` user, we will will have access to the command in the exact
same way as `su` with the `root` user, but also not require the extra
quoting and extra `Etc` lib logic.
The format of this config in the postgresql.conf will cause to socket
files to be created, and that is excessive, so this limits it to just
the RUN_DIR.
Allows changing the user in a single spot
Updates tests to now use the newly added `appliance_console_cli`
commands for db restore instead of `rake` from `vmdb`.

This has a couple of changes to support this:

- Updates the appliance_sync.sh to be alphabetical and adds a few more
  files to the sync
- Updates the appliance_rake_restore_patches.rb to be more genericly
  named and support the `appliance_console_cli` version of
  `PostgresAdmin` better
- Have the ApplianceSecondaryDB use the `postgres` user instead of
  `vagrant` (less changes required to patch `PostgresAdmin` with)
- Update the `DbValidator` to use the `ApplianceConsoleCli` helper
  library instead of `RakeHelper` (mostly the former is a slight
  re-write of the latter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant