Skip to content

tests: fix fetchers-substitute test for new narHash JSON format#14589

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
lovesegfault:fix-fetchers-substitute-test
Nov 18, 2025
Merged

tests: fix fetchers-substitute test for new narHash JSON format#14589
Ericson2314 merged 1 commit intoNixOS:masterfrom
lovesegfault:fix-fetchers-substitute-test

Conversation

@lovesegfault
Copy link
Member

Motivation

The test was failing because nix path-info --json now returns narHash as a structured dictionary {"algorithm": "sha256", "format": "base64", "hash": "..."} instead of an SRI string "sha256-...".

This change was introduced in commit 5e7ee80. The functional test path-info.sh was updated at that time, but this NixOS test was missed.

The fix converts the dictionary format to SRI format inline:

tarball_hash_sri = f"{narHash_obj['algorithm']}-{narHash_obj['hash']}"

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

The test was failing because nix path-info --json now returns narHash as
a structured dictionary {"algorithm": "sha256", "format": "base64",
"hash": "..."} instead of an SRI string "sha256-...".

This change was introduced in commit 5e7ee80. The functional test
path-info.sh was updated at that time, but this NixOS test was missed.

The fix converts the dictionary format to SRI format inline:
  tarball_hash_sri = f"{narHash_obj['algorithm']}-{narHash_obj['hash']}"
@Ericson2314 Ericson2314 added this pull request to the merge queue Nov 18, 2025
Merged via the queue into NixOS:master with commit 09d6847 Nov 18, 2025
16 checks passed
@lovesegfault lovesegfault deleted the fix-fetchers-substitute-test branch November 18, 2025 18:44
@edolstra edolstra mentioned this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants