Merge branch 'disable-online-tests'

This commit is contained in:
Mads Marquart
2019-01-25 19:18:03 +01:00
4 changed files with 26 additions and 104 deletions

View File

@@ -1,90 +1,35 @@
sudo: false sudo: false
language: python language: python
conditions: v1
python: 3.6 python: 3.6
# There are two accounts made specifically for Travis, and the passwords are really only encrypted for obscurity cache: pip
# The global env variables `client1_email`, `client1_password`, `client2_email`, `client2_password` and `group_id`
# are set on the Travis Settings page
# The tests are run with `Limit concurrent jobs = 1`, since the tests can't use the clients simultaneously
before_install: pip install flit before_install: pip install flit
# Use `--deps production` so that we don't install unnecessary dependencies
install: flit install --deps production --extras test install: flit install --deps production --extras test
script: pytest -m offline
cache:
pip: true
# Pytest caching is disabled, since TravisCI instances have different public IPs. Facebook doesn't like that,
# and redirects you to the url `/checkpoint/block`, where you have to change the account's password
# directories:
# - .pytest_cache
jobs: jobs:
include: include:
# The tests are split into online and offline versions. - python: 2.7
# The online tests are only run against the master branch. before_install:
# Because: - sudo apt-get -y install python3-pip python3-setuptools
# Travis caching is per-branch and per-job, so even though we cache the Facebook sessions via. `.pytest_cache` - sudo pip3 install flit
# and in `tests.utils.load_client`, we need 6 new sessions per branch. This is usually the point where Facebook install: flit install --python python --deps production --extras test
# starts complaining, and we have to manually fix it - python: 3.4
- python: 3.5
- python: 3.6
- python: 3.7
dist: xenial
sudo: required
- python: pypy3.5
# Run online tests in all the supported python versions - stage: deploy
- &test-online name: PyPI
if: (branch = master OR tag IS present) AND type != pull_request if: tag IS present
stage: online tests install: skip
script: scripts/travis-online script: skip
- <<: *test-online deploy:
python: 2.7 provider: script
before_install: script: flit publish
- sudo apt-get -y install python3-pip python3-setuptools on:
- sudo pip3 install flit tags: true
install: flit install --python python --deps production --extras test
- <<: *test-online
python: 3.4
- <<: *test-online
python: 3.5
- <<: *test-online
python: pypy3.5
# Run the expensive tests, with the python version most likely to break, aka. 2
- <<: *test-online
# Only run if the commit message includes [ci all] or [all ci]
if: commit_message =~ /\[ci\s+all\]|\[all\s+ci\]/
python: 2.7
before_install:
- sudo apt-get -y install python3-pip python3-setuptools
- sudo pip3 install flit
install: flit install --python python --deps production --extras test
env: PYTEST_ADDOPTS='-m expensive'
# Run offline tests in all the supported python versions
- &test-offline
# Ideally, it'd be nice to run the offline tests in every build, but since we can't run jobs concurrently (yet),
# we'll disable them when they're not needed, and include them inside the online tests instead
if: not ((branch = master OR tag IS present) AND type != pull_request)
stage: offline tests
script: scripts/travis-offline
- <<: *test-offline
python: 2.7
before_install:
- sudo apt-get -y install python3-pip python3-setuptools
- sudo pip3 install flit
install: flit install --python python --deps production --extras test
- <<: *test-offline
python: 3.4
- <<: *test-offline
python: 3.5
- <<: *test-offline
python: pypy3.5
- stage: deploy
name: PyPI
if: tag IS present
install: skip
script: skip
deploy:
provider: script
script: flit publish
on:
tags: true

View File

@@ -5,9 +5,9 @@ fbchat: Facebook Chat (Messenger) for Python
:target: https://github.com/carpedm20/fbchat/tree/master/LICENSE :target: https://github.com/carpedm20/fbchat/tree/master/LICENSE
:alt: License: BSD 3-Clause :alt: License: BSD 3-Clause
.. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6%20pypy-blue.svg .. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6%203.7%20pypy-blue.svg
:target: https://pypi.python.org/pypi/fbchat :target: https://pypi.python.org/pypi/fbchat
:alt: Supported python versions: 2.7, 3.4, 3.5, 3.6 and pypy :alt: Supported python versions: 2.7, 3.4, 3.5, 3.6, 3.7 and pypy
.. image:: https://readthedocs.org/projects/fbchat/badge/?version=master .. image:: https://readthedocs.org/projects/fbchat/badge/?version=master
:target: https://fbchat.readthedocs.io :target: https://fbchat.readthedocs.io

View File

@@ -1,5 +0,0 @@
#!/bin/bash
set -ex
python -m pytest -m offline --color=yes

View File

@@ -1,18 +0,0 @@
#!/bin/bash
set -ex
if ! python -m pytest --color=yes; then
echo << EOF
-----------------------------------------------------------------
-----------------------------------------------------------------
-----------------------------------------------------------------
Some tests failed! Rerunning them, since they can be kinda flaky.
-----------------------------------------------------------------
-----------------------------------------------------------------
-----------------------------------------------------------------
EOF
python -m pytest --last-failed --color=yes
fi