-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Open
jfroche
wants to merge
34
commits into
update-nixpkgs
Choose a base branch
from
feat/ansible-testing
base: update-nixpkgs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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 |
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
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 |
45b0d81
to
6b51806
Compare
These overlay packages will be removed once the extensions are updated to use the new `buildPgrxExtension` function.
The previously used version was failing to build: /build/source/src/common/get_check_data.c: In function 'pgr_SPI_getText': /build/source/src/common/get_check_data.c:307:28: error: passing argument 1 of 'DatumGetCString' makes integer from pointer without a cast [-Wint-conversion] 307 | return DatumGetCString(SPI_getvalue(*tuple, *tupdesc, info.colNumber)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | char * In file included from /build/source/include/c_common/postgres_connection.h:29, from /build/source/src/common/get_check_data.c:27: /nix/store/nn6vpjqlsxxmynwcrsib9agb3hpr5cqj-postgresql-17.4/include/server/postgres.h:335:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'char *' 335 | DatumGetCString(Datum X) | ~~~~~~^ make[2]: *** [src/common/CMakeFiles/common.dir/build.make:149: src/common/CMakeFiles/common.dir/get_check_data.c.o] Error 1
This was discussed upstream here: https://postgr.es/m/0a997455-5aba-4cf2-a354-d26d8bcbfae6%40technowledgy.de Also applied by nixpkgs here: NixOS/nixpkgs#342026
We cannot use nodejs.libv8 as it is too new for plv8 3.1. We will be able to use it with plv8 3.2.
Backport upstream commit to remove the deprecated darwin framework: NixOS/nixpkgs#398707
dbmate 2.27 is now using a varchar for the version column in the schema_migrations table. See amacneil/dbmate#641
6b51806
to
a33cf5d
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`
And use docker to run tests
Move ubuntu docker image to its own package. Create one test for all system modules.
8fac60d
to
b3b0a55
Compare
b3b0a55
to
fc77a26
Compare
684c4b7
to
21a8f63
Compare
…b actions workflows
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.