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

PR: Enable CircleCI and first tests addition #30

Merged
merged 21 commits into from
Aug 19, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 52 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# https://circleci.com/gh/spyder-ide/spyder-vim/

machine:
environment:
# Python versions to tests (Maximum of 4 different versions)
# The last container is used to test with pyqt5 wheels
PY_VERSIONS: "2.7 3.6 3.5"
# For Coveralls
COVERALLS_REPO_TOKEN: sTGxv5iQxuiBQCoxLB53t6m2xSe58rAIq
Copy link
Member

@rlaverde rlaverde Aug 18, 2017

Choose a reason for hiding this comment

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

This token should be deleted from here (and regenerated), and added instead to https://circleci.com/gh/spyder-ide/spyder-vim/edit#env-vars

# Environment variables used by astropy helpers
TRAVIS_OS_NAME: "linux"
CONDA_DEPENDENCIES_FLAGS: "--quiet"
CONDA_DEPENDENCIES: "pytest pytest-cov"
PIP_DEPENDENCIES: "coveralls coloredlogs pytest-qt pytest-xvfb flaky"

dependencies:
pre:
# We need to run a window manager to avoid focus problems when running our tests.
# See https://github.com/TestFX/TestFX/issues/158#issuecomment-62421691
- sudo apt-get install matchbox-window-manager
override:
# First convert PY_VERSIONS to an array and then select the python version based on the CIRCLE_NODE_INDEX
- export PY_VERSIONS=($PY_VERSIONS) &&
export TRAVIS_PYTHON_VERSION=${PY_VERSIONS[$CIRCLE_NODE_INDEX]} &&
echo -e "PYTHON = $TRAVIS_PYTHON_VERSION \n============" &&
git clone git://github.com/astropy/ci-helpers.git > /dev/null &&
source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh &&
export PATH="$HOME/miniconda/bin:$PATH" &&
source activate test &&
conda install -q ciocheck -c spyder-ide --no-update-deps &&
if [ "$CIRCLE_NODE_INDEX" = "2" ]; then pip install -q spyder pyqt5==5.8.0; else conda install -q -y spyder; fi &&
if [ "$CIRCLE_NODE_INDEX" = "2" ]; then pip uninstall -q -y spyder; else conda remove -q -y spyder; fi &&
mkdir spyder-source && cd spyder-source &&
wget -q https://github.com/spyder-ide/spyder/archive/3.x.zip && unzip -q 3.x.zip &&
cd spyder-3.x && python setup.py install > /dev/null &&
cd ../../ &&
pip install .;
- DISPLAY=:99 /usr/bin/matchbox-window-manager:
background: true
- sleep 5

test:
override:
# Style checks
- export PATH="$HOME/miniconda/bin:$PATH" && source activate test && ciocheck spyder_terminal: # note the colon
parallel: true
# Tests
- export PATH="$HOME/miniconda/bin:$PATH" && source activate test && python runtests.py: # note the colon
parallel: true
# Coveralls
- export PATH="$HOME/miniconda/bin:$PATH" && source activate test && coveralls: # note the colon
parallel: true
32 changes: 32 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#

"""
File for running tests programmatically.
"""

# Third party imports
import pytest


def main():
"""
Run pytest tests.
"""
errno = pytest.main(['-x', 'spyder_vim', '-v',
'-rw', '--durations=10',
'--cov=spyder_vim', '--cov-report=term-missing'])

# sys.exit doesn't work here because some things could be running
# in the background (e.g. closing the main window) when this point
# is reached. And if that's the case, sys.exit does't stop the
# script (as you would expected).
if errno != 0:
raise SystemExit(errno)


if __name__ == '__main__':
main()
File renamed without changes.