ONSdigital / dp-mongodb-in-memory

Runs an in-memory MongoDB instance for Go unit tests
MIT License
15 stars 13 forks source link

Support Manjaro (Arch Linux Distribution) #14

Closed PauloPortugal closed 2 years ago

PauloPortugal commented 2 years ago

What

memongo, dp-mongo-in-memory and MongoDB do not support Arch/Manjaro distribution, so this is an attempt to support a Manjaro distribution.

This avoids having to download the MongoDBSpec and assumes the user has a working mongod daemon working on the expected CachedPath. It makes use of the XDG_CACHE_HOME environment variable.

How to review

Run locally, namely Ubuntu and Mac OS'.

Who can review

@rafahop & @saminahbab you are probably the best folks to review this :)

PauloPortugal commented 2 years ago

I believe we could easily achieve that by just adding the manjaro case to the detectLinuxId function?

@rafahop that was my first option, but the /etc/os-release does not have the VERSION_ID so this will fail

        versionString := strings.Split(osRelease["VERSION_ID"], ".")[0]
    version, versionErr := strconv.Atoi(versionString)
    if versionErr != nil {
        return "", &UnsupportedSystemError{msg: "invalid version number " + versionString}
    }

I would have to create an exception to it.

PauloPortugal commented 2 years ago

No relevant for the main branch, as only two developer use Arch/Manjaro OS. This branch will be kept up to date with main.

FYI @saminahbab