File 0001-Update-versions-of-test-dependencies.patch of Package borgmatic
From ea6cd53067435365a96786b006aec391714501c4 Mon Sep 17 00:00:00 2001
From: Dan Helfman <witten@torsion.org>
Date: Sun, 22 Nov 2020 14:48:07 -0800
Subject: [PATCH] Update versions of test dependencies (test_requirements.txt
and test containers).
---
NEWS | 3 ++
docs/Dockerfile | 6 ++--
scripts/run-full-tests | 6 ++--
setup.py | 2 +-
test_requirements.txt | 43 ++++++++++++++-------------
tests/end-to-end/docker-compose.yaml | 4 +--
tests/unit/commands/test_borgmatic.py | 4 ++-
tests/unit/hooks/test_healthchecks.py | 14 +++++----
tox.ini | 4 +--
9 files changed, 49 insertions(+), 37 deletions(-)
#diff --git a/NEWS b/NEWS
#index 38d4d82..6f2227b 100644
#--- a/NEWS
#+++ b/NEWS
#@@ -1,3 +1,6 @@
#+1.5.13.dev0
#+ * Update versions of test dependencies (test_requirements.txt and test containers).
#+
# 1.5.12
# * Fix for previous release with incorrect version suffix in setup.py. No other changes.
#
#diff --git a/docs/Dockerfile b/docs/Dockerfile
#index 56857ed..d407fcc 100644
#--- a/docs/Dockerfile
#+++ b/docs/Dockerfile
#@@ -1,4 +1,4 @@
#-FROM python:3.8.1-alpine3.11 as borgmatic
#+FROM python:3.8-alpine3.12 as borgmatic
#
# COPY . /app
# RUN pip install --no-cache /app && generate-borgmatic-config && chmod +r /etc/borgmatic/config.yaml
#@@ -7,7 +7,7 @@ RUN borgmatic --help > /command-line.txt \
# echo -e "\n--------------------------------------------------------------------------------\n" >> /command-line.txt \
# && borgmatic "$action" --help >> /command-line.txt; done
#
#-FROM node:13.7.0-alpine as html
#+FROM node:15.2.1-alpine as html
#
# ARG ENVIRONMENT=production
#
#@@ -26,7 +26,7 @@ COPY . /source
# RUN NODE_ENV=${ENVIRONMENT} npx eleventy --input=/source/docs --output=/output/docs \
# && mv /output/docs/index.html /output/index.html
#
#-FROM nginx:1.16.1-alpine
#+FROM nginx:1.19.4-alpine
#
# COPY --from=html /output /usr/share/nginx/html
# COPY --from=borgmatic /etc/borgmatic/config.yaml /usr/share/nginx/html/docs/reference/config.yaml
#diff --git a/scripts/run-full-tests b/scripts/run-full-tests
#index bfde13e..0f374cf 100755
#--- a/scripts/run-full-tests
#+++ b/scripts/run-full-tests
#@@ -10,9 +10,9 @@
#
# set -e
#
#-python -m pip install --upgrade pip==20.0.2
#-pip install tox==3.14.3
#+python -m pip install --upgrade pip==20.2.4
#+pip install tox==3.20.1
# export COVERAGE_FILE=/tmp/.coverage
#+apk add --no-cache borgbackup postgresql-client mariadb-client py3-typed-ast
# tox --workdir /tmp/.tox
#-apk add --no-cache borgbackup postgresql-client mariadb-client
# tox --workdir /tmp/.tox -e end-to-end
#diff --git a/setup.py b/setup.py
#index c2ba568..56fa523 100644
#--- a/setup.py
#+++ b/setup.py
#@@ -1,6 +1,6 @@
# from setuptools import find_packages, setup
#
#-VERSION = '1.5.12'
#+VERSION = '1.5.13.dev0'
#
#
# setup(
#diff --git a/test_requirements.txt b/test_requirements.txt
#index 4b18270..0a69060 100644
#--- a/test_requirements.txt
#+++ b/test_requirements.txt
#@@ -1,25 +1,28 @@
#-appdirs==1.4.3
#-atomicwrites==1.3.0
#-attrs==19.3.0
#-black==19.3b0; python_version >= '3.6'
#-click==7.0
#-colorama==0.4.1
#-coverage==4.5.4
#+appdirs==1.4.4
#+atomicwrites==1.4.0
#+attrs==20.3.0
#+black==19.10b0; python_version >= '3.6'
#+click==7.1.2
#+colorama==0.4.4
#+coverage==5.3
# docopt==0.6.2
#-flake8==3.7.9
#+flake8==3.8.4
# flexmock==0.10.4
#-isort==4.3.21
#+isort==5.6.4
# mccabe==0.6.1
#-more-itertools==7.2.0
#-pluggy==0.13.0
#-py==1.8.0
#-pycodestyle==2.5.0
#-pyflakes==2.1.1
#+more-itertools==8.6.0
#+pluggy==0.13.1
#+pathspec==0.8.1
#+py==1.9.0
#+pycodestyle==2.6.0
#+pyflakes==2.2.0
# pykwalify==1.7.0
#-pytest==5.2.2
#-pytest-cov==2.8.1
#-python-dateutil==2.8.0
#-PyYAML==5.1.2
#-requests==2.22.0
#+pytest==6.1.2
#+pytest-cov==2.10.1
#+python-dateutil==2.8.1
#+PyYAML==5.3.1
#+regex==2020.11.13
#+requests==2.25.0
# ruamel.yaml>0.15.0,<0.17.0
#-toml==0.10.0
#+toml==0.10.2
#+typed-ast==1.4.1
#diff --git a/tests/end-to-end/docker-compose.yaml b/tests/end-to-end/docker-compose.yaml
#index 3830f55..65d4a22 100644
#--- a/tests/end-to-end/docker-compose.yaml
#+++ b/tests/end-to-end/docker-compose.yaml
#@@ -1,7 +1,7 @@
# version: '3'
# services:
# postgresql:
#- image: postgres:12.2-alpine
#+ image: postgres:13.1-alpine
# environment:
# POSTGRES_PASSWORD: test
# POSTGRES_DB: test
#@@ -11,7 +11,7 @@ services:
# MYSQL_ROOT_PASSWORD: test
# MYSQL_DATABASE: test
# tests:
#- image: python:3.8-alpine3.11
#+ image: python:3.8-alpine3.12
# volumes:
# - "../..:/app:ro"
# tmpfs:
diff --git a/tests/unit/commands/test_borgmatic.py b/tests/unit/commands/test_borgmatic.py
index e9453d2..95947f6 100644
--- a/tests/unit/commands/test_borgmatic.py
+++ b/tests/unit/commands/test_borgmatic.py
@@ -447,7 +447,9 @@ def test_collect_configuration_run_summary_logs_outputs_merged_json_results():
flexmock(module).should_receive('run_configuration').and_return(['foo', 'bar']).and_return(
['baz']
)
- flexmock(module.sys.stdout).should_receive('write').with_args('["foo", "bar", "baz"]').once()
+ stdout = flexmock()
+ stdout.should_receive('write').with_args('["foo", "bar", "baz"]').once()
+ flexmock(module.sys).stdout = stdout
arguments = {}
tuple(
diff --git a/tests/unit/hooks/test_healthchecks.py b/tests/unit/hooks/test_healthchecks.py
index 7f90438..59e86d5 100644
--- a/tests/unit/hooks/test_healthchecks.py
+++ b/tests/unit/hooks/test_healthchecks.py
@@ -28,7 +28,9 @@ def test_forgetful_buffering_handler_emit_forgets_log_records_when_capacity_reac
def test_format_buffered_logs_for_payload_flattens_log_buffer():
handler = module.Forgetful_buffering_handler(byte_capacity=100, log_level=1)
handler.buffer = ['foo\n', 'bar\n']
- flexmock(module.logging).should_receive('getLogger').and_return(flexmock(handlers=[handler]))
+ logger = flexmock(handlers=[handler])
+ logger.should_receive('removeHandler')
+ flexmock(module.logging).should_receive('getLogger').and_return(logger)
payload = module.format_buffered_logs_for_payload()
@@ -39,7 +41,9 @@ def test_format_buffered_logs_for_payload_inserts_truncation_indicator_when_logs
handler = module.Forgetful_buffering_handler(byte_capacity=100, log_level=1)
handler.buffer = ['foo\n', 'bar\n']
handler.forgot = True
- flexmock(module.logging).should_receive('getLogger').and_return(flexmock(handlers=[handler]))
+ logger = flexmock(handlers=[handler])
+ logger.should_receive('removeHandler')
+ flexmock(module.logging).should_receive('getLogger').and_return(logger)
payload = module.format_buffered_logs_for_payload()
@@ -47,9 +51,9 @@ def test_format_buffered_logs_for_payload_inserts_truncation_indicator_when_logs
def test_format_buffered_logs_for_payload_without_handler_produces_empty_payload():
- flexmock(module.logging).should_receive('getLogger').and_return(
- flexmock(handlers=[module.logging.Handler()])
- )
+ logger = flexmock(handlers=[module.logging.Handler()])
+ logger.should_receive('removeHandler')
+ flexmock(module.logging).should_receive('getLogger').and_return(logger)
payload = module.format_buffered_logs_for_payload()
diff --git a/tox.ini b/tox.ini
index b6b0537..1d177b8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,7 @@ passenv = COVERAGE_FILE
commands =
pytest {posargs}
py36,py37,py38: black --check .
- isort --recursive --check-only --settings-path setup.cfg .
+ isort --check-only --settings-path setup.cfg .
flake8 borgmatic tests
[testenv:black]
@@ -34,4 +34,4 @@ commands =
[testenv:isort]
deps = {[testenv]deps}
commands =
- isort {posargs:--recursive} --settings-path setup.cfg .
+ isort --settings-path setup.cfg .