Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2141 fix travis #1255

Merged
merged 39 commits into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f4922c3
test build
DonJayamanne Sep 26, 2017
c18c5a4
remove fabric
DonJayamanne Sep 26, 2017
98db358
remove jupyter
DonJayamanne Sep 26, 2017
e0d39e2
fix errors
DonJayamanne Sep 26, 2017
7c1a6ce
Merge branch 'master' into 2141FixTravis
DonJayamanne Sep 27, 2017
476a13d
updated travis file to include jupyter and install python-dev
DonJayamanne Sep 27, 2017
97d63d5
attempt to fix install of jupyter, with dep on scandir
DonJayamanne Sep 27, 2017
4db8a05
include sources
DonJayamanne Sep 27, 2017
f9c625e
fix unittest tests
DonJayamanne Sep 27, 2017
44d2dde
Merge branch '2141FixTravis' of https://github.com/DonJayamanne/pytho…
DonJayamanne Sep 27, 2017
ad3b1c5
revert change
DonJayamanne Sep 27, 2017
70fa288
include py3 into tests
DonJayamanne Sep 27, 2017
1d8e414
moved to separate dir
DonJayamanne Sep 27, 2017
925a6e9
remove unwanted files
DonJayamanne Sep 27, 2017
af70c95
fixed tests and removed hacky approach to setting pythonpath
DonJayamanne Sep 27, 2017
40416c3
enabled python 3.6
DonJayamanne Sep 27, 2017
21e132a
Merge branch 'master' into 2141FixTravis
DonJayamanne Sep 27, 2017
30f4276
Merge branch '2141FixTravis' of https://github.com/DonJayamanne/pytho…
DonJayamanne Sep 27, 2017
4c99b2c
use oxs
DonJayamanne Sep 27, 2017
bb6b2d3
disable osx tests
DonJayamanne Sep 28, 2017
3bf167a
Merge branch 'master' into 2141FixTravis
DonJayamanne Sep 28, 2017
3d9bc9e
renamed files to remove unnecessary prefixes
DonJayamanne Sep 29, 2017
413f571
disable checking results of installer on travis
DonJayamanne Sep 29, 2017
82fa395
renamed to remove unnecessary prefixes
DonJayamanne Sep 29, 2017
a4d8f3f
log test output
DonJayamanne Sep 29, 2017
f1868d9
removed debug code
DonJayamanne Sep 29, 2017
0b975d6
lots of logging to identify errors in python 2.7 on travis
DonJayamanne Sep 29, 2017
f9cc057
clean up jupyter tests
DonJayamanne Sep 29, 2017
cf87c9f
aditional logging
DonJayamanne Sep 29, 2017
73dd9a6
ignore last filed files
DonJayamanne Sep 29, 2017
45cb9b0
ignore files
DonJayamanne Sep 29, 2017
688e204
renamed
DonJayamanne Sep 29, 2017
d0da373
uncommented files
DonJayamanne Sep 29, 2017
3421dfc
fix unit tests (to run on travis and locally)
DonJayamanne Sep 29, 2017
00e03d6
ignore noseids
DonJayamanne Sep 29, 2017
bf2d9a6
remove virtualenv and remove sudo requirement
DonJayamanne Oct 2, 2017
9c0b753
added cache:pip and removed sudo requirements
DonJayamanne Oct 2, 2017
d997ed1
Merge branch 'master' into 2141FixTravis
DonJayamanne Oct 3, 2017
d740f1f
code review updates
DonJayamanne Oct 3, 2017
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ out
node_modules
*.pyc
.vscode/.ropeproject/**
src/test/.vscode/tags
src/test/.vscode/**
**/testFiles/**/.cache/**
*.noseids
55 changes: 25 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
language: python
sudo: required
dist: trusty
cache: pip

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add cache: pip to cache pip-installed dependencies.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
- gcc-4.9-multilib
- g++-4.9-multilib
- libgtk2.0-0
- libx11-dev
- libxkbfile-dev
- libsecret-1-dev
- python-dev
matrix:
include:
# # Use the built in venv for linux builds
- os: linux
sudo: required
python: 2.7
- os: linux
sudo: required
python: 3.5
python: 3.6
# # # Use generic language for osx
# - os: osx
# language: generic
# env: PYTHON=2.7.10
# # Use generic language for osx
- os: osx
language: generic
env: PYTHON=2.7.10
# Use generic language for osx
- os: osx
language: generic
env: PYTHON=3.5.1
# Perform the manual steps on osx to install python3 and activate venv
# - os: osx
# language: generic
# env: PYTHON=3.6.1
# Perform the manual steps on osx to install python 2.7.1 and 3.6.1 and set it as the global interpreter.
# This way when the node unit tests will pick the right version of python (from global)
before_install: |
if [ $TRAVIS_OS_NAME == "linux" ]; then
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
Expand All @@ -37,26 +45,13 @@ before_install: |
nvm use 7.2.1
npm config set python `which python`
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update;
brew install openssl readline
brew outdated pyenv || brew upgrade pyenv
brew install pyenv-virtualenv
brew install pyenv-virtualenvwrapper
pyenv install $PYTHON
pyenv virtualenv $PYTHON MYVERSION
source ~/.pyenv/versions/MYVERSION/bin/activate
python --version
python -c 'import sys;print(sys.version)'
python -c 'import sys;print(sys.executable)'
pyenv install $PYTHON
pyenv global $PYTHON
fi
install:
# we have this here so we can see where python is installed and hardcode in our tests
# else when running npm test, the python version picked is completely different :(
- python --version
- python -c 'import sys;print(sys.executable)'
- pip install -r requirements.txt
- pip install --upgrade -r requirements.txt
- npm install
- npm run vscode:prepublish

script:
- npm test --silent
- npm test --silent
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jupyter
ipython
nose
pytest
#fabric
numba
fabric
numba
3 changes: 0 additions & 3 deletions src/test/.vscode/xsettings.jsons

This file was deleted.

23 changes: 7 additions & 16 deletions src/test/autocomplete/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Please refer to their documentation on https://mochajs.org/ for help.


// Place this right on top
import { initialize, PYTHON_PATH, closeActiveWindows, setPythonExecutable } from '../initialize';
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';
import { EOL } from 'os';
Expand All @@ -12,12 +10,11 @@ import { EOL } from 'os';
import * as vscode from 'vscode';
import * as path from 'path';
import * as settings from '../../client/common/configSettings';
import { initialize, closeActiveWindows } from '../initialize';
import { execPythonFile } from '../../client/common/utils';
import { createDeferred } from '../../client/common/helpers';

let pythonSettings = settings.PythonSettings.getInstance();
let disposable: vscode.Disposable;
let autoCompPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'autocomp');
const pythonSettings = settings.PythonSettings.getInstance();
const autoCompPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'autocomp');
const fileOne = path.join(autoCompPath, 'one.py');
const fileImport = path.join(autoCompPath, 'imp.py');
const fileDoc = path.join(autoCompPath, 'doc.py');
Expand All @@ -27,21 +24,15 @@ const fileEncoding = path.join(autoCompPath, 'four.py');
const fileEncodingUsed = path.join(autoCompPath, 'five.py');

suite('Autocomplete', () => {
const isPython3Deferred = createDeferred<boolean>();
const isPython3 = isPython3Deferred.promise;
let isPython3: Promise<boolean>;
suiteSetup(async () => {
disposable = setPythonExecutable(pythonSettings);
await initialize();
let version = await execPythonFile(pythonSettings.pythonPath, ['--version'], __dirname, true);
isPython3Deferred.resolve(version.indexOf('3.') >= 0);
isPython3 = Promise.resolve(version.indexOf('3.') >= 0);
});

suiteTeardown(done => {
closeActiveWindows().then(done, done);
});
teardown(done => {
closeActiveWindows().then(done, done);
});
suiteTeardown(() => closeActiveWindows());
teardown(() => closeActiveWindows());

test('For "sys."', done => {
let textEditor: vscode.TextEditor;
Expand Down
29 changes: 9 additions & 20 deletions src/test/autocomplete/pep484.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// Please refer to their documentation on https://mochajs.org/ for help.


// Place this right on top
import { initialize, closeActiveWindows, setPythonExecutable } from '../initialize';
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';
// You can import and use all API from the 'vscode' module
Expand All @@ -13,30 +11,21 @@ import * as vscode from 'vscode';
import * as path from 'path';
import * as settings from '../../client/common/configSettings';
import { execPythonFile } from '../../client/common/utils';
import { createDeferred } from '../../client/common/helpers';
import { initialize, closeActiveWindows } from '../initialize';

let pythonSettings = settings.PythonSettings.getInstance();
let disposable: vscode.Disposable;

let autoCompPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'autocomp');
const pythonSettings = settings.PythonSettings.getInstance();
const autoCompPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'autocomp');
const filePep484 = path.join(autoCompPath, 'pep484.py');

suite('Autocomplete PEP 484', () => {
const isPython3Deferred = createDeferred<boolean>();
const isPython3 = isPython3Deferred.promise;
let isPython3: Promise<boolean>;
suiteSetup(async () => {
disposable = setPythonExecutable(pythonSettings);
await initialize();
let version = await execPythonFile(pythonSettings.pythonPath, ['--version'], __dirname, true);
isPython3Deferred.resolve(version.indexOf('3.') >= 0);
});
suiteTeardown(done => {
disposable.dispose();
closeActiveWindows().then(() => done(), () => done());
});
teardown(done => {
closeActiveWindows().then(() => done(), () => done());
const version = await execPythonFile(pythonSettings.pythonPath, ['--version'], __dirname, true);
isPython3 = Promise.resolve(version.indexOf('3.') >= 0);
});
suiteTeardown(() => closeActiveWindows());
teardown(() => closeActiveWindows());

test('argument', async () => {
if (!await isPython3) {
Expand Down Expand Up @@ -64,4 +53,4 @@ suite('Autocomplete PEP 484', () => {
assert.notEqual(list.items.filter(item => item.label === 'bit_length').length, 0, 'bit_length not found');
assert.notEqual(list.items.filter(item => item.label === 'from_bytes').length, 0, 'from_bytes not found');
});
});
});
29 changes: 9 additions & 20 deletions src/test/autocomplete/pep526.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// Please refer to their documentation on https://mochajs.org/ for help.


// Place this right on top
import { initialize, closeActiveWindows, setPythonExecutable } from '../initialize';
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';
// You can import and use all API from the 'vscode' module
Expand All @@ -13,30 +11,21 @@ import * as vscode from 'vscode';
import * as path from 'path';
import * as settings from '../../client/common/configSettings';
import { execPythonFile } from '../../client/common/utils';
import { createDeferred } from '../../client/common/helpers';
import { initialize, closeActiveWindows } from '../initialize';

let pythonSettings = settings.PythonSettings.getInstance();
let disposable: vscode.Disposable;

let autoCompPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'autocomp');
const pythonSettings = settings.PythonSettings.getInstance();
const autoCompPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'autocomp');
const filePep526 = path.join(autoCompPath, 'pep526.py');

suite('Autocomplete PEP 526', () => {
const isPython3Deferred = createDeferred<boolean>();
const isPython3 = isPython3Deferred.promise;
let isPython3: Promise<boolean>;
suiteSetup(async () => {
disposable = setPythonExecutable(pythonSettings);
await initialize();
let version = await execPythonFile(pythonSettings.pythonPath, ['--version'], __dirname, true);
isPython3Deferred.resolve(version.indexOf('3.') >= 0);
});
suiteTeardown(done => {
disposable.dispose();
closeActiveWindows().then(() => done(), () => done());
});
teardown(done => {
closeActiveWindows().then(() => done(), () => done());
const version = await execPythonFile(pythonSettings.pythonPath, ['--version'], __dirname, true);
isPython3 = Promise.resolve(version.indexOf('3.') >= 0);
});
suiteTeardown(() => closeActiveWindows());
teardown(() => closeActiveWindows());

test('variable (abc:str)', async () => {
if (!await isPython3) {
Expand Down Expand Up @@ -107,4 +96,4 @@ suite('Autocomplete PEP 526', () => {
const list = await vscode.commands.executeCommand<vscode.CompletionList>('vscode.executeCompletionItemProvider', textDocument.uri, position);
assert.notEqual(list.items.filter(item => item.label === 'bit_length').length, 0, 'bit_length not found');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
// Please refer to their documentation on https://mochajs.org/ for help.
//

// Place this right on top
import { initialize } from './../initialize';
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';
import * as vscode from 'vscode';

// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import { initialize } from './../initialize';
import { execPythonFile } from '../../client/common/utils';
import { EOL } from 'os';
import { createDeferred } from '../../client/common/helpers';
import * as vscode from 'vscode';

// Defines a Mocha test suite to group tests of similar kind together
suite('ChildProc', () => {
setup(done => {
initialize().then(() => done(), done);
});
setup(() => initialize());
test('Standard Response', done => {
execPythonFile('python', ['-c', 'print(1)'], __dirname, false).then(data => {
assert.ok(data === '1' + EOL);
Expand Down Expand Up @@ -78,4 +75,4 @@ suite('ChildProc', () => {

def.promise.then(done).catch(done);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@
// Please refer to their documentation on https://mochajs.org/ for help.
//

// Place this right on top
import { initialize, IS_TRAVIS } from './../initialize';
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';

// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
import { initialize, IS_TRAVIS } from './../initialize';
import { PythonSettings } from '../../client/common/configSettings';
import { SystemVariables } from '../../client/common/systemVariables';

const pythonSettings = PythonSettings.getInstance();

// Defines a Mocha test suite to group tests of similar kind together
suite('Configuration Settings', () => {
setup(done => {
initialize().then(() => done(), done);
});
setup(() => initialize());

if (!IS_TRAVIS) {
test('Check Values', done => {
const systemVariables: SystemVariables = new SystemVariables();
Expand All @@ -39,4 +37,4 @@ suite('Configuration Settings', () => {
done();
});
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ suite('Deferred', () => {

done();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ suite('IdDispenser', () => {

done();
});
});
});
Loading