Add tests for ansible and system manager modules#1746
Closed
Add tests for ansible and system manager modules#1746
Conversation
551892e to
e5e1b82
Compare
337be4e to
dab9e52
Compare
8549d92 to
c2bd94d
Compare
569b4cc to
c061085
Compare
c061085 to
07fb5e2
Compare
hunleyd
requested changes
Sep 3, 2025
Comment on lines
+2
to
+11
| - name: Check if nix is installed | ||
| ansible.builtin.command: which nix | ||
| register: nix_installed | ||
| failed_when: nix_installed.rc != 0 | ||
| ignore_errors: true | ||
|
|
||
| - name: Install nix | ||
| ansible.builtin.shell: curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf 'substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com' --extra-conf 'trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=' | ||
| when: nix_installed.rc != 0 | ||
| become: true |
Contributor
There was a problem hiding this comment.
instead of ignore_errors, why not use a block/rescue
Suggested change
| - name: Check if nix is installed | |
| ansible.builtin.command: which nix | |
| register: nix_installed | |
| failed_when: nix_installed.rc != 0 | |
| ignore_errors: true | |
| - name: Install nix | |
| ansible.builtin.shell: curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf 'substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com' --extra-conf 'trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=' | |
| when: nix_installed.rc != 0 | |
| become: true | |
| - name: Install nix if needed | |
| block: | |
| - name: Check if nix is installed | |
| ansible.builtin.command: which nix | |
| register: nix_installed | |
| failed_when: nix_installed.rc != 0 | |
| rescue: | |
| - name: Install nix | |
| ansible.builtin.shell: curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf 'substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com' --extra-conf 'trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=' | |
| become: true |
6b51806 to
a33cf5d
Compare
b3b0a55 to
fc77a26
Compare
684c4b7 to
21a8f63
Compare
37962e0 to
52722b1
Compare
dc596ec to
758c52d
Compare
778aa93 to
7f7fad9
Compare
5080bbe to
1504f7b
Compare
Move pgrouting.nix to pgrouting/default.nix and groonga package to pgroonga/groonga.nix. Update imports and fix relative paths for versions.json and patch files.
Replace inline bash script generation with writeShellScriptBin for rustc wrapper that filters empty postmaster_stub.rs arguments. Apply wrapper only for pgrx < 0.12 since issue was fixed upstream in pgrx#1435 and pgrx#1441.
Move nixpkgs-oldstable import to a let binding to avoid importing it three times...
Remove supabase-groonga from global flake packages and import it locally in pgroonga extension instead. Other components access groonga via pgroonga.passthru.groonga since groonga is only used by pgroonga.
The supabase-groonga package was moved to pgroonga extension in commit 1f0ed1f, but Ansible was still trying to install it separately causing build failures.
This reverts commit 55474686405394826ad07a032cbcf0e36a924554.
This reverts commit cfa9bcb92219f391469ae743f95c8856b0a99561.
Remove references to darwin.apple_sdk.frameworks.{IOKit,CoreFoundation}
which have been deprecated in nixpkgs. Disable CGO to avoid Darwin
framework dependencies entirely.
771718f to
4e32d5b
Compare
This complements the existing AMI tests in testinfra by providing a faster feedback loops for Ansible development without requiring a full VM. Also as it is based on Docker, it can be run locally (e.g. macOS) or in CI. Note that this approach is not intended to replace the AMI tests, but rather to provide a more efficient way to test Ansible tasks during development. Docker is used outside of the Nix sandbox for the moment. You can run the tests using `nix run -L .\#ansible-test`
f478f94 to
8bf8a53
Compare
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
And use docker to run tests
Move ubuntu docker image to its own package. Create one test for all system modules.
…b actions workflows
8bf8a53 to
0b687d4
Compare
acf3ba4 to
42b0c29
Compare
fa26b67 to
0131d17
Compare
samrose
approved these changes
Jan 27, 2026
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are slowly moving ansible code to nix system manager modules.
To speed up the migration, we want to test the ansible code without building the whole AMI and have a fast feedback loop.
We also want to quickly test our changes on system manager modules.
The tests are running docker images with ubuntu using testinfra.