-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
71 lines (62 loc) · 2.63 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# =============================================================================
# language
language: python
python:
- "2.7"
- "3.7"
# -----------------------------------------------------------------------------
# dist: trusty (not python 3.7 compatible) or xenial (python 3.7 compatible)
dist: xenial
# =============================================================================
# command to install dependencies
#install:
# - pip install -r requirements.txt
# command to run tests
# =============================================================================
# env
env:
global:
- PYTHONPATH=.:..
- LC_ALL=en_US.utf8
- LANG=en_US.utf8
# Set to -v for Verbose option of deletr
- VerboseVar=-v
matrix:
# TestScenario: Help, DryRun, BadFiles, MultiProcessing, Remove, Replace, RemoveReplace
# Delete
- TestScenario=Delete DeletrOptions="$VerboseVar"
# =============================================================================
# before_script
# Get database token ready
# Get deletr.ini from tests
# Use environment secure variable for private settings
before_script:
- pwd
- pythonVersion=`python -V 2>&1 | cut -d\ -f2`
- echo $pythonVersion
# - ls -laR
- cp tests/deletr.ini .
- cp tests/deletr.ini /home/travis/virtualenv/python$pythonVersion/bin/deletr.ini
- grep FILES_DIR deletr.ini
# - cat deletr.ini
- echo "INSERT INTO oauth_tokens ( api_key, lookup_key, oauth_token, oauth_token_secret, access_level, fullname, username, user_nsid) VALUES ( '"$api_key"', '', '"$oauth_token"', '"$oauth_token_secret"', 'delete', '"$fullname"', '"$username"', '"$user_nsid"');" | sqlite3 token/oauth-tokens.sqlite
- sqlite3 token/oauth-tokens.sqlite 'SELECT * FROM oauth_tokens;'
# =============================================================================
# run script for tests
script:
# First RUN -------------------------------------------------------------------
- coverage run -a --concurrency multiprocessing delete.py $VerboseVar $UploadrOptions
- coverage combine
- coverage report -m delete.py
# pytest --flakes (Code analysis) ---------------------------------------------
- pytest -v --flakes
#- pytest -v # or py.test for Python versions 3.5 and below
#- pytest --doctest-modules # Attempt to run test_*.txt with doctest
# Deleted Pics Non existant on FLickr -----------------------------------------
# For testing a local deleted file also not available in flickr
# - sleep 10
# Test Deleted file
# - coverage run -a uploadr.py $VerboseVar -bl 10
# - coverage report -m uploadr.py
# - sqlite3 flickrdb "SELECT *, datetime( last_modified, 'unixepoch', 'localtime') FROM files;"
after_script: