~ 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:
nicobo 2021-02-08 22:29:03 +01:00
parent d3e35d58f4
commit 64f0174cfe
No known key found for this signature in database
GPG key ID: 2581E71C5FA5285F
2 changed files with 13 additions and 6 deletions

View file

@ -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

View file

@ -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 ]