Repository navigation
fix: disable Copilot by default in the mock Vaadin environment (#280) (CP: 25.3) - #289
Merged
Merged
Conversation
… (CP: 25.3) This PR cherry-picks changes from the original PR #280 to branch 25.3. --- #### Original PR description > **Review risk:** two-way door — changes a default in the mock environment only; tests that relied on Copilot initializing (unlikely) now need `copilot.enable=true`. > > ## Summary > Every mock Vaadin environment initializes a real servlet, and when Copilot is on the test classpath its service init listener scans the classpath on each initialization, i.e. once per test. There is no browser and no Copilot UI in a browserless test, so that only slows the suite down. Copilot is now disabled by default in the mock environment, and a test that needs it can enable it again through the regular test configuration. > > Refs #278 (Spring is not covered yet, see below) > > ## What changed > - `MockVaadin.setupServlet` sets `copilot.enable=false` on the mock context and servlet init parameters *before* the test's `BrowserlessConfiguration` application properties. It is a default, not an enforced value: `@BrowserlessTestConfig(applicationProperties = "copilot.enable=true")` or `withApplicationProperty("copilot.enable", "true")` re-enables Copilot. > - The key is `copilot.enable` without a `vaadin.` prefix, because that is what Copilot reads from `ApplicationConfiguration` outside Spring. Flow adds the `vaadin.` prefix only when it looks up JVM system properties. > - Behavior change: Copilot no longer initializes in plain JUnit, extension, `BrowserlessApplicationContext` and Quarkus based tests unless enabled. > - Not covered: with Spring, Copilot reads `vaadin.copilot.enable` from the Spring `Environment` and ignores init parameters, so `SpringBrowserlessTest` is unaffected. The README explains how to set it there. Options for a framework-level default are discussed on the issue. > - README documents the default and how to override it. > > ## Test summary > - Without configuration, the application configuration reports Copilot disabled (fails without the change). > - A method-level `@BrowserlessTestConfig` with `copilot.enable=true` turns it back on, proving the test configuration wins over the default. > - Full build passes (`junit6`: 1503 tests). > > Fixes #278 (cherry picked from commit d490289)
mcollovati
enabled auto-merge (squash)
October 13, 2026 13:01
caalador
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR cherry-picks changes from the original PR #280 to branch 25.3.
Original PR description