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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdal: Split tests into separate attributes #290298

Merged
merged 1 commit into from Feb 22, 2024

Conversation

l0b0
Copy link
Contributor

@l0b0 l0b0 commented Feb 20, 2024

Description of changes

Makes it easier to run single tests for debugging purposes.

Preparation for adding more tests in #290292.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable: (nix-build -A gdal.passthru.tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 馃憤 reaction to pull requests you find important.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put the multiple attributes in tests.nix?

pkgs/development/libraries/gdal/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/gdal/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/gdal/default.nix Outdated Show resolved Hide resolved
@l0b0 l0b0 force-pushed the gdal-test-separation branch 2 times, most recently from 40c1886 to 5d3e8f1 Compare February 21, 2024 06:03
@l0b0 l0b0 requested a review from dotlambda February 21, 2024 06:03
Copy link
Contributor

@imincik imincik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy with this change, even though I haven't seen this pattern anywhere else (do you know about any other package splitting tests in similar way ?) Also, more use of testers and lib functions is good thing as well.

@l0b0
Copy link
Contributor Author

l0b0 commented Feb 21, 2024

I am happy with this change, even though I haven't seen this pattern anywhere else (do you know about any other package splitting tests in similar way ?)

I don't know where I picked it up (The documentation? Some other random package?), but looking for packages with more than one test in nix repl:

pkgs = import <nixpkgs> {}
packageTests = pkg: if builtins.isList (pkg.passthru.tests or {}) then {} else pkg.passthru.tests or {}
testNames = pkg: builtins.attrNames (packageTests pkg)
testCount = pkg: builtins.length (testNames pkg)
multiTest = pkg: let result = builtins.tryEval (testCount pkg); in if result.success then result.value > 1 else false
multiTests = pkgs.lib.filterAttrs (_name: pkg: multiTest pkg) pkgs
builtins.attrNames multiTests

This finds a bunch:

[ "agda" "akkoma" "alice-lg" "amazon-ssm-agent" "angie" "angieQuic" "apacheHttpd" "apacheHttpd_2_4" "avahi" "avahi-compat" "aws-sdk-cpp" "ayatana-indicator-messages" "azure-static-sites-client" "bats" "bazel" "bazel_4" "bazel_5" "bazel_6" "bazel_7" "bcachefs-tools" "bind" "bird" "bird2" "bitwarden_rs" "bitwarden_rs-mysql" "bitwarden_rs-postgresql" "bitwarden_rs-sqlite" "bitwarden_rs-vault" "boehmgc" "btrbk" "buck2" "c-ares" "c-aresMinimal" "cacert" "caddy" "cargo" "cargo-auditable-cargo-wrapper" "centrifugo" "ceph" "ceph-dev" "cf-terraforming" "checksec" "chrony" "cimg" "clevis" "cloud-init" "cntr" "conceal" "conmon" "containerd" "convos" "corretto11" "corretto17" "corretto19" "cpio" "craftos-pc" "ctranslate2" "cuneiform" "cups" "curl" "curlFull" "curlHTTP3" "curlMinimal" "curlWithGnuTls" "cyrus_sasl" "dart" "dart-sass" "dart_stable" "dav1d" "dconf2nix" "deno" "dex-oidc" "dhcpcd" "dig" "discourse" "discourseAllPlugins" "dnsmasq" "dnsutils" "dotnet-aspnetcore" "dotnet-aspnetcore_6" "dotnet-aspnetcore_7" "dotnet-aspnetcore_8" "dotnet-netcore" "dotnet-runtime" "dotnet-runtime_6" "dotnet-runtime_7" "dotnet-runtime_8" "dotnet-sdk" "dotnet-sdk_6" "dotnet-sdk_7" "dotnet-sdk_8" "dovecot" "drawterm" "drawterm-wayland" "dump_syms" "endlessh" "endlessh-go" "engelsystem" "envoy" "etcd" "etcd_3_5" "expat" "faad2" "faircamp" "faiss" "faissWithCuda" "fakeroot" "fcft" "fend" "ferretdb" "firejail" "fish" "flatpak" "fmt" "fmt_10" "fmt_8" "fmt_9" "foot" "forgejo" "fq" "frankenphp" "freetube" "freetype" "freshrss" "fwupd" "g4py" "garage" "garage_0_8" "garage_0_8_5" "garage_0_9" "garage_0_9_1" "gdk-pixbuf" "geant4" "geos" "geos_3_11" "ghostscript" "ghostscriptX" "ghostscript_headless" "ghostunnel" "ghz" "git" "git-doc" "gitFull" "gitMinimal" "gitSVN" "gitea" "glib" "gmic" "gmic-qt" "gns3-server" "gnupg" "gnupg22" "gnupg24" "gnutls" "go" "go_1_20" "go_1_21" "go_1_22" "goss" "gpgme" "grafana-agent" "graphene-hardened-malloc" "graphviz" "graphviz-nox" "groonga" "grpc" "grpc-gateway" "grub2" "grub2_efi" "grub2_full" "grub2_light" "grub2_xen" "hadoop" "hadoop2" "hadoop3" "hadoop_3_2" "hadoop_3_3" "handbrake" "harfbuzz" "harfbuzzFull" "hello" "hercules-ci-agent" "hockeypuck" "hockeypuck-web" "home-assistant" "host" "hotdoc" "htmldoc" "icloudpd" "idris2" "imagemagick" "imagemagick7" "imagemagick7Big" "imagemagick7_light" "imagemagickBig" "imagemagick_light" "imlib2" "imlib2-nox" "imlib2Full" "innernet" "input-remapper" "installShellFiles" "intel-gmmlib" "ipfs" "jenkins" "jj" "jupyter" "jupyter-all" "k3s" "k3s_1_24" "k3s_1_25" "k3s_1_26" "k3s_1_27" "k3s_1_28" "k3s_1_29" "kbd" "kcov" "kea" "keepassxc" "kerberos" "keycloak" "knot-dns" "krb5" "krb5Full" "kubectl" "kubectl-convert" "kubernetes" "kubo" "leetcode-cli" "libarchive" "libbpf" "libbpf_1" "libcap" "libcbor" "libceph" "libde265" "libdeltachat" "libgcrypt" "libgcrypt_1_8" "libgit2" "libgit2_1_3_0" "libgit2_1_5" "libgit2_1_6" "libheif" "libimagequant" "libjpeg" "libjpeg8" "libjpeg_turbo" "libkrb5" "libmad" "libnghttp2" "libpcap" "libraw" "librsvg" "libsass" "libsndfile" "libssh" "libtasn1" "libtiff" "libtransmission" "libtransmission_4" "libtree" "libuv" "libva" "libva-minimal" "libvmaf" "libwebp" "libxcrypt" "libxcrypt-legacy" "linux-pam" "lua" "lua5" "lua5_1" "lua5_2" "lua5_2_compat" "lua5_3" "lua5_3_compat" "lua5_4" "lua5_4_compat" "luajit" "luajit_2_0" "luajit_2_1" "luajit_openresty" "lvm2" "lvm2_dmeventd" "lvm2_vdo" "lxd" "lxd-unwrapped" "makeBinaryWrapper" "makeShellWrapper" "makeWrapper" "mariadb" "mariadb-client" "mariadb-embedded" "mariadb_1011" "mariadb_105" "mariadb_106" "mariadb_110" "matomo" "matomo-beta" "matrix-synapse-unwrapped" "mediawiki" "mercurial" "mercurialFull" "merecat" "miniflux" "miniupnpd" "miniupnpd-nftables" "mkl" "mold" "mupdf" "mupdf-headless" "musescore" "mysql" "mysql-client" "mysql80" "n8n" "nanopb" "nanopbMalloc" "neovim" "netbird" "netbird-ui" "netbox" "netbox_3_6" "netbox_3_7" "nextcloud-notify_push" "nextcloud26" "nextcloud27" "nextcloud28" "nfs-utils" "nftables" "nghttp2" "nginx" "nginxMainline" "nginxQuic" "nginxShibboleth" "nginxStable" "ngtcp2-gnutls" "nix" "nix-serve" "nixFlakes" "nixStable" "nixStatic" "nixfmt-rfc-style" "nixos-container" "nixos-install-tools" "nixos-rebuild" "nspr" "ocsinventory-agent" "octoprint" "omnisharp-roslyn" "open-watcom-bin" "open-watcom-v2" "open62541" "openblas" "openblasCompat" "opencl-headers" "opencv" "opencv4" "opencv4WithoutCuda" "openresty" "opensearch" "opensmtpd" "opensnitch" "openvpn" "orc" "pam" "parsedmarc" "pdal" "pdns-recursor" "percona-server_8_0" "pg_repack" "phoc" "php" "php81" "php82" "php83" "pinnwand" "pixman" "pjsip" "playwright" "please-cli" "plv8" "podman" "polaris" "pomerium" "poppler" "poppler_gi" "poppler_min" "poppler_utils" "postfix" "postgresql" "postgresql_12" "postgresql_12_jit" "postgresql_13" "postgresql_13_jit" "postgresql_14" "postgresql_14_jit" "postgresql_15" "postgresql_15_jit" "postgresql_16" "postgresql_16_jit" "postgresql_jit" "powerdns-admin" "prefetch-npm-deps" "prefetch-yarn-deps" "proj" "prometheus-php-fpm-exporter" "prosody" "protobuf" "protobuf3_21" "protobuf3_23" "protobuf3_24" "protobuf_21" "protobuf_23" "protobuf_24" "protobuf_25" "pufferpanel" "pypy" "pypy2" "pypy27" "pypy3" "pypy310" "pypy39" "pyrosimple" "python3" "python310" "python310Full" "python311" "python311Full" "python312" "python312Full" "python313" "python313Full" "python38" "python38Full" "python39" "python39Full" "python3Full" "python3Minimal" "qemu" "qemu_full" "qemu_kvm" "qemu_test" "qemu_xen" "qemu_xen-light" "qemu_xen_4_15" "qemu_xen_4_15-light" "qrencode" "quartus-prime-lite" "quickemu" "rasdaemon" "re2" "re2c" "repro-get" "resholve" "retroarchBare" "ripunzip" "rootlesskit" "runc" "rust-bindgen" "rustls-ffi" "s-tui" "sage" "sageWithDoc" "sanoid" "scaphandre" "sftpgo" "sfxr-qt" "sgx-sdk" "silice" "skopeo" "snipe-it" "soft-serve" "sonic-server" "spago" "spark" "spark3" "spark_3_3" "spark_3_4" "spark_3_5" "spdlog" "sqlite" "sqlite-interactive" "sqlite3-to-mysql" "ssm-agent" "ssmsh" "sssd" "staticjinja" "steck" "stig" "stratis-cli" "stratisd" "sudo-rs" "suwayomi-server" "syncthing" "syncthing-cli" "syncthing-discovery" "syncthing-relay" "systemd" "systemd-lock-handler" "systemdLibs" "systemdMinimal" "systemdUkify" "tang" "tectonic" "telegraf" "teleport" "teleport_12" "teleport_13" "teleport_14" "tengine" "termite" "termite-unwrapped" "thanos" "thelounge" "tinyscheme" "tomcat10" "tomcat9" "tracee" "transmission" "transmission-gtk" "transmission-qt" "transmission_4" "transmission_4-gtk" "transmission_4-qt" "transmission_noSystemd" "tsm-client" "tsm-client-withGui" "tuptime" "udev" "unbound" "unbound-full" "unbound-with-systemd" "usbguard" "utf8proc" "varnish" "varnish60" "varnish74" "vault" "vaultwarden" "vaultwarden-mysql" "vaultwarden-postgresql" "vaultwarden-sqlite" "vaultwarden-vault" "vengi-tools" "vips" "vscodium" "vte" "vte-gtk4" "warzone2100" "wasilibc" "wireguard-tools" "wpa_supplicant" "wpa_supplicant_ro_ssids" "wrapGAppsHook" "wrapGAppsHook4" "wrapGAppsNoGuiHook" "xdg-desktop-portal" "xrootd" "xterm" "yarn" "zed" "zlib" "zoneminder" "zq" "zsh" "zstd" ]

@imincik
Copy link
Contributor

imincik commented Feb 21, 2024

@dotlambda , are you ok with merging this PR as it is now ?

Makes it easier to run single tests for debugging purposes.

Co-authored-by: Robert Sch眉tz <github@dotlambda.de>
@l0b0 l0b0 requested a review from dotlambda February 22, 2024 04:10
@dotlambda dotlambda merged commit f433c05 into NixOS:master Feb 22, 2024
21 of 22 checks passed
@l0b0 l0b0 deleted the gdal-test-separation branch February 22, 2024 09:20
imincik added a commit to imincik/geospatial-nix that referenced this pull request Feb 22, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/week-in-geospatial-team/37035/8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants