Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into vscode-test-api
Browse files Browse the repository at this point in the history
  • Loading branch information
Mate Pek committed Aug 19, 2021
2 parents dc78ac6 + 4e1683b commit e03c017
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [3.6.27] - 2021-08-09

NPM update
Moving to travis-ci.com
Minified code

## [3.6.26] - 2021-04-27

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion documents/configuration/test.advancedExecutables.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If it is an object it can contains the following properties:
| Property | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | The name of the test suite (file). Can contains variables related to `pattern`. [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md) |
| `pattern` | A relative (to workspace directory) or an absolute path or [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options). ⚠️**Avoid backslash!**: 🚫`\`; `/`; (required) [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md) |
| `pattern` | A relative (to workspace directory) or an absolute path or [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options). ⚠️**Avoid backslash!**: NO `\\`; (required) [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md) |
| `description` | A less prominent text after the `name`. Can contains variables related to `pattern`. [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md) |
| `cwd` | The current working directory for the test executable. If it isn't provided and `test.workingDirectory` does then that will be used. Can contains variables related to `pattern`. [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md) |
| `env` | Environment variables for the test executable. Can contains variables related to `pattern` and variables related to the process's environment variables (Ex.: `${os_env:PATH}`). [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md) |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"type": "string"
},
"pattern": {
"markdownDescription": "A relative (to workspace directory) or an absolute path or [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options). ⚠️**Avoid backslash!**: 🚫`\\`; ✅`/`; (required) [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md)",
"markdownDescription": "A relative (to workspace directory) or an absolute path or [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options). ⚠️**Avoid backslash!**: NO `\\\\`; (required) [Detail](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/documents/configuration/test.advancedExecutables.md)",
"anyOf": [
{
"type": "string",
Expand Down
23 changes: 21 additions & 2 deletions src/ExecutableConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { RootSuite } from './RootSuite';
import { readJSONSync } from 'fs-extra';
import { Spawner, DefaultSpawner, SpawnWithExecutor } from './Spawner';
import { RunTask, ExecutionWrapper, FrameworkSpecific } from './AdvancedExecutableInterface';
import { isWin } from '../test/Common';
import { LoggerWrapper } from './LoggerWrapper';

///

Expand Down Expand Up @@ -158,7 +160,7 @@ export class ExecutableConfig implements vscode.Disposable {
execWatcher && execWatcher.dispose();
filePaths.push(this._pattern);

this._shared.log.exceptionS(e, "Coudn't watch pattern");
this._shared.log.exceptionS(e, "Couldn't watch pattern");
}

const suiteCreationAndLoadingTasks: Promise<void>[] = [];
Expand Down Expand Up @@ -332,7 +334,7 @@ export class ExecutableConfig implements vscode.Disposable {
this._shared.log.error('resolvedCwd', e);
}

let resolvedEnv: { [prop: string]: string } = {};
let resolvedEnv: Record<string, string> = {};
try {
if (this._env) Object.assign(resolvedEnv, this._env);

Expand Down Expand Up @@ -362,6 +364,8 @@ export class ExecutableConfig implements vscode.Disposable {
}
}

checkEnvForPath(resolvedEnv, this._shared.log);

let spawner: Spawner = new DefaultSpawner();
if (this._executionWrapper) {
try {
Expand Down Expand Up @@ -569,3 +573,18 @@ export class ExecutableConfig implements vscode.Disposable {
return resolved;
}
}

function checkEnvForPath(env: Record<string, string>, log: LoggerWrapper): void {
if (isWin) {
checkPathVariance('PATH', env, log);
checkPathVariance('Path', env, log);
checkPathVariance('path', env, log);
}
}

function checkPathVariance(variance: string, env: Record<string, string>, log: LoggerWrapper): void {
if (variance in env) {
if (env[variance].indexOf('/') != -1)
log.warn(`Env variable ${variance} contains slash on Windows: "${env[variance]}". That won't really work.`);
}
}
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module.exports = {

devtool: 'source-map',

optimization: {
minimize: true,
},

externals: {
vscode: 'commonjs vscode', // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
'aws-sdk': 'commonjs aws-sdk',
Expand Down

0 comments on commit e03c017

Please sign in to comment.