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

Fix failing test on OpenBSD #7719

Merged
merged 1 commit into from
Jul 8, 2023
Merged

Conversation

bket
Copy link
Contributor

@bket bket commented Jul 7, 2023

A borgbackup-2.0.0b6 test fails on OpenBSD with the message below.

=================================== FAILURES ===================================
_____________________________ test_get_runtime_dir _____________________________

path = '/run/user/55/borg', mode = 511, pretty_deadly = True

    def ensure_dir(path, mode=stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO, pretty_deadly=True):
        """
        Ensures that the dir exists with the right permissions.
        1) Make sure the directory exists in a race-free operation
        2) If mode is not None and the directory has been created, give the right
        permissions to the leaf directory. The current umask value is masked out first.
        3) If pretty_deadly is True, catch exceptions, reraise them with a pretty
        message.
        Returns if the directory has been created and has the right permissions,
        An exception otherwise. If a deadly exception happened it is reraised.
        """
        try:
>           os.makedirs(path, mode=mode, exist_ok=True)

build/lib.openbsd-7.3-amd64-cpython-310/borg/helpers/fs.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

If $XDG_RUNTIME_DIR is not set platformdirs.user_runtime_dir() returns one of 3 different paths
(tox-dev/platformdirs#201). Proposed fix is to check if get_runtime_dir() returns one of these paths.

Supersedes #7652.

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2023

Codecov Report

Merging #7719 (1074089) into master (616d5e7) will decrease coverage by 0.12%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #7719      +/-   ##
==========================================
- Coverage   83.86%   83.75%   -0.12%     
==========================================
  Files          66       66              
  Lines       11864    11900      +36     
  Branches     2149     2155       +6     
==========================================
+ Hits         9950     9967      +17     
- Misses       1345     1360      +15     
- Partials      569      573       +4     

see 8 files with indirect coverage changes

A borgbackup-2.0.0b6 test fails on OpenBSD with the message below.

```
=================================== FAILURES ===================================
_____________________________ test_get_runtime_dir _____________________________

path = '/run/user/55/borg', mode = 511, pretty_deadly = True

    def ensure_dir(path, mode=stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO, pretty_deadly=True):
        """
        Ensures that the dir exists with the right permissions.
        1) Make sure the directory exists in a race-free operation
        2) If mode is not None and the directory has been created, give the right
        permissions to the leaf directory. The current umask value is masked out first.
        3) If pretty_deadly is True, catch exceptions, reraise them with a pretty
        message.
        Returns if the directory has been created and has the right permissions,
        An exception otherwise. If a deadly exception happened it is reraised.
        """
        try:
>           os.makedirs(path, mode=mode, exist_ok=True)

build/lib.openbsd-7.3-amd64-cpython-310/borg/helpers/fs.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
```

If `$XDG_RUNTIME_DIR` is not set `platformdirs.user_runtime_dir()`
returns one of 3 different paths
(tox-dev/platformdirs#201). Proposed fix is
to check if `get_runtime_dir()` returns one of these paths.
@ThomasWaldmann ThomasWaldmann merged commit 4dfce1c into borgbackup:master Jul 8, 2023
11 checks passed
@ThomasWaldmann
Copy link
Member

Thanks!

@bket bket deleted the fix_test branch July 8, 2023 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants