Skip to content

Commit a07ce0d

Browse files
committed
some other ideas?
1 parent 92b5544 commit a07ce0d

File tree

2 files changed

+5
-74
lines changed

2 files changed

+5
-74
lines changed

src/test/testing/common/ua.test.ts

Lines changed: 4 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ import { TestController, TestRun, TestRunProfileKind, Uri } from 'vscode';
55
import * as typeMoq from 'typemoq';
66
import * as path from 'path';
77
import * as assert from 'assert';
8-
import * as fs from 'fs';
98
import * as sinon from 'sinon';
109
import { ITestController, ITestResultResolver } from '../../../client/testing/testController/common/types';
1110
import { IPythonExecutionFactory } from '../../../client/common/process/types';
1211
import { IConfigurationService, ITestOutputChannel } from '../../../client/common/types';
1312
import { IServiceContainer } from '../../../client/ioc/types';
1413
import { EXTENSION_ROOT_DIR_FOR_TESTS, initialize } from '../../initialize';
15-
import { traceError, traceLog } from '../../../client/logging';
14+
import {traceLog } from '../../../client/logging';
1615
import { UnittestTestExecutionAdapter } from '../../../client/testing/testController/unittest/testExecutionAdapter';
1716
import { PythonResultResolver } from '../../../client/testing/testController/common/resultResolver';
1817
import { TestProvider } from '../../../client/testing/types';
@@ -32,60 +31,14 @@ suite('End to End Tests: the broken one', () => {
3231
let testController: TestController;
3332
let getPixiStub: sinon.SinonStub;
3433
const unittestProvider: TestProvider = UNITTEST_PROVIDER;
35-
const rootPathSmallWorkspace = path.join(
36-
EXTENSION_ROOT_DIR_FOR_TESTS,
37-
'src',
38-
'testTestingRootWkspc',
39-
'smallWorkspace',
40-
);
41-
// const rootPathLargeWorkspace = path.join(
42-
// EXTENSION_ROOT_DIR_FOR_TESTS,
43-
// 'src',
44-
// 'testTestingRootWkspc',
45-
// 'largeWorkspace',
46-
// );
4734
const rootPathErrorWorkspace = path.join(
4835
EXTENSION_ROOT_DIR_FOR_TESTS,
4936
'src',
5037
'testTestingRootWkspc',
5138
'errorWorkspace',
5239
);
53-
const rootPathDiscoverySymlink = path.join(
54-
EXTENSION_ROOT_DIR_FOR_TESTS,
55-
'src',
56-
'testTestingRootWkspc',
57-
'symlinkWorkspace',
58-
);
59-
const nestedTarget = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'testTestingRootWkspc', 'target workspace');
60-
const nestedSymlink = path.join(
61-
EXTENSION_ROOT_DIR_FOR_TESTS,
62-
'src',
63-
'testTestingRootWkspc',
64-
'symlink_parent-folder',
65-
);
6640
suiteSetup(async () => {
67-
// create symlink for specific symlink test
68-
const target = rootPathSmallWorkspace;
69-
const dest = rootPathDiscoverySymlink;
7041
serviceContainer = (await initialize()).serviceContainer;
71-
try {
72-
fs.symlink(target, dest, 'dir', (err) => {
73-
if (err) {
74-
traceError(err);
75-
} else {
76-
traceLog('Symlink created successfully for regular symlink end to end tests.');
77-
}
78-
});
79-
fs.symlink(nestedTarget, nestedSymlink, 'dir', (err) => {
80-
if (err) {
81-
traceError(err);
82-
} else {
83-
traceLog('Symlink created successfully for nested symlink end to end tests.');
84-
}
85-
});
86-
} catch (err) {
87-
traceError(err);
88-
}
8942
});
9043

9144
setup(async () => {
@@ -123,31 +76,9 @@ suite('End to End Tests: the broken one', () => {
12376
sinon.restore();
12477
});
12578
suiteTeardown(async () => {
126-
// remove symlink
127-
const dest = rootPathDiscoverySymlink;
128-
if (fs.existsSync(dest)) {
129-
fs.unlink(dest, (err) => {
130-
if (err) {
131-
traceError(err);
132-
} else {
133-
traceLog('Symlink removed successfully after tests, rootPathDiscoverySymlink.');
134-
}
135-
});
136-
} else {
137-
traceLog('Symlink was not found to remove after tests, exiting successfully, rootPathDiscoverySymlink.');
138-
}
139-
140-
if (fs.existsSync(nestedSymlink)) {
141-
fs.unlink(nestedSymlink, (err) => {
142-
if (err) {
143-
traceError(err);
144-
} else {
145-
traceLog('Symlink removed successfully after tests, nestedSymlink.');
146-
}
147-
});
148-
} else {
149-
traceLog('Symlink was not found to remove after tests, exiting successfully, nestedSymlink.');
150-
}
79+
sinon.restore();
80+
sinon.reset();
81+
sinon.resetBehavior();
15182
});
15283
test('unittest execution adapter seg fault error handling', async () => {
15384
resultResolver = new PythonResultResolver(testController, unittestProvider, workspaceUri);

src/testTestingRootWkspc/errorWorkspace/test_seg_fault.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def cause_segfault(self):
1111
ctypes.string_at(0) # Dereference a NULL pointer
1212

1313
def test_segfault(self):
14-
self.cause_segfault()
1514
assert True
15+
self.cause_segfault()
1616

1717

1818
if __name__ == "__main__":

0 commit comments

Comments
 (0)