Skip to content

test: make overwrite confirmations deterministic#10274

Merged
dmadisetti merged 1 commit into
marimo-team:mainfrom
peter-gy:ptr/fix-export-windows-ci-flake
Jul 22, 2026
Merged

test: make overwrite confirmations deterministic#10274
dmadisetti merged 1 commit into
marimo-team:mainfrom
peter-gy:ptr/fix-export-windows-ci-flake

Conversation

@peter-gy

@peter-gy peter-gy commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Replaces timing-sensitive overwrite confirmation subprocesses with deterministic CliRunner tests that exercise the prompt and verify rewritten output.

Addresses marimo-team/ci-agent#74.

Copilot AI review requested due to automatic review settings July 22, 2026 18:14
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jul 22, 2026 6:22pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@peter-gy peter-gy added the internal A refactor or improvement that is not user facing label Jul 22, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Architecture diagram
sequenceDiagram
    participant Test as Test Function
    participant CliRunner as CliRunner
    participant main as marimo._cli.cli.main
    participant utils as marimo._cli.utils
    participant FS as File System

    Note over Test,FS: Deterministic overwrite test (CliRunner)

    Test->>utils: mock.patch('marimo._cli.utils.stdout')
    Test->>utils: mock_stdout.isatty.return_value = True

    Test->>CliRunner: invoke(main, args, input="y\n")
    activate CliRunner
    CliRunner->>main: run CLI command with stdin="y\n"
    activate main

    main->>utils: check stdout.isatty()
    utils-->>main: True (mocked)

    main->>main: prompt "Overwrite?"
    main->>CliRunner: read stdin (simulated)
    CliRunner-->>main: "y"

    main->>FS: overwrite output file
    FS-->>main: OK

    main-->>CliRunner: exit code 0
    deactivate main
    CliRunner-->>Test: result
    deactivate CliRunner

    Test->>Test: assert result.exit_code == 0
    Test->>Test: assert "Overwrite?" in result.output
    Test->>FS: read output file
    FS-->>Test: file contents
    Test->>Test: assert expected content
Loading

Re-trigger cubic

@peter-gy
peter-gy requested a review from mscolnick July 22, 2026 18:29
@dmadisetti
dmadisetti merged commit 79aceec into marimo-team:main Jul 22, 2026
42 of 43 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.15-dev59

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

Labels

internal A refactor or improvement that is not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants