Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run test correctly on Linux AND macOS #37

Merged
merged 8 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 30 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
language: generic

env:
matrix:
- PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
- PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"


# Travis does not offer OSX with arbitrary python versions (like 2.7.13 above)
# So, you cannot simply have the following section in your build matrix:
# os:
# - linux
# - osx
# Instead, you have to include OSX entries into the build matrix manually.
# In particular, this means specifying the environment variables again.

# The following was adapted from here:
# https://docs.travis-ci.com/user/multi-os/
# Set `language: generic` to clear `language: python` from above
# Set `python:` (to empty) to clear it from the travis-ci web interface
# Set `osx_image: xcode7.3` to pin OSX version see here:
# https://docs.travis-ci.com/user/osx-ci-environment/

matrix:
include:
- os: osx
language: generic
python:
osx_image: xcode7.3
env: PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
env:
- PYENV_PYTHON="2.7.14"

- os: osx
language: generic
python:
osx_image: xcode7.3
env: PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"
env:
- PYENV_PYTHON="3.6.1"

- os: linux
language: generic
env:
- PYENV_PYTHON="2.7.14"

- os: linux
language: generic
env:
- PYENV_PYTHON="3.6.1"


install:
- |
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
rm -rf ~/.pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
exec "$SHELL"
fi
- which pyenv
- pyenv install --list
- echo $PYTHON_EXE
- python --version
- pyenv install "$PYENV_PYTHON"
- pyenv global "$PYENV_PYTHON"
- python --version
- ./configure

before_script:
- bin/about-code check --verbose .

script:
- bin/about-code check --verbose .
- "bin/py.test -vvs"


notifications:
irc:
channels:
Expand Down
7 changes: 0 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ environment:
matrix:
- PYTHON_EXE: "C:\\Python27\\python.exe"
- PYTHON_EXE: "C:\\Python27-x64\\python.exe"
- PYTHON_EXE: "C:\\Python34\\python.exe"
- PYTHON_EXE: "C:\\Python34-x64\\python.exe"
- PYTHON_EXE: "C:\\Python35\\python.exe"
- PYTHON_EXE: "C:\\Python35-x64\\python.exe"
- PYTHON_EXE: "C:\\Python36\\python.exe"
- PYTHON_EXE: "C:\\Python36-x64\\python.exe"

Expand All @@ -21,8 +17,5 @@ test_script:
- 'bin\python -c "from __future__ import print_function;import sys;print(sys.getdefaultencoding())"'
- 'bin\py.test -vvs'

on_success:
- "python etc/scripts/irc-notify.py aboutcode [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_green}Succeeded,Details: {build_url},Commit: {commit_url}"

on_failure:
- "python etc/scripts/irc-notify.py aboutcode [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_red}Failed,Details: {build_url},Commit: {commit_url}"
63 changes: 63 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
trigger:
branches:
include: ['pipeline']
tags:
include: ['*']

jobs:
- job: tests
displayName: Run tests
steps:
- script: ./configure
- script: ./bin/py.test -vvs tests/commoncode

jobs:
- job: Tests

strategy:

matrix:
Python_27_Linux:
imageName: 'ubuntu-16.04'
python.version: '2.7'
Python_27_Mac:
imageName: 'macos-10.13'
python.version: '2.7'
Python_27_Win:
imageName: 'vs2017-win2016'
python.version: '2.7'

Python_36_Linux:
imageName: 'ubuntu-16.04'
python.version: '3.6'
Python_36_Mac:
imageName: 'macos-10.13'
python.version: '3.6'
Python_36_Windows:
imageName: 'vs2017-win2016'
python.version: '3.6'

Python_37_Linux:
imageName: 'ubuntu-16.04'
python.version: '3.7'
Python_37_Mac:
imageName: 'macos-10.13'
python.version: '3.7'
Python_37_Windows:
imageName: 'vs2017-win2016'
python.version: '3.7'

pool:
vmImage: $(imageName)

steps:

- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
configure
bin/py.test -vvs
displayName: 'Run tests'