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
14 changes: 13 additions & 1 deletion src/test/common/process/pythonProc.simple.multiroot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { IWorkspaceService } from '../../../client/common/application/types';
import { WorkspaceService } from '../../../client/common/application/workspace';
import { ConfigurationService } from '../../../client/common/configuration/service';
import { STANDARD_OUTPUT_CHANNEL } from '../../../client/common/constants';
import { Logger } from '../../../client/common/logger';
import { PersistentStateFactory } from '../../../client/common/persistentState';
import { IS_WINDOWS } from '../../../client/common/platform/constants';
import { FileSystem } from '../../../client/common/platform/fileSystem';
Expand All @@ -26,7 +27,7 @@ import { CurrentProcess } from '../../../client/common/process/currentProcess';
import { ProcessLogger } from '../../../client/common/process/logger';
import { registerTypes as processRegisterTypes } from '../../../client/common/process/serviceRegistry';
import { IProcessLogger, IPythonExecutionFactory, StdErrError } from '../../../client/common/process/types';
import { GLOBAL_MEMENTO, IConfigurationService, ICurrentProcess, IDisposableRegistry, IMemento, IOutputChannel, IPathUtils, IPersistentStateFactory, IsWindows, WORKSPACE_MEMENTO } from '../../../client/common/types';
import { GLOBAL_MEMENTO, IConfigurationService, ICurrentProcess, IDisposableRegistry, ILogger, IMemento, IOutputChannel, IPathUtils, IPersistentStateFactory, IsWindows, WORKSPACE_MEMENTO } from '../../../client/common/types';
import { clearCache } from '../../../client/common/utils/cacheUtils';
import { OSType } from '../../../client/common/utils/platform';
import {
Expand All @@ -35,6 +36,9 @@ import {
import { EnvironmentActivationService } from '../../../client/interpreter/activation/service';
import { IEnvironmentActivationService } from '../../../client/interpreter/activation/types';
import { IInterpreterAutoSelectionService, IInterpreterAutoSeletionProxyService } from '../../../client/interpreter/autoSelection/types';
import { ICondaService, IInterpreterService } from '../../../client/interpreter/contracts';
import { InterpreterService } from '../../../client/interpreter/interpreterService';
import { CondaService } from '../../../client/interpreter/locators/services/condaService';
import { InterpreterHashProvider } from '../../../client/interpreter/locators/services/hashProvider';
import { InterpeterHashProviderFactory } from '../../../client/interpreter/locators/services/hashProviderFactory';
import { InterpreterFilter } from '../../../client/interpreter/locators/services/interpreterFilter';
Expand Down Expand Up @@ -98,9 +102,17 @@ suite('PythonExecutableService', () => {
serviceManager.addSingleton<IPersistentStateFactory>(IPersistentStateFactory, PersistentStateFactory);
serviceManager.addSingleton<Memento>(IMemento, MockMemento, GLOBAL_MEMENTO);
serviceManager.addSingleton<Memento>(IMemento, MockMemento, WORKSPACE_MEMENTO);

serviceManager.addSingleton<ICondaService>(ICondaService, CondaService);
serviceManager.addSingleton<ILogger>(ILogger, Logger);

processRegisterTypes(serviceManager);
variablesRegisterTypes(serviceManager);

const mockInterpreterService = mock(InterpreterService);
when(mockInterpreterService.hasInterpreters).thenResolve(false);
serviceManager.addSingletonInstance<IInterpreterService>(IInterpreterService, instance(mockInterpreterService));

const mockEnvironmentActivationService = mock(EnvironmentActivationService);
when(mockEnvironmentActivationService.getActivatedEnvironmentVariables(anything())).thenResolve();
serviceManager.addSingletonInstance<IEnvironmentActivationService>(IEnvironmentActivationService, instance(mockEnvironmentActivationService));
Expand Down
4 changes: 4 additions & 0 deletions src/test/linters/lint.multiroot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { CTagsProductPathService, DataScienceProductPathService, FormatterProduc
import { ProductService } from '../../client/common/installer/productService';
import { IProductPathService, IProductService } from '../../client/common/installer/types';
import { IConfigurationService, IOutputChannel, Product, ProductType } from '../../client/common/types';
import { ICondaService } from '../../client/interpreter/contracts';
import { CondaService } from '../../client/interpreter/locators/services/condaService';
import { ILinter, ILinterManager } from '../../client/linters/types';
import { TEST_OUTPUT_CHANNEL } from '../../client/testing/common/constants';
import { closeActiveWindows, initialize, initializeTest, IS_MULTI_ROOT_TEST } from '../initialize';
Expand Down Expand Up @@ -44,7 +46,9 @@ suite('Multiroot Linting', () => {
ioc.registerLinterTypes();
ioc.registerVariableTypes();
ioc.registerPlatformTypes();
ioc.registerMockInterpreterTypes();
ioc.serviceManager.addSingletonInstance<IProductService>(IProductService, new ProductService());
ioc.serviceManager.addSingleton<ICondaService>(ICondaService, CondaService);
ioc.serviceManager.addSingleton<IProductPathService>(IProductPathService, CTagsProductPathService, ProductType.WorkspaceSymbols);
ioc.serviceManager.addSingleton<IProductPathService>(IProductPathService, FormatterProductPathService, ProductType.Formatter);
ioc.serviceManager.addSingleton<IProductPathService>(IProductPathService, LinterProductPathService, ProductType.Linter);
Expand Down
1 change: 1 addition & 0 deletions src/test/refactor/extension.refactor.extract.var.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ suite('Variable Extraction', () => {
ioc.registerCommonTypes();
ioc.registerProcessTypes();
ioc.registerVariableTypes();
ioc.registerMockInterpreterTypes();

ioc.serviceManager.addSingleton<ICondaService>(ICondaService, CondaService);
}
Expand Down