Skip to content

Commit

Permalink
Migrating travis -> circle (snorkel-team#1685)
Browse files Browse the repository at this point in the history
## Description of proposed changes
Replacing the CI system from Travis to Circle as we have seen issues running on Travis
## Related issue(s)
N/A
Fixes # (issue)
N/A
## Test plan
Having the CI tests run be Circle instead of Travis should test this 
## Checklist

Need help on these? Just ask!

* [x] I have read the **CONTRIBUTING** document.
* [x] I have updated the documentation accordingly.
* [x] I have added tests to cover my changes.
* [x] I have run `tox -e complex` and/or `tox -e spark` if appropriate.
* [x] All new and existing tests passed.
  • Loading branch information
humzaiqbal authored and Andreas Kodewitz committed Jun 10, 2022
1 parent 22475db commit 2cae679
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 72 deletions.
154 changes: 154 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
version: 2.1

orbs:
python: circleci/python@1.2

commands:
setup_dependencies:
description: "Install depenencies"
parameters:
after-deps:
description: "Install dependenceis"
type: steps
default: []
steps:
- run:
name: "Install open JDK"
command: sudo add-apt-repository -y ppa:openjdk-r/ppa
- run:
name: "Install qq"
command: sudo apt-get -qq update
- run:
name: "No install recommends for JDK"
command: sudo apt-get install -y openjdk-8-jdk --no-install-recommends
- run:
name: "Run Java Alternatives install for JDK"
command: sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
- run:
name: "Run pip install setup tools and wheel"
command: pip install -U pip setuptools wheel
- run:
name: "Install Tox"
command: pip install -U tox==3.12.0
- run:
name: "Install Code Cov"
command: pip install -U codecov
- steps: << parameters.after-deps >>

# We want to make sure we run this only on master branch, release, or when we make tags
run_complex: &run_complex
filters:
branches:
only:
- (master|release-v.*)
tags:
only: /.*/

jobs:
Python38-Unit-Tests:
docker:
- image: cimg/python:3.8
environment:
TOXENV: coverage,doctest,type,check
TOX_INSTALL_DIR: .env
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64

steps:
- checkout
- setup_dependencies
- run:
name: "Run Tox"
command: tox

Python37-Unit-Tests:
docker:
- image: cimg/python:3.7
environment:
TOXENV: coverage,doctest,type,check
TOX_INSTALL_DIR: .env
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64

steps:
- checkout
- setup_dependencies
- run:
name: "Run Tox"
command: tox

Python36-Unit-Tests:
docker:
- image: cimg/python:3.6
environment:
TOXENV: coverage,doctest,type,check
TOX_INSTALL_DIR: .env
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64

steps:
- checkout
- setup_dependencies
- run:
name: "Run Tox"
command: tox
Python38-Integration-Tests:
docker:
- image: cimg/python:3.8
environment:
TOXENV: complex,type,check
TOX_INSTALL_DIR: .env
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64

steps:
- checkout
- setup_dependencies
- run:
name: "Run Tox"
command: tox

Python37-Integration-Tests:
docker:
- image: cimg/python:3.7
environment:
TOXENV: complex,spark,type,check
TOX_INSTALL_DIR: .env
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64

steps:
- checkout
- setup_dependencies
- run:
name: "Run Tox"
command: tox

Python36-Integration-Tests:
docker:
- image: cimg/python:3.6
environment:
TOXENV: coverage,complex,spark,doctest,type,check
TOX_INSTALL_DIR: .env
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64

steps:
- checkout
- setup_dependencies
- run:
name: "Run Tox"
command: tox

workflows:
version: 2

Interation-Tests:
jobs:
- Python38-Integration-Tests:
<<: *run_complex
- Python37-Integration-Tests:
<<: *run_complex
- Python36-Integration-Tests:
<<: *run_complex
Unit-Tests:
jobs:
- Python37-Unit-Tests
- Python36-Unit-Tests
- Python38-Unit-Tests

70 changes: 0 additions & 70 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Any test that runs longer than half a second should be marked with the
`@pytest.mark.complex` decorator.
Typically, these will be integration tests or tests that verify complex
properties like model convergence.
We exclude long-running tests from the default `tox` and Travis builds
We exclude long-running tests from the default `tox` and Circle CI builds
on non-master and non-release branches to keep things moving fast.
If you're touching areas of the code that could break a long-running test,
you should include the results of `tox -e complex` in the PR's test plan.
Expand All @@ -124,7 +124,7 @@ To see the durations of the 10 longest-running tests, run

PySpark tests are invoked separately from the rest since they require
installing Java and the large PySpark package.
They are executed on Travis, but not by default for a local `tox` command.
They are executed on Circle CI, but not by default for a local `tox` command.
If you're making changes to Spark-based operators, make sure you have
Java 8 installed locally and then run `tox -e spark`.
If you add a test that imports PySpark mark it with the
Expand Down

0 comments on commit 2cae679

Please sign in to comment.