Skip to content

Commit

Permalink
Changes to tox configuration for uploading to codecov (log2timeline#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz authored Jun 8, 2020
1 parent a877f95 commit cb76185
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 65 deletions.
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,36 @@ jobs:
services:
- docker
- name: "Ubuntu Focal (20.04) (Docker) with Python 3.5 (tox)"
env: [TOXENV="py35", UBUNTU_VERSION="20.04"]
env:
- TOXENV="py35"
- UBUNTU_VERSION="20.04"
group: edge
language: python
python: 3.5
services:
- docker
- name: "Ubuntu Focal (20.04) (Docker) with Python 3.6 (tox)"
env: [TOXENV="py36", UBUNTU_VERSION="20.04"]
env:
- TOXENV="py36"
- UBUNTU_VERSION="20.04"
group: edge
language: python
python: 3.6
services:
- docker
- name: "Ubuntu Focal (20.04) (Docker) with Python 3.7 (tox)"
env: [TOXENV="py37", UBUNTU_VERSION="20.04"]
env:
- TOXENV="py37"
- UBUNTU_VERSION="20.04"
group: edge
language: python
python: 3.7
services:
- docker
- name: "Ubuntu Focal (20.04) (Docker) with Python 3.8 (tox)"
env: [TOXENV="py38", UBUNTU_VERSION="20.04"]
env:
- TOXENV="py38,coverage,codecov"
- UBUNTU_VERSION="20.04"
group: edge
language: python
python: 3.8
Expand Down
12 changes: 4 additions & 8 deletions config/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ then
docker run --name=${CONTAINER_NAME} --detach -i ubuntu:${UBUNTU_VERSION};

# Install add-apt-repository and locale-gen.
docker exec ${CONTAINER_NAME} apt-get update -q;
docker exec -e "DEBIAN_FRONTEND=noninteractive" ${CONTAINER_NAME} sh -c "apt-get update -q";
docker exec -e "DEBIAN_FRONTEND=noninteractive" ${CONTAINER_NAME} sh -c "apt-get install -y locales software-properties-common";

# Add additional apt repositories.
Expand All @@ -67,23 +67,19 @@ then
fi
docker exec ${CONTAINER_NAME} add-apt-repository ppa:gift/dev -y;

docker exec ${CONTAINER_NAME} apt-get update -q;
docker exec -e "DEBIAN_FRONTEND=noninteractive" ${CONTAINER_NAME} sh -c "apt-get update -q";

# Set locale to US English and UTF-8.
docker exec ${CONTAINER_NAME} locale-gen en_US.UTF-8;

# Install packages.
if test -n "${TOXENV}";
then
DPKG_PACKAGES="build-essential python${TRAVIS_PYTHON_VERSION} python${TRAVIS_PYTHON_VERSION}-dev tox";
DPKG_PACKAGES="build-essential curl python${TRAVIS_PYTHON_VERSION} python${TRAVIS_PYTHON_VERSION}-dev tox";
else
DPKG_PACKAGES="";

if test "${TARGET}" = "coverage";
then
DPKG_PACKAGES="${DPKG_PACKAGES} curl git";

elif test "${TARGET}" = "jenkins3";
if test "${TARGET}" = "jenkins3";
then
DPKG_PACKAGES="${DPKG_PACKAGES} sudo";

Expand Down
37 changes: 0 additions & 37 deletions config/travis/run_coverage.sh

This file was deleted.

6 changes: 1 addition & 5 deletions config/travis/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ then
CONTAINER_OPTIONS="-e LANG=en_US.UTF-8";

if test -n "${TOXENV}";
then
TEST_COMMAND="tox -e ${TOXENV}";

elif test "${TARGET}" = "coverage";
then
# Also see: https://docs.codecov.io/docs/testing-with-docker
curl -o codecov_env.sh -s https://codecov.io/env;
Expand All @@ -45,7 +41,7 @@ then

CONTAINER_OPTIONS="${CODECOV_ENV} ${CONTAINER_OPTIONS}";

TEST_COMMAND="./config/travis/run_coverage.sh";
TEST_COMMAND="tox -e ${TOXENV}";

elif test "${TARGET}" = "jenkins3";
then
Expand Down
29 changes: 18 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py3
envlist = py3{5,6,7,8},coverage

[testenv]
pip_pre = True
Expand All @@ -8,17 +8,24 @@ setenv =
deps =
-rrequirements.txt
-rtest_requirements.txt
coverage: coverage
commands =
./run_tests.py
py3{5,6,7,8}: ./run_tests.py
coverage: coverage erase
coverage: coverage run --source=dfdatetime --omit="*_test*,*__init__*,*test_lib*" run_tests.py

[testenv:py38]
pip_pre = True
setenv =
PYTHONPATH = {toxinidir}
[testenv:codecov]
skip_install = true
passenv =
CI
TRAVIS_BUILD_ID
TRAVIS_COMMIT
TRAVIS_JOB_ID
TRAVIS_JOB_NUMBER
TRAVIS_PULL_REQUEST
TRAVIS_REPO_SLUG
TRAVIS TRAVIS_BRANCH
deps =
-rrequirements.txt
-rtest_requirements.txt
coverage
codecov
commands =
coverage erase
coverage run --source=dfdatetime --omit="*_test*,*__init__*,*test_lib*" run_tests.py
codecov

0 comments on commit cb76185

Please sign in to comment.