pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Review UUID (variants)

Open astares opened this issue 1 year ago • 3 comments

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

astares avatar Jul 05 '24 12:07 astares

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

ThomasWaldmann avatar Jul 31 '24 11:07 ThomasWaldmann

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 avatar Mar 09 '25 13:03 maricn

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

ThomasWaldmann avatar Mar 10 '25 10:03 ThomasWaldmann