Skip to content

test: add parameterized policy plumbing smoke test - #334671

Closed
Ross Wollman (rwoll) wants to merge 1 commit into
microsoft:mainfrom
rwoll:policy-plumbing-smoke
Closed

test: add parameterized policy plumbing smoke test#334671
Ross Wollman (rwoll) wants to merge 1 commit into
microsoft:mainfrom
rwoll:policy-plumbing-smoke

Conversation

@rwoll

@rwoll Ross Wollman (rwoll) commented Sep 5, 2026

Copy link
Copy Markdown
Member

First slice of #334560; broader policy migration coverage follows separately.

Adds a parameterized Policy Plumbing smoke test: the same user setting is editable and on without policy, but off, disabled, and marked Managed by organization with ExtensionsAutoUpdate="off".

Uses a fresh portable profile per variant. Enables the existing file-policy source alongside native policy only for smoke-driver launches; no new CLI flags.

Without policy With policy
On and editable Off, disabled, and managed by organization

Before merging

Ensure a stable, non-flaky test by running both variants 10x on:

  • Linux (Docker/Xvfb; 20/20 cases passed without retries)
  • Windows
  • macOS

🤖 Posted via Copilot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cea11743-4d3d-48b7-9b6d-8028b722593d
Comment on lines -230 to +231
} else if (environmentMainService.policyFile) {
}
if (environmentMainService.args['enable-smoke-test-driver'] && environmentMainService.policyFile) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This part of the change needs more scrutiny since it is product, not test code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will back this part of the change out and adjust the tests accordingly.

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 review overview

🟡 Changes recommended

The smoke policy currently takes precedence over native policy, enabling a production policy bypass through user-supplied launch flags.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity

New issues introduced by this change (1)
Severity Finding
High severity src/​vs/​code/​electron-main/​main.tsMultiplexPolicyService applies later services last, so appending this user-writable smoke policy…
What changed in this PR

Adds end-to-end smoke coverage for VS Code policy plumbing across managed and unmanaged profiles.

Changes:

  • Adds parameterized policy smoke tests.
  • Creates isolated portable profiles with optional file policy.
  • Enables file policy alongside platform policy during smoke-driver launches.
File Description
test/​smoke/​src/​main.ts Registers the policy smoke suite.
test/​smoke/​src/​areas/​policy/​policy.test.ts Tests editable and managed policy states.
src/​vs/​code/​electron-main/​main.ts Adds smoke-test file policy multiplexing.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

} else if (environmentMainService.policyFile) {
}
if (environmentMainService.args['enable-smoke-test-driver'] && environmentMainService.policyFile) {
policyServices.push(disposables.add(new FilePolicyService(environmentMainService.policyFile, fileService, logService)));
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