Skip to content

Add a test for nix ps#484

Merged
edolstra merged 1 commit into
mainfrom
nix-ps-test
Jun 4, 2026
Merged

Add a test for nix ps#484
edolstra merged 1 commit into
mainfrom
nix-ps-test

Conversation

@edolstra

@edolstra edolstra commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Context

Summary by CodeRabbit

Release Notes

  • Tests
    • Added functional tests for the nix ps command to validate reporting of running derivations and their associated process information in both standard and JSON output formats.

Starts a build that backgrounds a `sleep 600` and blocks on a fifo,
then asserts that `nix ps` (text and `--json`) reports the running
derivation and its two-level process tree (builder shell + sleep
child), and that the list becomes empty once the build finishes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be7a27b2-1983-418c-9e37-9e4c8cd11a15

📥 Commits

Reviewing files that changed from the base of the PR and between ec9440d and 95aad5b.

📒 Files selected for processing (2)
  • tests/functional/meson.build
  • tests/functional/ps.sh

📝 Walkthrough

Walkthrough

This pull request adds a new functional test for the nix ps command. The test script validates both plain and JSON output formats when a derivation is running, then confirms the command returns empty results after the build completes. The test is registered in the Meson build system to ensure it runs as part of the functional test suite.

Changes

nix ps functional test

Layer / File(s) Summary
nix ps functional test implementation
tests/functional/ps.sh
Bash test script that coordinates a blocked Nix build via FIFOs, asserts nix ps reports the running derivation with correct process argv and JSON structure, then unblocks the build and verifies empty output afterward.
Register ps.sh in build system
tests/functional/meson.build
Adds the ps.sh script to the main test suite's tests array for Meson integration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A test hops into the night,
Watching processes in their flight,
FIFOs block and then release,
JSON fields bring the peace,
Nix ps now shines so bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add a test for nix ps' directly and clearly describes the main changes in the pull request, which adds a new functional test script for the nix ps command.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nix-ps-test

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request June 4, 2026 19:20 Inactive
@edolstra edolstra enabled auto-merge June 4, 2026 19:33
@edolstra edolstra added this pull request to the merge queue Jun 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 4, 2026
@edolstra edolstra added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit 43e551d Jun 4, 2026
29 checks passed
@edolstra edolstra deleted the nix-ps-test branch June 4, 2026 20:28
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