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: Upgrade to CircleCI v2.0 #159

Merged
merged 19 commits into from
Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
86 changes: 86 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
version: 2

main: &main
machine: true
environment:
# Used by qthelpers to close widgets after a defined time
- TEST_CI: "True"
- TEST_CI_APP: "True"
steps:
- checkout
- run:
command: docker pull dorowu/ubuntu-desktop-lxde-vnc:trusty
- run:
name: Install system packages
command: |
sudo apt-get update
sudo apt-get install libegl1-mesa
- run:
name: Install Miniconda
command: |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda install python=$PYTHON_VERSION
Copy link
Member

Choose a reason for hiding this comment

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

In this step:

  1. Please move these commands to an install.sh script in .circleci
  2. Please use Astropy's ci-helpers instead of installing Miniconda by hand. That's what we have adopted is most other repos in our org. See for example qtpy's install.sh.

- run:
name: Install Spyder from GitHub
Copy link
Member

Choose a reason for hiding this comment

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

There's no need to have this step now. It was needed before we released Spyder 3.2, but not anymore, so please remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ccordoba12 I am not sure I understand what you are saying. Do you mean that it is easier to install spyder via conda instead of via github? That is true, but I think it is better to test against the version at the head of the 3.x branch on git, in order to catch any regressions. I know that 3.x is not supposed to introduce any backward incompatibilities, but it is good to test for it. Of course, this does mean testing against a moving target which has its own problems, but I felt this approach was the most useful.

Copy link
Member

Choose a reason for hiding this comment

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

I know that 3.x is not supposed to introduce any backward incompatibilities, but it is good to test for it

Ok. I was thinking to test against the latest release, but sure, we can test against the HEAD of 3.x

Then please move this to install.sh too.

command: |
export PATH="$HOME/miniconda/bin:$PATH"
conda install --only-deps spyder
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
- run:
name: Set up test environment
Copy link
Member

Choose a reason for hiding this comment

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

The commands in this step can go to install.sh too.

Copy link
Member

Choose a reason for hiding this comment

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

And they will be simpler after switching to ci-helpers.

command: |
export PATH="$HOME/miniconda/bin:$PATH"
conda install -q notebook pytest pytest-cov flaky
pip install coveralls pytest-qt
python setup.py develop
echo '********** output of conda list **********'
conda list
- run:
name: Run tests
Copy link
Member

Choose a reason for hiding this comment

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

Please move these commands to a script called run_tests.sh. You can find an example in qtpy too.

command: |
export PATH="$HOME/miniconda/bin:$PATH"
mkdir test-reports
pytest spyder_notebook --cov=spyder_notebook --junitxml=test-reports/junit.xml
Copy link
Member

Choose a reason for hiding this comment

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

This command needs to be

pytest -x -vv spyder_notebook --cov=spyder_notebook

Copy link
Member

Choose a reason for hiding this comment

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

And after this command please add these lines

if [ $? -ne 0 ]; then
    exit 1
fi

so that this step fails if the pytest exit code is not 0.

COVERALLS_REPO_TOKEN=Kr503QwklmJYKXYRXLywrtw8zbX7K8SKx coveralls
Copy link
Member

Choose a reason for hiding this comment

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

There's no need to use COVERALLS_REPO_TOKEN in Circle now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Without the token, I get the following error:

Couldn't find a repository matching this job.
Traceback (most recent call last):
  File "/home/circleci/miniconda/bin/coveralls", line 11, in <module>
    sys.exit(main())
  File "/home/circleci/miniconda/lib/python3.6/site-packages/coveralls/cli.py", line 80, in main
    log.info(result['url'])
KeyError: 'url'
Exited with code 1

- run:
name: Run style checks
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed. Unfortunately ciocheck hasn't been updated in a long time.

You could set up support for pep8speaks in another PR though.

command: |
export PATH="$HOME/miniconda/bin:$PATH"
conda install -q -c conda-forge ciocheck
ciocheck spyder_notebook --disable-tests
- store_test_results:
path: test-reports
- store_artifacts:
path: test-reports
Copy link
Member

Choose a reason for hiding this comment

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

I see test-reports is used here. Is this really necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this uploads the test results to CircleCI but it is not clear what they do with it, so I'll remove this.


jobs:
python2.7:
<<: *main
environment:
- PYTHON_VERSION: 2.7

python3.6:
<<: *main
environment:
- PYTHON_VERSION: 3.6

python3.7:
<<: *main
environment:
- PYTHON_VERSION: 3.7


workflows:
version: 2
build_and_test:
jobs:
- python2.7
- python3.6
- python3.7
54 changes: 0 additions & 54 deletions circle.yml

This file was deleted.