Fix end-to-end tests.
All checks were successful
build / test (push) Successful in 7m20s
build / docs (push) Successful in 1m52s

This commit is contained in:
Dan Helfman 2026-03-30 12:37:42 -07:00
commit 87bfd6e97f
6 changed files with 8 additions and 5 deletions

View file

@ -116,7 +116,7 @@ def convert_value_type(value, option_type):
raise ValueError(f'Argument value "{value}" is invalid: {error.problem}')
if not isinstance(parsed_value, borgmatic.config.schema.parse_type(option_type)):
raise ValueError(f'Argument value "{value}" is not of the expected type: {option_type}') # noqa: TRY004
raise ValueError(f'Argument value "{value}" is not of the expected type: {option_type}')
return parsed_value

View file

@ -84,7 +84,7 @@ def raise_retain_node_error(loader, node):
Also raise ValueError if a scalar node is given, as "!retain" is not supported on scalar nodes.
'''
if isinstance(node, (ruamel.yaml.nodes.MappingNode, ruamel.yaml.nodes.SequenceNode)):
raise ValueError( # noqa: TRY004
raise ValueError(
'The !retain tag may only be used within a configuration file containing a merged !include tag.',
)

View file

@ -44,7 +44,7 @@ namespaces = false
[tool.pytest.ini_options]
testpaths = "tests"
addopts = "--cov-report term-missing:skip-covered --cov=borgmatic --no-cov-on-fail --cov-fail-under=100 --ignore=tests/end-to-end"
addopts = "--cov-report term-missing:skip-covered --cov=borgmatic --no-cov-on-fail --cov-fail-under=100 --ignore=tests/end-to-end --timeout=60"
[tool.ruff]
line-length = 100
@ -100,6 +100,7 @@ ignore = [
"S404", # subprocess import
"SIM115", # open() without context manager
"SIM905", # split() on literal string
"TRY004", # type check and raise something other than TypeError
]
[tool.ruff.lint.flake8-quotes]

View file

@ -17,6 +17,7 @@ pluggy==1.6.0
pygments==2.20.0
pytest==9.0.2
pytest-cov==7.1.0
pytest-timeout==2.4.0
pyyaml>5.0.0
referencing==0.37.0
requests==2.33.1

View file

@ -44,7 +44,7 @@ services:
MONGO_INITDB_ROOT_PASSWORD: test2
command: docker-entrypoint.sh --port=27018
tests:
image: docker.io/alpine:3.22
image: docker.io/alpine:3.23
environment:
TEST_CONTAINER: true
volumes:

View file

@ -69,6 +69,7 @@ class Background_web_server:
self.thread.join()
FINISH = 1
START_AND_FINISH = 2
START_LOG_AND_FINISH = 3
@ -94,7 +95,7 @@ START_LOG_AND_FINISH = 3
),
(
'loki:\n url: http://localhost:12345/loki/api/v1/push\n labels:\n app: borgmatic\n send_logs: true',
START_AND_FINISH,
FINISH,
),
(
'loki:\n url: http://localhost:12345/loki/api/v1/push\n labels:\n app: borgmatic',