Skip to content

Conversation

abrugaro
Copy link
Contributor

@abrugaro abrugaro commented Aug 5, 2025

Resolves #641

This PR introduces an initial test case for the solution server.

It assumes that the solution server is deployed and accessible via the default URL.

The test verifies the success rate by directly hitting the endpoint after requesting, accepting, and rejecting a solution.

It also checks that upon accepting a solution, the best hint is updated, returning a relevant hint for the specified ruleset and violation.

Additionally, this PR introduces a class to modify the extension's configurations, along with some minor refactors to use composition and prevent the VSCode class from growing indefinitely.

Summary by CodeRabbit

  • New Features

    • Added end-to-end tests for solution server analysis, validating solution acceptance/rejection and backend synchronization.
    • Introduced a client for interacting with the solution server backend, including methods to retrieve best hints and success rates.
    • Added configuration and utility enhancements for managing VSCode extension installation and settings in tests.
    • Added new workflow in VSCode test page for searching and requesting fixes with different fix types.
  • Bug Fixes

    • Corrected import paths and class names in test files and documentation for consistency.
  • Documentation

    • Updated README and environment documentation to reflect new features and correct file references.
  • Refactor

    • Renamed classes and improved structure in page objects and utilities for clarity and maintainability.
    • Simplified VSCode extension installation by delegating to external utilities and improved method accessibility.
  • Style

    • Added unique IDs to UI labels for solution counts in grouped incident cards.
  • Chores

    • Added new dependencies for solution server and AI SDKs.
    • Expanded Playwright configuration to include solution server-specific tests.

Signed-off-by: Alejandro Brugarolas <[email protected]>
Signed-off-by: Alejandro Brugarolas <[email protected]>
@abrugaro abrugaro self-assigned this Aug 5, 2025
@abrugaro abrugaro requested review from a team as code owners August 5, 2025 16:08
Copy link

coderabbitai bot commented Aug 5, 2025

Walkthrough

This change introduces a comprehensive end-to-end test suite for validating the integration of a solution server with a VSCode extension and an MCP backend. New TypeScript enums and interfaces are added to support configuration and response modeling. The VSCode page object and related utilities are refactored and extended to facilitate settings manipulation, extension installation, and solution request workflows. A new test suite automates the process of running analysis, requesting fixes, accepting/rejecting solutions, and verifying backend state via MCP client queries. Supporting documentation and configuration files are updated to reflect new features and file renames.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Assessment against linked issues

Objective Addressed Explanation
Automate running analysis on an app and requesting a fix for one rule (#641)
Validate data is stored for that rule in solution server tables (Kai_hints, Kai_solutions, Kai_incidents) (#641)
Re-run analysis and verify suggestions are shown from the solution server (#641)
Request and reject a solution; verify success rate endpoint response is updated (#641)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of enums ConfigurationOptions and FixTypes (tests/e2e/enums/configuration-options.enum.ts, fix-types.enum.ts) These enums are supportive but not explicitly required by the linked issue; they are utility additions.
Addition of interfaces SuccessRateResponse and BestHintResponse (tests/mcp-client/mcp-client-responses.model.ts) These type definitions are supportive for response modeling, not directly specified in the objectives.
Refactoring Application to BasePage (tests/e2e/pages/base.page.ts) This is a general refactor for code clarity, not directly related to the solution server test scenario.
Documentation updates and README additions (tests/README.md, tests/docs/contrib/e2e-environment.md) Documentation changes are not part of the test automation objective.

Possibly related PRs

  • ✨ add solution server #547: Introduces core solution server client implementation and integration in the agentic backend and VSCode extension; closely related to the test and enum additions in this PR.
  • 🌱 Support running test in dev mode #638: Refactors VSCode extension installation and testing infrastructure, overlapping with changes to VSCode page object and extension installation logic in this PR.

Suggested reviewers

  • djzager

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db68828 and 855a3bc.

📒 Files selected for processing (1)
  • tests/README.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build (windows)
  • GitHub Check: Build (linux)
  • GitHub Check: Build (macos)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (8)
tests/e2e/pages/base-page.page.ts (1)

31-33: Prefer event-driven waits over fixed timeouts

A hard-coded sleep (waitForTimeout) is brittle and lengthens the suite unnecessarily on fast machines. Consider waiting for a deterministic UI state (e.g. selector visible, IPC event, workspace ready) instead of an arbitrary 3-5 s pause.

-  public async waitDefault() {
-    await this.window.waitForTimeout(process.env.CI ? 5000 : 3000);
-  }
+  public async waitUntilReady() {
+    await this.window.waitForSelector('#workbench.parts.statusbar', { state: 'visible', timeout: 10000 });
+  }

Retain the fallback timeout only where a reliable signal is unavailable.

tests/package.json (1)

122-123: Move AI/MCP SDKs to devDependencies

@anthropic-ai/sdk and @modelcontextprotocol/sdk are used exclusively by the E2E test harness and are not required at runtime by the published extension. Declaring them under "dependencies" bloats the production install size.

-  "dependencies": {
+  "dependencies": {-    "yauzl": "^2.10.0",
-    "@anthropic-ai/sdk": "^0.57.0",
-    "@modelcontextprotocol/sdk": "^1.17.1"
+    "yauzl": "^2.10.0"
+  },
+  "devDependencies": {
+    "@anthropic-ai/sdk": "^0.57.0",
+    "@modelcontextprotocol/sdk": "^1.17.1"
   },
tests/e2e/enums/configuration-options.enum.ts (1)

1-3: Consider const enum (or literal type) for zero-runtime cost

With a single key, a regular enum emits extra JS. A const enum (or export const SolutionServerEnabled = '…' as const) keeps type-safety while tree-shaking the runtime object.

-export enum ConfigurationOptions {
-  SolutionServerEnabled = 'konveyor.solutionServer.enabled',
-}
+export const enum ConfigurationOptions {
+  SolutionServerEnabled = 'konveyor.solutionServer.enabled',
+}

Use plain enums only when you need runtime iteration.

tests/global.setup.ts (1)

7-10: Consider extracting hardcoded repository values to constants.

The hardcoded repository URL and name should be extracted to constants for better maintainability and reusability across the test suite.

+const DEFAULT_TEST_REPO_URL = 'https://github.com/konveyor-ecosystem/coolstore';
+const DEFAULT_TEST_REPO_NAME = 'coolstore';
+
 async function globalSetup() {
   console.log('Running global setup...');
-  const vscodeApp = await VSCode.init(
-    'https://github.com/konveyor-ecosystem/coolstore',
-    'coolstore'
-  );
+  const vscodeApp = await VSCode.init(DEFAULT_TEST_REPO_URL, DEFAULT_TEST_REPO_NAME);
tests/e2e/pages/configuration.page.ts (1)

16-16: Extract hardcoded extension name to a constant.

The extension name @ext:konveyor.konveyor-ai is hardcoded. Consider extracting it to a constant for better maintainability.

Add a constant at the top of the file:

const KONVEYOR_EXTENSION_FILTER = '@ext:konveyor.konveyor-ai';

Then update line 16:

-    await searchInput.pressSequentially('@ext:konveyor.konveyor-ai');
+    await searchInput.pressSequentially(KONVEYOR_EXTENSION_FILTER);
tests/e2e/tests/solution-server/solution-server-analysis-validation.test.ts (1)

128-133: Remove console.log from test code.

Debug logging should be removed from committed test code.

-    console.log(
-      await analysisView
-        .locator(`#javax-to-jakarta-import-00001-${accept ? 'accepted' : 'rejected'}-solutions`)
-        .innerText()
-    );
tests/mcp-client/mcp-client.model.ts (2)

97-97: Replace 'any' type with a more specific type.

Using 'any' type reduces type safety. Consider using a more specific type or generic constraint.

-    params: any,
+    params: Record<string, unknown>,

105-105: Remove console.log from production code.

Debug logging should not be in production code. Consider using a proper logging framework or removing it.

-    console.log(result);
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2c2e6b and 0c37c5d.

⛔ Files ignored due to path filters (1)
  • tests/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (15)
  • tests/e2e/enums/configuration-options.enum.ts (1 hunks)
  • tests/e2e/enums/fix-types.enum.ts (1 hunks)
  • tests/e2e/pages/base-page.page.ts (1 hunks)
  • tests/e2e/pages/configuration.page.ts (1 hunks)
  • tests/e2e/pages/vscode.page.ts (5 hunks)
  • tests/e2e/tests/analyze_coolstore.test.ts (1 hunks)
  • tests/e2e/tests/configure-and-run-analysis.test.ts (1 hunks)
  • tests/e2e/tests/solution-server/solution-server-analysis-validation.test.ts (1 hunks)
  • tests/e2e/utilities/vscode-commands.utils.ts (1 hunks)
  • tests/global.setup.ts (2 hunks)
  • tests/mcp-client/mcp-client-responses.model.ts (1 hunks)
  • tests/mcp-client/mcp-client.model.ts (1 hunks)
  • tests/package.json (1 hunks)
  • tests/playwright.config.ts (1 hunks)
  • webview-ui/src/components/ViolationIncidentsList.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: djzager
PR: konveyor/editor-extensions#645
File: vscode/src/webviewMessageHandler.ts:575-577
Timestamp: 2025-08-01T13:53:20.774Z
Learning: The TOGGLE_AGENT_MODE action handler in vscode/src/webviewMessageHandler.ts correctly calls toggleAgentMode() without parameters, as the toggleAgentMode function in vscode/src/utilities/configuration.ts has been updated to internally handle reading and toggling the agent mode configuration value.
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: tests/e2e/pages/vscode.pages.ts:169-174
Timestamp: 2025-07-21T15:15:59.771Z
Learning: In tests/e2e/pages/vscode.pages.ts, the hardcoded 15-second wait in the runAnalysis() method and the 600000ms (10-minute) timeout for the "Run Analysis" button are intentionally set to accommodate performance differences between Linux and Windows environments where tests run slower. These timeouts should not be reduced or replaced with element-based waits without understanding the cross-platform testing requirements.
📚 Learning: in tests/e2e/pages/vscode.pages.ts, the hardcoded 15-second wait in the runanalysis() method and the...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: tests/e2e/pages/vscode.pages.ts:169-174
Timestamp: 2025-07-21T15:15:59.771Z
Learning: In tests/e2e/pages/vscode.pages.ts, the hardcoded 15-second wait in the runAnalysis() method and the 600000ms (10-minute) timeout for the "Run Analysis" button are intentionally set to accommodate performance differences between Linux and Windows environments where tests run slower. These timeouts should not be reduced or replaced with element-based waits without understanding the cross-platform testing requirements.

Applied to files:

  • tests/e2e/tests/configure-and-run-analysis.test.ts
  • tests/e2e/tests/analyze_coolstore.test.ts
  • tests/playwright.config.ts
  • tests/e2e/pages/configuration.page.ts
  • tests/e2e/tests/solution-server/solution-server-analysis-validation.test.ts
  • tests/global.setup.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: the toggle_agent_mode action handler in vscode/src/webviewmessagehandler.ts correctly calls toggleag...
Learnt from: djzager
PR: konveyor/editor-extensions#645
File: vscode/src/webviewMessageHandler.ts:575-577
Timestamp: 2025-08-01T13:53:20.774Z
Learning: The TOGGLE_AGENT_MODE action handler in vscode/src/webviewMessageHandler.ts correctly calls toggleAgentMode() without parameters, as the toggleAgentMode function in vscode/src/utilities/configuration.ts has been updated to internally handle reading and toggling the agent mode configuration value.

Applied to files:

  • tests/e2e/tests/configure-and-run-analysis.test.ts
  • tests/e2e/tests/analyze_coolstore.test.ts
  • tests/e2e/pages/configuration.page.ts
  • tests/global.setup.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: in the tests/kai-evaluator/report/single-run-controller.js file, the insights-grid dom element is ha...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: tests/kai-evaluator/report/single-run-controller.js:6-24
Timestamp: 2025-07-21T15:20:52.480Z
Learning: In the tests/kai-evaluator/report/single-run-controller.js file, the insights-grid DOM element is hardcoded in the HTML and never removed, so null checks for getElementById calls are not necessary.

Applied to files:

  • tests/e2e/tests/configure-and-run-analysis.test.ts
📚 Learning: in the test/e2e/fixtures/provider-configs.fixture.ts file, using llmproviders.openai for openai-comp...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/e2e/fixtures/provider-configs.fixture.ts:41-42
Timestamp: 2025-07-16T16:08:20.126Z
Learning: In the test/e2e/fixtures/provider-configs.fixture.ts file, using LLMProviders.openAI for OpenAI-compatible services (like the PARASOL_PROVIDER) is expected and intentional behavior. The Parasol service uses ChatOpenAI with a custom baseURL, making it OpenAI-compatible.

Applied to files:

  • tests/e2e/tests/configure-and-run-analysis.test.ts
  • tests/e2e/tests/analyze_coolstore.test.ts
📚 Learning: in test/e2e/fixtures/provider-configs.fixture.ts, the parasol_provider intentionally uses llmprovide...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/e2e/fixtures/provider-configs.fixture.ts:41-42
Timestamp: 2025-07-16T16:08:19.410Z
Learning: In test/e2e/fixtures/provider-configs.fixture.ts, the PARASOL_PROVIDER intentionally uses LLMProviders.openAI because it exposes an OpenAI-compatible API with a custom baseURL. This is a valid pattern for custom LLM services that implement OpenAI-compatible interfaces.

Applied to files:

  • tests/e2e/tests/configure-and-run-analysis.test.ts
  • tests/e2e/tests/analyze_coolstore.test.ts
📚 Learning: in playwright test setups, global setup functions automatically catch and report errors. adding try-...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: tests/global.setup.ts:4-6
Timestamp: 2025-07-21T15:25:01.028Z
Learning: In Playwright test setups, global setup functions automatically catch and report errors. Adding try-catch blocks around operations like VSCode.init() in global setup would result in duplicate error logging since Playwright already handles and reports these errors clearly. The framework's built-in error handling is sufficient for global setup functions.

Applied to files:

  • tests/e2e/tests/configure-and-run-analysis.test.ts
  • tests/e2e/tests/analyze_coolstore.test.ts
  • tests/global.setup.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: the electron package is required for the test environment in the konveyor/editor-extensions project,...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/package.json:11-122
Timestamp: 2025-07-16T12:49:03.553Z
Learning: The electron package is required for the test environment in the konveyor/editor-extensions project, specifically for the test/package.json file.

Applied to files:

  • tests/e2e/tests/configure-and-run-analysis.test.ts
  • tests/e2e/tests/analyze_coolstore.test.ts
  • tests/package.json
  • tests/global.setup.ts
  • tests/e2e/utilities/vscode-commands.utils.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: security vulnerabilities flagged in package.json reviews may be related to the main package.json fil...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/package.json:11-122
Timestamp: 2025-07-16T12:49:03.553Z
Learning: Security vulnerabilities flagged in package.json reviews may be related to the main package.json file rather than test-specific package.json files in the konveyor/editor-extensions project.

Applied to files:

  • tests/package.json
  • tests/e2e/utilities/vscode-commands.utils.ts
📚 Learning: in playwright's electron support, automatic screenshots on test failure (configured via the screensh...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/playwright.config.ts:21-21
Timestamp: 2025-07-16T15:43:15.469Z
Learning: In Playwright's Electron support, automatic screenshots on test failure (configured via the screenshot: 'only-on-failure' setting) are not yet supported, even though manual screenshots can be taken programmatically. This limitation is tracked in GitHub issue #8208 which remains open as of 2025. The automatic screenshot-on-failure feature that works for web browsers does not work for Electron applications.

Applied to files:

  • tests/e2e/pages/base-page.page.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: in the kai-evaluator build utils, the `isbuildable` function should resolve to `false` for build fai...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/kai-evaluator/utils/build.utils.ts:5-19
Timestamp: 2025-07-16T12:40:49.553Z
Learning: In the kai-evaluator build utils, the `isBuildable` function should resolve to `false` for build failures rather than rejecting, as build failures are expected and informative in this context - the function is designed to check buildability, not execute builds.

Applied to files:

  • tests/e2e/tests/solution-server/solution-server-analysis-validation.test.ts
🔇 Additional comments (7)
tests/mcp-client/mcp-client-responses.model.ts (1)

1-13: Interfaces look good

Typed response models match the fields returned by the solution server and provide clear contracts for the MCP client.

tests/e2e/tests/configure-and-run-analysis.test.ts (1)

2-2: LGTM! Import path correctly updated.

The import path has been properly updated to reflect the refactored VSCode class location.

tests/e2e/tests/analyze_coolstore.test.ts (1)

2-2: LGTM! Import path correctly updated.

The import path has been properly updated to align with the VSCode class refactoring.

tests/e2e/enums/fix-types.enum.ts (1)

1-5: LGTM! Well-structured enum for fix types.

The enum is cleanly implemented with meaningful names and sequential numeric values that align with the solution server workflow requirements.

tests/playwright.config.ts (1)

33-36: LGTM! Consider if dependencies are needed.

The new Playwright project configuration follows the established pattern and correctly targets solution server tests. Consider whether this project should depend on 'configure-and-run-analysis' like the 'analysis-tests' project does, if the solution server tests require a configured environment.

tests/global.setup.ts (1)

1-3: LGTM! Import updates align with refactoring.

The import path corrections and new utility function import properly reflect the codebase refactoring.

tests/e2e/pages/vscode.page.ts (1)

74-77: All callers updated for init parameter order change
The only usage in tests/global.setup.ts passes the URL first and the directory second, matching the new (repoUrl?, repoDir?) signature. No further changes required.

Signed-off-by: Alejandro Brugarolas <[email protected]>
Signed-off-by: Alejandro Brugarolas <[email protected]>
Copy link

@sshveta sshveta left a comment

Choose a reason for hiding this comment

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

Some Minor suggestions only.

Signed-off-by: Alejandro Brugarolas <[email protected]>
Signed-off-by: Alejandro Brugarolas <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
tests/e2e/pages/configuration.page.ts (2)

21-35: Consider unifying configuration methods as suggested.

Per the previous review comment, consider creating a unified method that handles different types (boolean, string, string[]) to reduce code duplication. You could use method overloading or a discriminated union type approach.

Example approach:

public async setConfiguration(
  configuration: ConfigurationOptions, 
  value: boolean | string | string[]
) {
  const window = this.vsCode.getWindow();
  
  if (typeof value === 'boolean') {
    await window.getByLabel(configuration).setChecked(value);
  } else if (typeof value === 'string') {
    // Determine if it's input or dropdown based on element type
    const element = window.getByLabel(configuration);
    if (await element.evaluate(el => el.tagName === 'SELECT')) {
      await element.selectOption({ value });
    } else {
      await element.fill(value);
    }
  } else if (Array.isArray(value)) {
    // Handle array values for multi-select
    // Implementation depends on UI component
  }
}

16-16: Extract the hardcoded extension filter as a constant.

The extension filter string '@ext:konveyor.konveyor-ai' could be extracted as a constant for better maintainability.

+const KONVEYOR_EXTENSION_FILTER = '@ext:konveyor.konveyor-ai';
+
 export class Configuration {
   public constructor(private readonly vsCode: VSCode) {}

   public static async open(vsCode: VSCode) {
     // ...
-    await searchInput.pressSequentially('@ext:konveyor.konveyor-ai');
+    await searchInput.pressSequentially(KONVEYOR_EXTENSION_FILTER);
tests/e2e/tests/solution-server/analysis-validation.test.ts (1)

113-113: Extract hardcoded timeout values as constants.

The 35000ms timeout is hardcoded. Consider extracting timeouts as named constants for better maintainability.

+const SOLUTION_CONFIRMATION_TIMEOUT = 35000;
+
 test.describe(`Solution server analysis validations`, () => {
   // ...
   
   async function requestFixAndAssertSolution(accept: boolean) {
     // ...
-    ).not.toBeVisible({ timeout: 35000 });
+    ).not.toBeVisible({ timeout: SOLUTION_CONFIRMATION_TIMEOUT });
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6da0aa8 and 68d699d.

📒 Files selected for processing (6)
  • tests/e2e/enums/configuration-options.enum.ts (1 hunks)
  • tests/e2e/pages/base.page.ts (1 hunks)
  • tests/e2e/pages/configuration.page.ts (1 hunks)
  • tests/e2e/pages/vscode.page.ts (5 hunks)
  • tests/e2e/tests/solution-server/analysis-validation.test.ts (1 hunks)
  • tests/e2e/utilities/download.utils.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • tests/e2e/utilities/download.utils.ts
✅ Files skipped from review due to trivial changes (1)
  • tests/e2e/pages/base.page.ts
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: abrugaro
PR: konveyor/editor-extensions#657
File: tests/global.setup.ts:22-27
Timestamp: 2025-08-05T16:16:56.005Z
Learning: In the Playwright test framework for konveyor/editor-extensions, the global setup in tests/global.setup.ts is designed to handle only essential initialization like extension installation verification. Individual tests are responsible for configuring GenAI when needed, rather than doing it globally. The openAnalysisView() method is used as a fast verification mechanism to ensure the extension was successfully installed, which is more efficient than configuring GenAI globally for all tests.
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: tests/e2e/pages/vscode.pages.ts:169-174
Timestamp: 2025-07-21T15:15:59.771Z
Learning: In tests/e2e/pages/vscode.pages.ts, the hardcoded 15-second wait in the runAnalysis() method and the 600000ms (10-minute) timeout for the "Run Analysis" button are intentionally set to accommodate performance differences between Linux and Windows environments where tests run slower. These timeouts should not be reduced or replaced with element-based waits without understanding the cross-platform testing requirements.
Learnt from: djzager
PR: konveyor/editor-extensions#645
File: vscode/src/webviewMessageHandler.ts:575-577
Timestamp: 2025-08-01T13:53:20.774Z
Learning: The TOGGLE_AGENT_MODE action handler in vscode/src/webviewMessageHandler.ts correctly calls toggleAgentMode() without parameters, as the toggleAgentMode function in vscode/src/utilities/configuration.ts has been updated to internally handle reading and toggling the agent mode configuration value.
📚 Learning: in the playwright test framework for konveyor/editor-extensions, the global setup in tests/global.se...
Learnt from: abrugaro
PR: konveyor/editor-extensions#657
File: tests/global.setup.ts:22-27
Timestamp: 2025-08-05T16:16:56.005Z
Learning: In the Playwright test framework for konveyor/editor-extensions, the global setup in tests/global.setup.ts is designed to handle only essential initialization like extension installation verification. Individual tests are responsible for configuring GenAI when needed, rather than doing it globally. The openAnalysisView() method is used as a fast verification mechanism to ensure the extension was successfully installed, which is more efficient than configuring GenAI globally for all tests.

Applied to files:

  • tests/e2e/pages/configuration.page.ts
  • tests/e2e/tests/solution-server/analysis-validation.test.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: in tests/e2e/pages/vscode.pages.ts, the hardcoded 15-second wait in the runanalysis() method and the...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: tests/e2e/pages/vscode.pages.ts:169-174
Timestamp: 2025-07-21T15:15:59.771Z
Learning: In tests/e2e/pages/vscode.pages.ts, the hardcoded 15-second wait in the runAnalysis() method and the 600000ms (10-minute) timeout for the "Run Analysis" button are intentionally set to accommodate performance differences between Linux and Windows environments where tests run slower. These timeouts should not be reduced or replaced with element-based waits without understanding the cross-platform testing requirements.

Applied to files:

  • tests/e2e/pages/configuration.page.ts
  • tests/e2e/tests/solution-server/analysis-validation.test.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: the toggle_agent_mode action handler in vscode/src/webviewmessagehandler.ts correctly calls toggleag...
Learnt from: djzager
PR: konveyor/editor-extensions#645
File: vscode/src/webviewMessageHandler.ts:575-577
Timestamp: 2025-08-01T13:53:20.774Z
Learning: The TOGGLE_AGENT_MODE action handler in vscode/src/webviewMessageHandler.ts correctly calls toggleAgentMode() without parameters, as the toggleAgentMode function in vscode/src/utilities/configuration.ts has been updated to internally handle reading and toggling the agent mode configuration value.

Applied to files:

  • tests/e2e/pages/configuration.page.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: in playwright test framework for konveyor/editor-extensions, playwright's built-in ui interaction me...
Learnt from: abrugaro
PR: konveyor/editor-extensions#657
File: tests/e2e/pages/configuration.page.ts:21-25
Timestamp: 2025-08-05T16:17:54.293Z
Learning: In Playwright test framework for konveyor/editor-extensions, Playwright's built-in UI interaction methods like getByLabel() and setChecked() already provide comprehensive error handling and will throw meaningful errors if elements are not found or operations fail. Additional try-catch blocks around these methods are unnecessary as Playwright handles errors automatically.

Applied to files:

  • tests/e2e/pages/configuration.page.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: in playwright test setups, global setup functions automatically catch and report errors. adding try-...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: tests/global.setup.ts:4-6
Timestamp: 2025-07-21T15:25:01.028Z
Learning: In Playwright test setups, global setup functions automatically catch and report errors. Adding try-catch blocks around operations like VSCode.init() in global setup would result in duplicate error logging since Playwright already handles and reports these errors clearly. The framework's built-in error handling is sufficient for global setup functions.

Applied to files:

  • tests/e2e/pages/configuration.page.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: in playwright's electron support, automatic screenshots on test failure (configured via the screensh...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/playwright.config.ts:21-21
Timestamp: 2025-07-16T15:43:15.469Z
Learning: In Playwright's Electron support, automatic screenshots on test failure (configured via the screenshot: 'only-on-failure' setting) are not yet supported, even though manual screenshots can be taken programmatically. This limitation is tracked in GitHub issue #8208 which remains open as of 2025. The automatic screenshot-on-failure feature that works for web browsers does not work for Electron applications.

Applied to files:

  • tests/e2e/pages/configuration.page.ts
  • tests/e2e/pages/vscode.page.ts
📚 Learning: in the kai-evaluator build utils, the `isbuildable` function should resolve to `false` for build fai...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/kai-evaluator/utils/build.utils.ts:5-19
Timestamp: 2025-07-16T12:40:49.553Z
Learning: In the kai-evaluator build utils, the `isBuildable` function should resolve to `false` for build failures rather than rejecting, as build failures are expected and informative in this context - the function is designed to check buildability, not execute builds.

Applied to files:

  • tests/e2e/tests/solution-server/analysis-validation.test.ts
📚 Learning: the electron package is required for the test environment in the konveyor/editor-extensions project,...
Learnt from: abrugaro
PR: konveyor/editor-extensions#591
File: test/package.json:11-122
Timestamp: 2025-07-16T12:49:03.553Z
Learning: The electron package is required for the test environment in the konveyor/editor-extensions project, specifically for the test/package.json file.

Applied to files:

  • tests/e2e/pages/vscode.page.ts
🧬 Code Graph Analysis (1)
tests/e2e/pages/vscode.page.ts (2)
tests/e2e/pages/base.page.ts (1)
  • BasePage (4-34)
tests/e2e/utilities/vscode-commands.utils.ts (1)
  • installExtension (13-42)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build (windows)
  • GitHub Check: Build (linux)
  • GitHub Check: Build (macos)
🔇 Additional comments (1)
tests/e2e/enums/configuration-options.enum.ts (1)

1-5: Note the namespace inconsistency between configuration keys.

The SolutionEffort configuration uses konveyor.kai namespace while the other solution server configurations use konveyor.solutionServer. This might be intentional based on the extension's architecture, but ensure this is the intended organization.

Signed-off-by: Alejandro Brugarolas <[email protected]>
Signed-off-by: Alejandro Brugarolas <[email protected]>
@abrugaro abrugaro requested a review from pranavgaikwad August 7, 2025 09:07
pranavgaikwad
pranavgaikwad previously approved these changes Aug 7, 2025
Signed-off-by: Alejandro Brugarolas <[email protected]>
@abrugaro abrugaro requested a review from pranavgaikwad August 8, 2025 11:33
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.

[TEST] Automate solution server test case scenario
3 participants