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

Linux - Conan prev-prev is allowed to fail #77

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
28 changes: 18 additions & 10 deletions .ci/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sys
import tempfile
import uuid
import re
from collections import OrderedDict
from contextlib import contextmanager
from packaging import version
Expand All @@ -29,7 +30,7 @@ def is_appveyor():

def appveyor_image():
return os.getenv("APPVEYOR_BUILD_WORKER_IMAGE","")


@contextmanager
def chdir(dir_path):
Expand Down Expand Up @@ -93,7 +94,7 @@ def get_build_list():
build = [it for it in files if "build.py" in it]
if not build:
build = [it for it in files if os.path.basename(it) == script]

if build:
builds.append(os.path.join(root, build[0]))
dirs[:] = []
Expand Down Expand Up @@ -182,21 +183,26 @@ def run_scripts(scripts):
with chdir(os.path.dirname(script)):
print_build(script)
build_script = [sys.executable, abspath] if abspath.endswith(".py") else abspath

# Need to initialize the cache with default files if they are not already there
try:
subprocess.call(['conan', 'install', 'foobar/foobar@conan/stable'], env=env,
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except:
pass

with ensure_python_environment_preserved():
with ensure_cache_preserved():
result = subprocess.call(build_script, env=env)

results[script] = result
if result != 0 and FAIL_FAST:
break
process = subprocess.run(build_script, env=env, capture_output=True)

results[script] = process.returncode
if process.returncode != 0:
if re.search(r'Current Conan version \(.*\) does not satisfy the defined one'
, process.stderr.decode()):
results[script] = "skip"
elif FAIL_FAST:
break

return results


Expand All @@ -213,12 +219,14 @@ def print_results(results):
def get_result_message(result):
if result == 0:
return colorama.Fore.GREEN + "SUCCESS" + colorama.Style.RESET_ALL
elif result == "skip":
return colorama.Fore.YELLOW + "SKIP" + colorama.Style.RESET_ALL
return colorama.Fore.RED + "FAILURE" + colorama.Style.RESET_ALL


def validate_results(results):
for value in results.values():
if value != 0:
if value != 0 and value != "skip":
sys.exit(value)


Expand Down
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
include:

- stage: Linux - Conan develop
name: Python 3.5
python: 3.5
name: Python 3.6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subprocess.run is Python 3.5, but it doesn't work here, probably the patch version is incompatible. https://docs.python.org/3.5/library/subprocess.html#subprocess.run

python: 3.6
env: TOXENV=py35-conandev
dist: xenial
- name: Python 3.8
Expand All @@ -18,8 +18,8 @@ jobs:

# All Linux first, check versions
- stage: Linux - Conan Current
name: Python 3.5
python: 3.5
name: Python 3.6
python: 3.6
env: TOXENV=py35-conancurrent
dist: xenial
- name: Python 3.8
Expand All @@ -28,8 +28,8 @@ jobs:
dist: xenial

- stage: Linux - Conan prev
name: Python 3.5
python: 3.5
name: Python 3.6
python: 3.6
env: TOXENV=py35-conanprev
dist: xenial
- name: Python 3.8
Expand All @@ -38,8 +38,8 @@ jobs:
dist: xenial

- stage: Linux - Conan prev-prev
name: Python 3.5
python: 3.5
name: Python 3.6
python: 3.6
env: TOXENV=py35-conanprevprev
dist: xenial
- name: Python 3.8
Expand All @@ -54,7 +54,7 @@ jobs:
os: osx
osx_image: xcode10
env: PYVER=py38 TOXENV=py38-conandev
- name: Conan Current - Python 3.5
- name: Conan Current - Python 3.6
language: generic
os: osx
osx_image: xcode10
Expand All @@ -67,7 +67,7 @@ jobs:

before_install:
- ./.ci/travis/before_install.sh

install:
- |
if [[ "$(uname -s)" == 'Darwin' ]]; then
Expand Down