Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

All notable changes to the "vectorcastTestExplorer" extension will be documented in this file.

## [1.0.27] - 2025-12-17
## [1.0.27] - 2025-12-15

### Bug fixes
- The LLM compatibility mode is now correctly applied to pre-run model usability checks too

## [1.0.26] - 2025-12-15
## [1.0.26] - 2025-12-17

### Added
- Improved Reqs2x progress tracking to be more precise
Expand Down
2 changes: 0 additions & 2 deletions python/vTestInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,6 @@ def processCommandLogic(mode, clicast, pathToUse, testString="", options=""):
except Exception as err:
errors.append(f"{vce_path}: {str(err)}")

topLevel["testData"] = enviro_list[0]["testData"] if enviro_list else []
topLevel["unitData"] = enviro_list[0]["unitData"] if enviro_list else []
topLevel["enviro"] = enviro_list
if errors:
topLevel["errors"] = errors
Expand Down
25 changes: 15 additions & 10 deletions src/testPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ import {
addLaunchConfiguration,
cleanTestResultsPaneMessage,
forceLowerCaseDriveLetter,
getWorkspaceRootPath,
getWorkspaceRootPaths,
loadLaunchFile,
mergeWorkspaceEnvResponses,
normalizePath,
openFileWithLineSelected,
} from "./utilities";
Expand Down Expand Up @@ -133,16 +134,14 @@ type UnitData = {
functionList: FunctionUnitData[];
};

type EnviroData = {
export type EnviroData = {
vcePath: string;
testData: FileTestData[];
unitData: UnitData[];
mockingSupport: boolean;
};

type CachedWorkspaceData = {
testData: FileTestData[];
unitData: UnitData[];
export type CachedWorkspaceData = {
enviro: EnviroData[];
errors?: string[];
};
Expand Down Expand Up @@ -768,13 +767,19 @@ async function loadEnviroData(
}

async function buildEnvDataCacheForCurrentDir() {
const workspaceDir = getWorkspaceRootPath();
if (workspaceDir) {
cachedWorkspaceEnvData = await getWorkspaceEnvDataVPython(workspaceDir);
} else {
// This should not be possible as we have env data, but just in case
const folderPaths = getWorkspaceRootPaths();
if (!folderPaths.length) {
vectorMessage("No workspace root found, cannot refresh environment data.");
return;
}

// Query each root in parallel
const responses = await Promise.all(
folderPaths.map((p) => getWorkspaceEnvDataVPython(p))
);

// Merge them
cachedWorkspaceEnvData = await mergeWorkspaceEnvResponses(responses);
}

/**
Expand Down
31 changes: 27 additions & 4 deletions src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { errorLevel, vectorMessage } from "./messagePane";
import { getGlobalCoverageData } from "./vcastTestInterface";
import { rebuildEnvironment } from "./vcastAdapter";
import { rebuildEnvironmentCallback } from "./callbacks";
import { CachedWorkspaceData, EnviroData } from "./testPane";
import { executeWithRealTimeEchoWithProgress } from "./vcastCommandRunner";
import { getVectorCastInstallationLocation } from "./vcastInstallation";

Expand Down Expand Up @@ -413,12 +414,34 @@ export async function updateCoverageAndRebuildEnv() {
/**
* Returns the root of the opened workspace.
*/
export function getWorkspaceRootPath(): string | undefined {
export function getWorkspaceRootPaths(): string[] {
const folders = vscode.workspace.workspaceFolders;
if (folders && folders.length > 0) {
return folders[0].uri.fsPath;
if (!folders || folders.length === 0) return [];
return folders.map((f) => f.uri.fsPath);
}

/**
* Merges multiple workspace responses into a single CachedWorkspaceData object.
*/
export async function mergeWorkspaceEnvResponses(
responses: CachedWorkspaceData[]
): Promise<CachedWorkspaceData> {
const allErrors: string[] = [];
const allEnvs: EnviroData[] = [];

for (const resp of responses) {
if (resp.errors) {
allErrors.push(...resp.errors);
}
if (resp.enviro) {
allEnvs.push(...resp.enviro);
}
}
return undefined;

return {
enviro: allEnvs,
errors: allErrors.length ? allErrors : undefined,
};
}

export async function getFullEnvReport(
Expand Down
2 changes: 1 addition & 1 deletion src/vcastAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ export async function getWorkspaceEnvDataVPython(
);
let jsonData = getJsonDataFromTestInterface(commandToRun, workspaceDir);

vectorMessage("Building environments data for workspace...");
vectorMessage(`Building environments data for workspace: ${workspaceDir}`);

return jsonData;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/internal/e2e/test/test_utils/vcast_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import expectedBasisPathTests from "../basis_path_tests.json";
import expectedAtgTests from "../atg_tests.json";

// Local VM takes longer and needs a higher TIMEOUT
export const TIMEOUT = 180_000;
export const TIMEOUT = 240_000;

export type ServerMethod =
| "GET"
Expand Down
Loading