refactor nixos tests to use our config, build, migrations, init etc #2038
Conversation
a213177 to
502973e
Compare
7646240 to
fb2478f
Compare
|
Could we also update the documents for the running of the tests and how they currently work with this PR? |
| ''; | ||
|
|
||
| # Source paths for ansible config files and migrations | ||
| ansibleConfigDir = builtins.path { |
There was a problem hiding this comment.
This is very cool (unifying nix with ansible more closely) but it does mean that changes from ansible have to be incorporated here and vice-versa; is there a way to unify it ? Maybe pulling in from the Ansible files?
There was a problem hiding this comment.
yes, because we're using ansible config files as source of truth if someone reorganized where they live path-wise, would need to update this too. However they were made uniform fairly recently, and so we should not have a need to move them around. The alternative would be to turn them into a nix module, which we can't get into doing in this PR, as it would greatly increase the scope of it.
|
|
||
| # Version-specific adjustments (mirroring run-server.sh.in:250-295) | ||
| ${ | ||
| if majorVersion == "17" || majorVersion == "orioledb-17" then |
There was a problem hiding this comment.
Also like this handling of the config based on major version in a single place! Could be useful to do this outside of tests as well maybe?
There was a problem hiding this comment.
We definitely do this, although I may be missing specifics that you are thinking about.
|
|
||
| test = PostgresExtensionTest(server, extension_name, versions, sql_test_directory, support_upgrade) | ||
| with subtest("Verify PostgreSQL 15 is our custom build"): | ||
| pg_version = server.succeed( |
There was a problem hiding this comment.
you can also check in the data dir under PG_VERSION which saves a connection
| f"Expected version ${testLib.expectedVersions."17"}, got: {pg_version}" | ||
| ) | ||
|
|
||
| postgres_pid = server.succeed( |
There was a problem hiding this comment.
Most extensions have the same boilerplate for "check version" and "check is running", it seems like these would be better as "pre tests" and the extensions themselves would just specify the PG versions they should run on (as they currently do)
…2038) * feat: custom module for nixos test of postgres * fix: include orioledb in vm test * feat: updating tests to use lib.nix supabase settings
Started with refactor of pg_repack to use this new module. Will then use this as basis to refactor/add the rest.
Will then update this PR description with the outcome