Run vitest using bun runtime

Summary

Use the bun runtime to run vitest commands.

Additionally, we MIGHT remove the nodejs binary setup from the Dockerfile: https://gitlab.com/ss-open/websites/personal/-/blob/98947c7bf3a8405462ba55726617eb61d1413b8f/Dockerfile#L2-5

An another solution COULD be to move to bun:test, however, we will lose the "out of the box" configuration of vite and will have to tricks the configuration to make bun:test understanding the vite ecosystem.

Additional context

Currently not working. See the following discussion for details:

  • @soullivaneuh started a discussion: (+3 comments)

    BUG: The test CI job is looping indefinitely

    Ref: https://gitlab.com/ss-open/websites/personal/-/jobs/5861252343

    The problem can be reproduced on local:

    export COMPOSE_FILE=docker-compose.yml:docker-compose.ci.yml
    podman compose build
    podman compose run test

    Output:

    $ vitest run --coverage
    
     RUN  v1.1.0 /app
          Coverage enabled with istanbul
    
    [bun] Warning: worker_threads.Worker option "argv" is not implemented.
    [bun] Warning: worker_threads.Worker option "execArgv" is not implemented.
    [bun] Warning: worker_threads.Worker option "resourceLimits" is not implemented.
    ...

    It MAY be related to the threads usage of vitest that looks to not work out of the box with Docker. To be investigated.

    Ref: https://vitest.dev/guide/features#threads

Edited Jan 11, 2024 by Sullivan S.
Assignee Loading
Time tracking Loading