mirror of
https://github.com/nicolabs/nicobot.git
synced 2025-09-05 17:15:36 +02:00
~ using the latest MacOS version to test
- not using dirs_exist_ok with copytree to allow Python < 3.8 (not widely supported)
This commit is contained in:
parent
d3e35d58f4
commit
64f0174cfe
|
@ -8,9 +8,9 @@ python: # this works for Linux but is ignored on macOS or Windows
|
|||
# See https://docs.travis-ci.com/user/languages/python/#running-python-tests-on-multiple-operating-systems
|
||||
jobs:
|
||||
include:
|
||||
- name: "Python 3.7 on macOS"
|
||||
- name: "Python on macOS"
|
||||
os: osx
|
||||
osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4
|
||||
osx_image: xcode12.2 # Latest version at time of writing : see https://docs.travis-ci.com/user/reference/osx#macos-version
|
||||
language: shell # 'language: python' is an error on Travis CI macOS
|
||||
# Build requisites (only some of them)
|
||||
addons:
|
||||
|
@ -27,6 +27,7 @@ addons:
|
|||
- python3-dev
|
||||
- rustc
|
||||
homebrew:
|
||||
# TODO Check this list to see if something is missing : https://docs.travis-ci.com/user/reference/osx#compilers-and-build-toolchain
|
||||
packages: rust
|
||||
install:
|
||||
- pip3 install -r requirements-build.txt -r requirements-runtime.txt
|
||||
|
|
|
@ -58,11 +58,14 @@ class TestOptions(unittest.TestCase):
|
|||
Tests the default configuration tree of the docker image
|
||||
"""
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
with tempfile.TemporaryDirectory() as tmproot:
|
||||
# Creates a subdirectory so that we don't need the 'dirs_exist_ok'
|
||||
# option, which is only available since Python 3.8
|
||||
tmpdir = os.path.join(tmproot,"slash")
|
||||
dir_var_nicobot = os.path.join(tmpdir,'var/nicobot')
|
||||
dir_etc_nicobot = os.path.join(tmpdir,'etc/nicobot')
|
||||
# 1. Reproduces the initial Docker environment
|
||||
shutil.copytree('tests/fixtures/docker_file_tree', tmpdir, dirs_exist_ok=True)
|
||||
shutil.copytree('tests/fixtures/docker_file_tree', tmpdir)
|
||||
config = TransbotConfig()
|
||||
# Mimics the command line parameters in the docker image
|
||||
args = [ '--config-dirs', dir_var_nicobot, dir_etc_nicobot ]
|
||||
|
@ -81,11 +84,14 @@ class TestOptions(unittest.TestCase):
|
|||
Tests a common configuration tree with docker where the user bind-mounts the /var/nicobot directory
|
||||
"""
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
with tempfile.TemporaryDirectory() as tmproot:
|
||||
# Creates a subdirectory so that we don't need the 'dirs_exist_ok'
|
||||
# option, which is only available since Python 3.8
|
||||
tmpdir = os.path.join(tmproot,"slash")
|
||||
dir_var_nicobot = os.path.join(tmpdir,'var/nicobot')
|
||||
dir_etc_nicobot = os.path.join(tmpdir,'etc/nicobot')
|
||||
# 1. Reproduces the initial Docker environment
|
||||
shutil.copytree('tests/fixtures/docker_with_var_mount', tmpdir, dirs_exist_ok=True)
|
||||
shutil.copytree('tests/fixtures/docker_with_var_mount', tmpdir)
|
||||
config = TransbotConfig()
|
||||
# Mimics the command line parameters in the docker image
|
||||
args = [ '--config-dirs', dir_var_nicobot, dir_etc_nicobot ]
|
||||
|
|
Loading…
Reference in a new issue