Skip to content

Add tests that use a real arc so we test its behavior instead of mocking it - #467

Merged
tomrittervg merged 2 commits into
masterfrom
2026-11-13-tjr-real-arc
Nov 14, 2026
Merged

tomrittervg merged 2 commits into
masterfrom
2026-11-13-tjr-real-arc

Conversation

@tomrittervg

Copy link
Copy Markdown
Collaborator

No description provided.

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.

🟡 Changes recommended

The installer silently deletes all contents of an existing nonempty destination, risking irreversible loss of the checkout and uncommitted work even if installation later fails.

1 open issue
What changed in this PR

This PR adds integration tests for Updatebot’s Phabricator submission using real arc against a local fake Conduit API, covering behavior that mocked commands cannot exercise.

Changes:

  • Add real-arc tests for submissions, revision management, binary files, and oversized diffs.
  • Detect unanswered arc prompts, stop retries, and include the error in Bugzilla comments.
  • Install arc and Mercurial using Firefox’s image recipe and require the integration tests in CI.
File Description
tests/​setup_real_arc.py Install arc and Mercurial using Firefox’s image recipe.
tests/​real_arc.py Exercise real arc submission and error behavior.
tests/​functionality_all_platforms.py Test job outcomes and reporting for unanswered prompts.
tests/​fake_conduit.py Provide a local Conduit API for integration tests.
test.py Register the real-arc test suite.
tasktypes/​vendoring.py Include unanswered-prompt errors in Bugzilla comments.
README.md Document integration-test setup and prerequisites.
apis/​phabricator.py Detect unanswered arc prompts and prevent retries.
.github/​workflows/​ci.yml Install required tools and enforce real-arc tests.

Review effort: Balanced

Comment thread tests/setup_real_arc.py Resolved
arc diff exits when it needs an answer, because stdin isn't a TTY, and it
asks the same question every time. PDF.js's update to 7a4022e2 (bug
2092381) changed binary cmap files that arc doesn't recognise as binary,
so arc asked whether to mark them as binary; we retried it four times
over nine minutes, then commented only that we couldn't submit to
Phabricator. Give up on the first attempt, and quote the question in the
comment.

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.

🟡 Changes recommended

The test helper commits before configuring a Mercurial username, causing every real-arc test to fail during setup on interactive developer runs without an existing author configuration.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread tests/real_arc.py Resolved

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.

🟢 Approval recommended

No active review issues remain for the real-Arcanist integration tests and unanswered-prompt handling changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

…ator.

Updatebot's tests mock arc, so they couldn't catch arc's own behaviour:
it stopped to ask about PDF.js's non-UTF-8 files (bug 2092381), and
marking an added file binary crashed it on PHP 8 (bug 2092399).

tests/setup_real_arc.py installs arc and Mercurial the way Firefox's
Updatebot Docker image does, reading the recipe from Firefox so it can't
drift: the arcanist revision and Mozilla's patches to it, the evolve
pin, the Mercurial version, and Firefox's .arcconfig. It only replaces a
directory it installed into itself.

tests/fake_conduit.py is a fake Conduit API, with responses shaped like
Phabricator's, enough for arc diff and arc call-conduit to create, chain
and edit revisions and upload files.

tests/real_arc.py runs PhabricatorProvider through the real arc in an hg
clone with Firefox's .arcconfig: submitting a commit and a stack of two,
reviewers, abandoning and commandeering, files that aren't UTF-8 (with
or without the image's patch for them), and a diff too large to submit.
They're skipped when arc isn't installed, unless
UPDATEBOT_REAL_ARC=required.

CI installs arc and Mercurial with setup_real_arc.py and requires these
tests to run, which also moves every test that uses hg from Ubuntu's
Mercurial to the image's version.
@tomrittervg
tomrittervg force-pushed the 2026-11-13-tjr-real-arc branch from e88768e to cd44c18 Compare November 13, 2026 23:13
@tomrittervg
tomrittervg merged commit 159b90d into master Nov 14, 2026
11 checks passed
@tomrittervg
tomrittervg deleted the 2026-11-13-tjr-real-arc branch November 14, 2026 03:12
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