Does OneDev support testcontainers in unit test? (OD-2349)
alion opened 9 months ago

I am working on something related to HikariCP. When using OneDev, I encounter an error every time I execute a build. The error message is:

 ERROR] Errors: 
11:54:55 [ERROR]   PostgresTest.beforeTest:51 » IllegalState Could not find a valid Docker environment. Please see logs and check configuration
11:54:55 [ERROR]   PostgresTest.beforeTest:51 » IllegalState Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration
11:54:55 [ERROR]   PostgresTest.beforeTest:51 » IllegalState Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration
11:54:55 [ERROR]   PostgresTest.beforeTest:51 » IllegalState Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration
11:54:55 [ERROR]   PostgresTest.beforeTest:51 » IllegalState Previous attempts to find a Docker environment failed. Will not 

It turns out that HikariCP’s PostgresTest uses Testcontainers to start a container. However, for some reason, OneDev seems unable to start the container.

I created a simulated environment to reproduce the error: build tixo/HikariCP#1

  • Robin Shen commented 9 months ago

    Edit relevant job executor to enable the "mount dock sock" option. By default this option is disabled for security reason.

  • Robin Shen changed state to 'Closed' 9 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2349
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover