Skip to content

Commit af6510d

Browse files
authored
Merge pull request #653 from fortran-lang/gnikit/issue652
test: add requirements.txt for Python deps
2 parents 81ae160 + 889c3bf commit af6510d

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2828

2929
### Changed
3030

31+
- Changed how Python packages are installed for unittesting for performance
32+
([#652](https://github.com/fortran-lang/vscode-fortran-support/issues/652))
3133
- Changed the linter to be asynchronous, should imprpove performance
3234
([#623](https://github.com/fortran-lang/vscode-fortran-support/pull/623))
3335
- Changed native `SymbolProvider` to use non-deprecated constructor

test/formatting-provider.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { FortranFormattingProvider } from '../src/features/formatting-provider';
33
import * as vscode from 'vscode';
44
import * as path from 'path';
55
import { Logger } from '../src/services/logging';
6-
import { spawnSync } from 'child_process';
76

87
suite('Formatting tests', () => {
98
let doc: vscode.TextDocument;
@@ -13,8 +12,6 @@ suite('Formatting tests', () => {
1312
);
1413

1514
suiteSetup(async function (): Promise<void> {
16-
spawnSync('pip', ['install', '--user', '--upgrade', 'findent']);
17-
spawnSync('pip', ['install', '--user', '--upgrade', 'fprettify']);
1815
doc = await vscode.workspace.openTextDocument(fileUri);
1916
await vscode.window.showTextDocument(doc);
2017
console.log('Open file: ' + fileUri.toString());

test/lsp-client.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as vscode from 'vscode';
22
import * as path from 'path';
33
import { strictEqual } from 'assert';
4-
import { spawnSync } from 'child_process';
54
import { Logger } from '../src/services/logging';
65
import { FortlsClient } from '../src/lsp/client';
76
import { delay } from '../src/lib/helper';
@@ -14,8 +13,6 @@ suite('Language Server integration tests', () => {
1413
);
1514

1615
suiteSetup(async function (): Promise<void> {
17-
console.log('Installing fortls Language Server');
18-
spawnSync('pip', ['install', '--user', '--upgrade', 'fortls']);
1916
await server.activate();
2017
});
2118

test/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fortls
2+
findent
3+
fprettify

test/runTest.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
import * as path from 'path';
22

33
import { runTests } from '@vscode/test-electron';
4+
import { spawnSync } from 'child_process';
45

56
async function main() {
67
try {
8+
// Install PyPi dependencies
9+
const results = spawnSync(`pip`, [
10+
'install',
11+
'-r',
12+
path.resolve(__dirname, '../../test/requirements.txt'),
13+
'--force',
14+
'--upgrade',
15+
]);
16+
if (results.status !== 0) {
17+
console.error(results.stderr.toString());
18+
process.exit(1);
19+
}
20+
console.log(results.stdout.toString().trim());
721
// The folder containing the Extension Manifest package.json
822
// Passed to `--extensionDevelopmentPath`
923
const extensionDevelopmentPath = path.resolve(__dirname, '../../');

0 commit comments

Comments
 (0)