Skip to content

Update Github CI to run new extension tests (#4954) - #4954

Open
connernilsen wants to merge 2 commits into
facebook:mainfrom
connernilsen:export-D120397203
Open

connernilsen wants to merge 2 commits into
facebook:mainfrom
connernilsen:export-D120397203

Conversation

@connernilsen

@connernilsen connernilsen commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary:

I want to make sure extension tests run when the extension changes. This adds two changes:

  1. makes test_extension run whenever someone edits anything under lsp/
  2. adds a few quick tests to pyrefly.yml, which runs on each PR

Differential Revision: D120397203

@meta-cla meta-cla Bot added the cla signed label Sep 16, 2026
@meta-codesync

meta-codesync Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@connernilsen has exported this pull request. If you are a Meta employee, you can view the originating Diff in D120397203.

@kinto0 kinto0 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.

Review automatically exported from Phabricator review in Meta.

Summary:
The extension now picks its Pyrefly binary at runtime and restarts the language
server when that choice changes. Neither had a test, and review found real bugs
in both: a failed restart left the launch specification pointing at the binary
that had just failed, so no later change was ever seen as a change.

Two suites cover it. `resolveExecutable` drives the selection table through real
settings, with stubs only for the output channel and the interpreter lookup, so
the fallback reasons that end up in the output channel are asserted directly.
`language server recovery` drives a real `LanguageClient` at a binary that
cannot start, and checks that the specification is put back and a server is
still running afterwards — the second half matters because a client whose start
failed cannot be restarted, only replaced, so a running server is the only proof
the replacement path works.

Both need a real extension host rather than mocks, because the behaviour they
depend on belongs to `vscode-languageclient`. Mocking it would assert our
assumptions about it instead. `activate` therefore returns a small hook so tests
drive restarts directly rather than racing the configuration listener.

Running them per pull request is close to free: `pyrefly.yml` already builds a
release binary, so the new step copies it into `lsp/bin` and runs the suite on
one platform. Until now nothing about the extension ran before merge — not even
type checking.

Differential Revision: D119697409
Summary:

I want to make sure extension tests run when the extension changes. This adds two changes:
1. makes `test_extension` run whenever someone edits anything under `lsp/`
2. adds a few quick tests to `pyrefly.yml`, which runs on each PR

Differential Revision: D120397203
@meta-codesync meta-codesync Bot changed the title Update Github CI to run new extension tests Update Github CI to run new extension tests (#4954) Sep 16, 2026
@github-actions github-actions Bot added size/l and removed size/l labels Sep 16, 2026

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants