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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testers.testEqualArrayOrMap: init #383214

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ConnorBaker
Copy link
Contributor

@ConnorBaker ConnorBaker commented Feb 19, 2025

As part of the work I've done on rewriting the way CUDA software is packaged with Nix (https://github.com/ConnorBaker/cuda-packages) I made several testers, utility scripts, and setup hooks which I'm in the process of upstreaming.

This PR comes from https://github.com/ConnorBaker/cuda-packages/tree/18f4f5465272f6a88ed9bc660b3bc31dc01d4719/pkgs/by-name/mk/mkCheckExpectedArrayAndMap.

At its core, this PR introduces two utility functions declared in shell scripts, assertEqualArray and assertEqualMap. While they may be included and used directly, they are meant to be used through testers.testEqualArrayOrMap, as it provides an easy interface against which one can assert scripts populate bash arrays (including associative arrays, referred to as "maps" to disambiguate) with expected values.

This tester has a number of uses and paves the way for more complicated array utilities, like those found here: https://github.com/ConnorBaker/cuda-packages/tree/18f4f5465272f6a88ed9bc660b3bc31dc01d4719/pkgs/by-name/ar/arrayUtilitiesHook.

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:
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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.

@ConnorBaker ConnorBaker self-assigned this Feb 19, 2025
@github-actions github-actions bot added 6.topic: testing Tooling for automated testing of packages and modules 8.has: documentation This PR adds or changes documentation labels Feb 19, 2025
@ConnorBaker ConnorBaker force-pushed the feat/testEqualArrayOrMap branch from 0f013c0 to d94ee96 Compare February 19, 2025 00:48
@ConnorBaker ConnorBaker force-pushed the feat/testEqualArrayOrMap branch from d94ee96 to deb66f5 Compare February 19, 2025 17:46
@ConnorBaker ConnorBaker marked this pull request as ready for review February 19, 2025 17:47
@ConnorBaker ConnorBaker force-pushed the feat/testEqualArrayOrMap branch from deb66f5 to 095fc68 Compare February 20, 2025 01:20
@ConnorBaker ConnorBaker changed the title testEqualArrayOrMap: init testers.testEqualArrayOrMap: init Feb 20, 2025
@ConnorBaker ConnorBaker force-pushed the feat/testEqualArrayOrMap branch from 095fc68 to 6159e07 Compare February 20, 2025 20:31
@ConnorBaker ConnorBaker force-pushed the feat/testEqualArrayOrMap branch from 96bcdf7 to 85bc4c6 Compare February 21, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: testing Tooling for automated testing of packages and modules 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant