pacifica/pacifica-python-uploader

View on GitHub
appveyor.yml

Summary

Maintainability
Test Coverage
version: 0.1.{build}
pull_requests:
  do_not_increment_build_number: true

environment:
  PGUSER: postgres
  PGPASSWORD: Password12!
  PGSQL_PATH: C:\Program Files\PostgreSQL\9.6
  VOLUME_PATH: C:\ingest
  PEEWEE_URL: postgres://postgres:Password12!@localhost/pacifica_metadata
  BROKER_URL: redis://127.0.0.1:6379/0
  BACKEND_URL: redis://127.0.0.1:6379/0

  matrix:
    - PYTHON: C:\Python36-x64
    - PYTHON: C:\Python37-x64
    - PYTHON: C:\Python38-x64

services:
  - postgresql

before_test:
  - ps: >
      $env:PATH = "$env:PGSQL_PATH\bin;$env:PATH";
      createdb pacifica_metadata;
      createdb pacifica_ingest;
      mkdir C:\ingest;
      mkdir C:\archive;
      C:\pacifica\Scripts\activate.ps1;
      $env:METADATA_CPCONFIG = "$PWD/travis/metadata/server.conf";
      pacifica-metadata-cmd dbsync;
      Start-Process C:\pacifica\Scripts\pacifica-metadata.exe -RedirectStandardError metadata-error.log -RedirectStandardOutput metadata-output.log;
      nuget install redis-64 -excludeversion;
      redis-64\tools\redis-server.exe --service-install;
      redis-64\tools\redis-server.exe --service-start;
      $env:ARCHIVEINTERFACE_CONFIG = "$PWD/travis/archivei/config.cfg";
      $env:ARCHIVEINTERFACE_CPCONFIG = "$PWD/travis/archivei/server.conf";
      Start-Process C:\pacifica\Scripts\pacifica-archiveinterface.exe;
      $env:UNIQUEID_CONFIG = "$PWD/travis/uniqueid/config.cfg";
      $env:UNIQUEID_CPCONFIG = "$PWD/travis/uniqueid/server.conf";
      pacifica-uniqueid-cmd dbsync;
      Start-Process C:\pacifica\Scripts\pacifica-uniqueid.exe;
      $env:INGEST_CONFIG = "$PWD/travis/ingest/apconfig.cfg";
      $env:INGEST_CPCONFIG = "$PWD/travis/ingest/server.conf";
      pacifica-ingest-cmd dbsync;
      Start-Process C:\pacifica\Scripts\pacifica-ingest.exe;
      Start-Process C:\pacifica\Scripts\celery.exe -ArgumentList "-A pacifica.ingest.tasks worker --loglevel=info -P eventlet";
      $MD_VERSION = `pip show pacifica-metadata | grep Version: | awk '{ print $2 }';
      Invoke-WebRequest https://github.com/pacifica/pacifica-metadata/archive/v${MD_VERSION}.zip -OutFile pacifica-metadata.zip;
      Expand-Archive pacifica-metadata.zip -DestinationPath C:\pacifica-metadata;
      sleep 10; Invoke-WebRequest http://localhost:8121/users;
      pushd C:\pacifica-metadata\pacifica-metadata-${MD_VERSION};
      python tests\test_files\loadit_test.py;
      popd;
      $env:POLICY_CPCONFIG = "$PWD/travis/policy/server.conf";
      $env:METADATA_URL = "http://127.0.0.1:8121";
      $env:STATUS_URL = "http://127.0.0.1:8121/keys?_id=104";
      Start-Process C:\pacifica\Scripts\pacifica-policy.exe -RedirectStandardError policy-error.log -RedirectStandardOutput policy-output.log;
      sleep 3;
      Invoke-WebRequest http://127.0.0.1:8181/status/users/search/dmlb2001/simple -TimeoutSec 1800;

build: off

install:
  - ps: >
      $env:PATH = "$env:MYSQL_PATH\bin;${env:PGSQL_PATH}\bin;${env:PYTHON}\Scripts;${env:PATH}";
      Invoke-WebRequest -Uri "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.5.zip" -OutFile "elasticsearch.zip";
      Expand-Archive "elasticsearch.zip" -DestinationPath "C:\elasticsearch";
      Start-Process C:\elasticsearch\elasticsearch-5.6.5\bin\elasticsearch;
      & $env:PYTHON\python.exe -m virtualenv C:\pacifica;
      C:\pacifica\Scripts\activate.ps1;
      python -m pip install pip setuptools wheel --upgrade;
      pip install -r requirements-dev.txt;
      pip install .;
      pip install celery[redis] eventlet redis;
      echo 'Done';


test_script:
  - ps: >
      C:\pacifica\Scripts\activate.ps1;
      pre-commit run -a;
      cd tests;
      coverage run --include="*/site-packages/pacifica/uploader/*" -m pytest -v;
      coverage report --show-missing --fail-under 100;