-
-
Notifications
You must be signed in to change notification settings - Fork 226
Add tests for ansible and system manager modules #1746
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
base: update-nixpkgs
Are you sure you want to change the base?
Conversation
551892e to
e5e1b82
Compare
337be4e to
dab9e52
Compare
8549d92 to
c2bd94d
Compare
569b4cc to
c061085
Compare
c061085 to
07fb5e2
Compare
| - 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of ignore_errors, why not use a block/rescue
| - 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
38ac05d to
5f30f41
Compare
95dd61a to
288b31d
Compare
b48e4c3 to
3df6c4a
Compare
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
|
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
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.