pharo
pharo copied to clipboard
Review UUID (variants)
UUID class according to comment follows RFC4122
But UUID is not UUID: basically there are 8 variants ("UUIDv1" to "UUIDv8") available in general and a new RFC9562 that obsoletes RFC4122
https://datatracker.ietf.org/doc/rfc9562/
Using a different UUID variant can have a performance impact (for instance when using as a key on databases like PostgreSQL, see https://x.com/maciejwalkowiak/status/1809164757959938376)
Current implementation should be reviewed regarding support for variants
It expects /run/user/1000/pytest directory to either exist or be creatable (so that files, like that socket, can be created in that directory).
That directory is the "user runtime directory" returned by platformdirs.user_runtime_dir.
https://platformdirs.readthedocs.io/en/latest/api.html#platformdirs.unix.Unix.user_runtime_dir
I'm having the same test failures, but I checked that the directory exists and is fully owned by my user with 700 rwx access.
My error is on missing "borg" cmd as this is the first install/build on my machine. But that also indicates that the test itself is not being properly applied to the tested artifact, and will instead use the first "borg" command in PATH (as far as I know), therefore it will (usually) test the installed version of Borg.
============================================================================================================================================================ ERRORS ============================================================================================================================================================
______________________________________________________________________________________________________________________________________________ ERROR at setup of test_with_socket ______________________________________________________________________________________________________________________________________________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6f57e6bcb0>
@pytest.fixture
def serve_socket(monkeypatch):
have_a_short_runtime_dir(monkeypatch)
# use a random unique socket filename, so tests can run in parallel.
socket_file = tempfile.mktemp(suffix=".sock", prefix="borg-", dir=get_runtime_dir())
> with subprocess.Popen(["borg", "serve", f"--socket={socket_file}"]) as p:
borg/testsuite/archiver/serve_cmd_test.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.13/subprocess.py:1038: in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
...
...
...
E FileNotFoundError: [Errno 2] No such file or directory: 'borg'
/usr/lib/python3.13/subprocess.py:1974: FileNotFoundError
@maricn The tests assume that the to-be-tested borg is installed. Usually tox creates a virtual env and installs borg into that and then runs the tests within that venv.