Skip to content

Test: 'dataset clone' for missing dataset prints to stderr, not stdout #367

Closed

Description

@neuromechanist

Failing test

test/datalad-commands.test.ts:191 — datalad commands - clone errors > clone fails for non-existent dataset

const { stdout, exitCode } = await runCli(["dataset", "clone", "nm999999"]);
expect(exitCode).toBe(1);
expect(stdout.includes("not found") || stdout.includes("404")).toBe(true);

exitCode === 1 is correct, but stdout no longer contains the error string — the CLI now writes the failure message to stderr (likely via the spinner failure path). The not found / 404 text is in stderr instead.

Fix

Either:

  1. Update the test to assert against stdout + stderr, or
  2. Make dataset clone echo a final user-facing error line to stdout after the spinner stops (mirroring other commands like admin revert).

Option 2 is preferable for grep-friendly CLI output.

Repro

cd backend
bun test test/datalad-commands.test.ts -t "clone fails for non-existent dataset"

Discovered while working on #340.

Activity

  1. added
    bug
    testing
    cli
    on Apr 27, 2026
  2. neuromechanist commented on May 14, 2026

    @neuromechanist
    ContributorAuthor

    Closing as duplicate of #452 (P1: 4 failing tests + add CI gate), which explicitly tracks this test.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclitesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions