Skip to content
Open

osx #12

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
3e609f4
Create .appveyor.yml
pierreluctg Jan 8, 2019
865c41b
Merge pull request #1 from pierreluctg/suite-writer-on-windows
pierreluctg Jan 8, 2019
fc584a4
Update .appveyor.yml
pierreluctg Jan 8, 2019
03cde42
Set up CI with Azure Pipelines
azure-pipelines[bot] Jan 8, 2019
6b155df
Update azure-pipelines.yml for Azure Pipelines
azure-pipelines[bot] Jan 8, 2019
d5d1a76
Update azure-pipelines.yml for Azure Pipelines
azure-pipelines[bot] Jan 8, 2019
27a6a4b
Update azure-pipelines.yml for Azure Pipelines
azure-pipelines[bot] Jan 8, 2019
42c9d78
Update azure-pipelines.yml for Azure Pipelines
azure-pipelines[bot] Jan 8, 2019
e659cbd
Update azure-pipelines.yml for Azure Pipelines
azure-pipelines[bot] Jan 8, 2019
981643a
Merge pull request #2 from getslash/develop
pierreluctg Jan 9, 2019
d5216a2
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
3329fbb
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
f6010bc
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
ddfc3b4
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
29ee850
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
2319060
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
67711d4
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
d8a53e4
Update local_config.py
pierreluctg Jan 9, 2019
0aef962
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
dfb0abf
Update local_config.py
pierreluctg Jan 9, 2019
15786b5
Update local_config.py
pierreluctg Jan 9, 2019
530469b
Merge pull request #4 from pierreluctg/path
pierreluctg Jan 9, 2019
65a9051
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
a230cbc
skipping some test on windows
pierreluctg Jan 9, 2019
14c8dfb
Merge pull request #3 from pierreluctg/pierreluctg-patch-1
pierreluctg Jan 9, 2019
5d1b167
Update test_logging.py
pierreluctg Jan 9, 2019
2273377
Update conftest.py
pierreluctg Jan 9, 2019
f835f40
Update conftest.py
pierreluctg Jan 9, 2019
c159824
Update test_parallel.py
pierreluctg Jan 9, 2019
6b8127c
Delete .appveyor.yml
pierreluctg Jan 9, 2019
0e47650
Update azure-pipelines.yml
pierreluctg Jan 9, 2019
8aad161
Update test_parallel.py
pierreluctg Jan 9, 2019
2ce0fe6
Update __init__.py
pierreluctg Jan 10, 2019
a14a1db
Merge pull request #6 from pierreluctg/patch-2
pierreluctg Jan 10, 2019
3f362ef
Merge pull request #7 from pierreluctg/patch-2
pierreluctg Jan 10, 2019
781c4a8
Merge branch 'develop' into windows
pierreluctg Jan 10, 2019
6ab298c
Update azure-pipelines.yml
pierreluctg Jan 10, 2019
2db3f61
Update azure-pipelines.yml
pierreluctg Jan 10, 2019
f9a162f
Update azure-pipelines.yml
pierreluctg Jan 10, 2019
0758981
Update azure-pipelines.yml
pierreluctg Jan 10, 2019
0c14685
Update azure-pipelines.yml
pierreluctg Jan 10, 2019
12e9ce4
Update test_suite_files.py
pierreluctg Jan 10, 2019
cce4fb7
Update test_suite_files.py
pierreluctg Jan 10, 2019
b4145a7
Merge branch 'develop' into windows
pierreluctg Jan 10, 2019
917a087
Update test_test_loading.py
pierreluctg Jan 10, 2019
ae8ab01
Update test_warnings.py
pierreluctg Jan 10, 2019
52275f9
Delete .appveyor.yml
pierreluctg Jan 10, 2019
4c2fbdd
Update azure-pipelines.yml
pierreluctg Jan 10, 2019
db58670
Update azure-pipelines.yml
pierreluctg Jan 10, 2019
4dd3948
Merge pull request #5 from pierreluctg/windows
pierreluctg Jan 10, 2019
4fb9b58
Update test_logging.py
pierreluctg Jan 10, 2019
4206a1a
Update test_logging.py
pierreluctg Jan 10, 2019
f7c0592
Merge pull request #8 from pierreluctg/re-enabling-tests
pierreluctg Jan 10, 2019
0142971
osx
pierreluctg Jan 11, 2019
7627e43
Update .travis.yml
pierreluctg Jan 11, 2019
1b0a845
Adding Windows to Travis matrix
pierreluctg Jan 11, 2019
c682703
Merge branch 'develop' into osx
pierreluctg Jan 11, 2019
96f535f
Update .travis.yml
pierreluctg Jan 11, 2019
24eea04
Update .travis.yml
pierreluctg Jan 22, 2019
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
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,38 @@ matrix:
include:
- python: "3.6"
env: TRAVIS_PYLINT=true
- os : osx
language: generic
python: 3.7
env: PYTHON=3.7
- os: windows
language: sh
python: 3.7
before_install:
- choco install python3
- export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
- python -m pip install --upgrade pip wheel
script:
- python -m virtualenv .env
- .env/Scripts/pip.exe install -e .[testing,doc]
- .env/Scripts/py.test.exe --cov=slash --cov-report=html tests
allow_failures:
- os: windows

# command to run tests, e.g. python setup.py test
before_install: |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update
brew install openssl readline
brew outdated pyenv || brew upgrade pyenv
brew install pyenv-virtualenv
pyenv install $PYTHON
export PYENV_VERSION=$PYTHON
export PATH="/Users/travis/.pyenv/shims:${PATH}"
pyenv-virtualenv venv
source venv/bin/activate
python --version
fi
install:
- pip install virtualenv
- pip install codecov
Expand Down
49 changes: 49 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

trigger:
- master

jobs:

- job: 'Test'
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
maxParallel: 4

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

- script: |
python -m pip install --upgrade pip && pip install .[testing,doc]
displayName: 'Install dependencies'

- script: |
mkdir d:\temp && py.test tests --cov=slash --cov-report=html --cov-report=xml --junitxml=junit/test-results.xml
displayName: 'pytest'
env: {TMPDIR: 'd:\temp\'}

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
8 changes: 5 additions & 3 deletions tests/test_logging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=unused-argument,redefined-outer-name
import functools
import os
import sys

import logbook
import brotli
Expand Down Expand Up @@ -45,7 +46,7 @@ def test_with_log_error():
assert [res.message for res in result.get_errors()] == expected_error_messages
assert [rec.message for rec in test_handler.records] == [message, non_capture_message]


@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows")
def test_last_session_symlinks(files_dir, links_dir, session):

test_log_file = files_dir.join(
Expand Down Expand Up @@ -154,7 +155,7 @@ def test_log_symlinks_without_root_path(suite, config_override, symlink_name):
config_override('log.{}'.format(symlink_name), 'some/subdir')
assert suite.run().ok()


@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows")
def test_last_test_not_overriden_by_stop_on_error(links_dir, suite):
failed_test = suite[4]
failed_test.when_run.fail()
Expand Down Expand Up @@ -192,7 +193,7 @@ def test_result_log_links(files_dir, session):
assert result.get_log_path() is not None
assert result.get_log_path().startswith(str(files_dir))


@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows")
def test_last_failed(suite, links_dir):
suite[-5].when_run.fail()
last_failed = suite[-2]
Expand All @@ -216,6 +217,7 @@ def test_errors_log_for_test(suite, suite_test, errors_log_path, logs_dir):
lines = f.read().splitlines()
assert error_line in lines

@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows")
@pytest.mark.parametrize('should_keep_failed_tests', [True, False])
def test_logs_deletion(suite, suite_test, errors_log_path, logs_dir, config_override, should_keep_failed_tests):
config_override('log.cleanup.enabled', True)
Expand Down
5 changes: 5 additions & 0 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import slash
import os
import signal
import sys

from .utils.suite_writer import Suite
from slash.resuming import get_tests_from_previous_session
from slash.exceptions import InteractiveParallelNotAllowed, ParallelTimeout
Expand All @@ -12,6 +14,9 @@
import tempfile
import pytest

if sys.platform.startswith("win"):
pytest.skip("does not run on windows", allow_module_level=True)

@pytest.fixture(scope='module', autouse=True)
def no_parallel_user_config(request):
tmpdir = tempfile.mkdtemp()
Expand Down
3 changes: 1 addition & 2 deletions tests/test_suite_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def test_iter_suite_paths_files_relpath(filename, paths):
f.write(relpath)
f.write('\n')

assert [p for p, _ in suite_files.iter_suite_file_paths([filename])] == [os.path.abspath(p) for p in paths]

assert [os.path.normcase(p) for p, _ in suite_files.iter_suite_file_paths([filename])] == [os.path.normcase(os.path.abspath(p)) for p in paths]

def test_suite_files(suite, suite_test, suite_file): # pylint: disable=unused-argument
suite.run(args=[])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_test_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_dir(tmpdir, names, indices):

@pytest.fixture
def names():
return ['a/test_a_b.py', 'a/test_b_a.py', 'b/test_a_a.py', 'b/test_a_b.py']
return [os.path.normpath(p) for p in ['a/test_a_b.py', 'a/test_b_a.py', 'b/test_a_a.py', 'b/test_a_b.py']]

def _sorted_by_indices(items, indices):
returned = [None for _ in items]
Expand Down
3 changes: 2 additions & 1 deletion tests/test_warnings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pylint: disable=unused-variable,redefined-outer-name
import os
import collections
import warnings
from contextlib import contextmanager
Expand Down Expand Up @@ -44,7 +45,7 @@ def warning_added(warning):
assert isinstance(w.filename, str)
assert w.lineno
assert w.filename
assert w.filename.rsplit('/', 1)[-1] == suite_test.file.get_relative_path()
assert w.filename.rsplit(os.path.sep, 1)[-1] == suite_test.file.get_relative_path()
warning_type = w.details['type']
assert isinstance(warning_type, str)
assert warning_type == 'LogbookWarning'
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def override_config(self, path, value):

def get_new_path(self):
returned = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, returned)
self.addCleanup(shutil.rmtree, returned, ignore_errors=True)
return returned

_forge = None
Expand Down