Unverified Commit da6678e4 authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by GitHub
Browse files

Updating Travis to run on MacOS (#468)

messing with conditionals

allow fail on mac

psql lines linux only

psql lines linux only

allow fail on mac

psql lines linux only

updated miniconda urlk

updated postgres usage

updated config + compose line (hopefully correct)

set docker compose version

added env for db data

iterating on travis file

iterating on travis file

iterating on travis file

iterating on travis file

iterating on travis file

iterating on travis file

iterating on travis file

iterating on travis file

iterating on travis file

iterating on travis file

format issue in env.yml?

iterating on travis file

reverted env yaml

test_model skipped on macos

iterating on travis file

reverted conftest

ignoring network graph

typo

another db test disabled

reverted docker-compose

removed the allow failures line
parent f7a63004
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -12,25 +12,33 @@ matrix:
      env: PYTHON_VERSION=3.6
    - os: linux
      env: PYTHON_VERSION=3.7
    
    - os: mac
      env: PYTHON_VERSION=3.6
    - os: mac
      env: PYTHON_VERSION=3.7

# Setup a postgresql instance w/postgis
services:
  - postgresql

addons:
  postgresql: 9.6
  apt:
    packages:
    - postgresql-9.6-postgis-2.4
  on:
    os: linux

before_install:
  # Create the template database that is used to instantiate the test DB 
  - psql -c 'create database template_postgis;' -U postgres
  - psql template_postgis -U postgres -c "create extension postgis"
  - psql template_postgis -c "create extension postgis_topology"
  - psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
  - psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
  - psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      psql -c 'create database template_postgis;' -U postgres;
      psql template_postgis -U postgres -c 'create extension postgis';
      psql template_postgis -c 'create extension postgis_topology';
      psql -d template_postgis -c 'GRANT ALL ON geometry_columns TO PUBLIC;';
      psql -d template_postgis -c 'GRANT ALL ON geography_columns TO PUBLIC;';
      psql -d template_postgis -c 'GRANT ALL ON spatial_ref_sys TO PUBLIC;';
    fi

install:
  # We do this conditionally because it saves us some downloading if the
@@ -38,9 +46,10 @@ install:
  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
    else
      curl -o miniconda.sh  https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh;
      curl -o miniconda.sh  https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh;
    fi
  - bash miniconda.sh -b -p $HOME/miniconda
  - ls $HOME/miniconda/bin
  - export PATH="$HOME/miniconda/bin:$PATH"
  - hash -r
  - conda config --set always_yes yes --set changeps1 no
+4 −0
Original line number Diff line number Diff line
import os
import pytest
import sys

import pandas as pd

@@ -8,6 +9,9 @@ from autocnet.graph.network import NetworkCandidateGraph

from unittest.mock import patch, PropertyMock, MagicMock

if sys.platform.startswith("darwin"):
    pytest.skip("skipping DB tests for MacOS", allow_module_level=True)

@pytest.fixture()
def cnet():
    return pd.DataFrame.from_dict({
+6 −1
Original line number Diff line number Diff line
import sys

import pytest
from autocnet.io.db import model
from autocnet.io.db.controlnetwork import db_to_df

if sys.platform.startswith("darwin"):
    pytest.skip("skipping DB tests for MacOS", allow_module_level=True)

def test_to_isis(session, db_controlnetwork):
    df = db_to_df(session.get_bind())

+4 −0
Original line number Diff line number Diff line
from datetime import datetime
import json
import sys

import numpy as np
import pandas as pd
@@ -12,6 +13,9 @@ from autocnet.graph.network import NetworkCandidateGraph

from shapely.geometry import MultiPolygon, Polygon, Point

if sys.platform.startswith("darwin"):
    pytest.skip("skipping DB tests for MacOS", allow_module_level=True)

@pytest.fixture
def session(tables, request, ncg):
    session = ncg.Session()
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ channels:
  - conda-forge
  - usgs-astrogeology
  - menpo

dependencies:
  - python >= 3
  - coveralls
+9 −9

File changed.

Contains only whitespace changes.

Loading