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
2 changes: 1 addition & 1 deletion .github/actions/run-integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
run: |
set -o pipefail
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" \
pnpm test:release:automated --exclude-label requires-extensions --exclude-label cursor 2>&1 | tee /tmp/test-report-automated.txt
pnpm test:release:automated 2>&1 | tee /tmp/test-report-automated.txt

- name: Extract integration test stats
id: stats
Expand Down
2 changes: 1 addition & 1 deletion packages/rangelink-vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"test:coverage": "jest --coverage --coverageReporters=text --coverageReporters=text-summary --coverageReporters=html",
"test:fast": "jest --coverage --testPathIgnorePatterns '<rootDir>/src/__integration-tests__/' '\\.integration\\.test\\.ts$'",
"test:release": "./scripts/run-integration-tests.sh",
"test:release:automated": "./scripts/run-integration-tests.sh --automated",
"test:release:automated": "./scripts/run-integration-tests.sh --automated --exclude-label requires-extensions --exclude-label cursor",
"test:release:grep": "./scripts/run-integration-tests.sh --grep",
"test:release:prepare": "pnpm compile && rm -rf out/__integration-tests__ && tsc -p tsconfig.integration.json && node scripts/setup-integration-test-settings.js",
"test:release:with-extensions": "./scripts/run-integration-tests.sh --with-extensions",
Expand Down
12 changes: 3 additions & 9 deletions packages/rangelink-vscode-extension/src/LogCapture.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import type * as vscode from 'vscode';

import { ENV_RANGELINK_CAPTURE_LOGS } from './constants';
import { RangeLinkExtensionError } from './errors/RangeLinkExtensionError';
import { RangeLinkExtensionErrorCodes } from './errors/RangeLinkExtensionErrorCodes';

/**
* Environment variable that enables in-memory log capture.
* Set by the integration test runner before launching VS Code.
* When absent or not 'true', LogCapture is a transparent proxy with zero overhead.
*/
const ENV_CAPTURE_LOGS = 'RANGELINK_CAPTURE_LOGS';

/**
* Wraps an OutputChannel to optionally capture log lines in memory.
*
Expand All @@ -27,7 +21,7 @@ export class LogCapture {
private readonly captureEnabled: boolean;

constructor(private readonly outputChannel: vscode.OutputChannel) {
this.captureEnabled = process.env[ENV_CAPTURE_LOGS] === 'true';
this.captureEnabled = process.env[ENV_RANGELINK_CAPTURE_LOGS] === 'true';
}

/**
Expand Down Expand Up @@ -91,7 +85,7 @@ export class LogCapture {
if (!this.captureEnabled) {
throw new RangeLinkExtensionError({
code: RangeLinkExtensionErrorCodes.LOG_CAPTURE_DISABLED,
message: `LogCapture.${methodName}() called without RANGELINK_CAPTURE_LOGS=true — this method is for integration tests only`,
message: `LogCapture.${methodName}() called without ${ENV_RANGELINK_CAPTURE_LOGS}=true — this method is for integration tests only`,
functionName: `LogCapture.${methodName}`,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ describe('BindToTextEditorCommand', () => {
outcome: 'bound',
bindInfo: { destinationName: 'app.ts', destinationKind: 'text-editor' },
});
expect(mockDestinationManager.bind).toHaveBeenCalledWith({
kind: 'text-editor',
uri: eligibleFile.uri,
viewColumn: 1,
});
expect(mockDestinationManager.bind).toHaveBeenCalledWith(eligibleFile.bindOptions);
expect(mockLogger.debug).toHaveBeenCalledWith(
{ fn: 'BindToTextEditorCommand.executeWithPicker', filename: 'app.ts' },
'Single file, auto-binding',
Expand Down Expand Up @@ -134,11 +130,7 @@ describe('BindToTextEditorCommand', () => {
outcome: 'bound',
bindInfo: { destinationName: 'utils.ts', destinationKind: 'text-editor' },
});
expect(mockDestinationManager.bind).toHaveBeenCalledWith({
kind: 'text-editor',
uri: eligibleFile2.uri,
viewColumn: 2,
});
expect(mockDestinationManager.bind).toHaveBeenCalledWith(eligibleFile2.bindOptions);
expect(mockLogger.debug).toHaveBeenCalledWith(
{ fn: 'BindToTextEditorCommand.executeWithPicker', fileCount: 2 },
'Starting bind to text editor command',
Expand Down
Loading
Loading