Guest User

Untitled

a guest
Apr 18th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. image: docker:latest
  2. services:
  3. - docker:dind
  4.  
  5. variables:
  6. DOCKER_DRIVER: overlay
  7. M2_REPO: .m2/repository
  8.  
  9. stages:
  10. - test
  11.  
  12. test:
  13. image: maven:3-jdk-8
  14. stage: test
  15. tags:
  16. - docker
  17. script: |
  18. mvn verify test
  19. artifacts:
  20. paths:
  21. - core.*
  22. - hs_err_pid*.log
  23.  
  24. import org.junit.Rule;
  25. import org.junit.Test;
  26. import org.testcontainers.containers.PostgreSQLContainer;
  27. import static org.junit.Assert.assertNotNull;
  28. public class TestContainerExampleTest {
  29. @Rule
  30. public PostgreSQLContainer postgres = new PostgreSQLContainer();
  31. @Test
  32. public void test() {assertNotNull(postgres.getJdbcUrl());}
  33. }
  34.  
  35. Apr 18, 2018 6:05:21 AM org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy test
  36. ERROR: ping failed with configuration Environment variables, system properties and defaults. Resolved:
  37. dockerHost=unix:///var/run/docker.sock
  38. apiVersion='{UNKNOWN_VERSION}'
  39. registryUrl='https://index.docker.io/v1/'
  40. registryUsername='root'
  41. registryPassword='null'
  42. registryEmail='null'
  43. dockerConfig='DefaultDockerClientConfig[dockerHost=unix:///var/run/docker.sock,registryUsername=root,registryPassword=<null>,registryEmail=<null>,registryUrl=https://index.docker.io/v1/,dockerConfig=/root/.docker,sslConfig=<null>,apiVersion={UNKNOWN_VERSION}]'
  44. due to org.rnorth.ducttape.TimeoutException: Timeout waiting for result with exception
  45. org.rnorth.ducttape.TimeoutException: Timeout waiting for result with exception
  46. at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:51)
  47. <blablabla...>
  48. at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
  49. Caused by: org.testcontainers.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: connect(..) failed: No such file or directory: /var/run/docker.sock
  50. at org.testcontainers.shaded.io.netty.channel.unix.Errors.throwConnectException(Errors.java:107)
  51. <blablabla...>
  52. at java.lang.Thread.run(Thread.java:748)
  53. Caused by: java.net.ConnectException: connect(..) failed: No such file or directory
  54. ... 23 more
  55.  
  56. Apr 18, 2018 6:05:21 AM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$2
  57. ERROR: Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
  58. Apr 18, 2018 6:05:21 AM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$2
  59. ERROR: EnvironmentAndSystemPropertyClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed)
  60. Apr 18, 2018 6:05:21 AM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$2
  61. ERROR: UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (ping failed). Root cause NoSuchFileException (/var/run/docker.sock)
  62. Apr 18, 2018 6:05:21 AM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$2
  63. ERROR: As no valid configuration was found, execution cannot continue
  64. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.693 sec <<< FAILURE!
  65. test(ru.bcs.userstorage.online.integration.provider.TestContainerExampleTest) Time elapsed: 0.005 sec <<< ERROR!
  66. java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
  67. at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$2(DockerClientProviderStrategy.java:146)
  68. <blablabla...>
  69.  
  70. Results :
  71.  
  72. Tests in error:
  73. test(ru.bcs.userstorage.online.integration.provider.TestContainerExampleTest): Could not find a valid Docker environment. Please see logs and check configuration
  74.  
  75. Tests run: 52, Failures: 0, Errors: 1, Skipped: 4
Add Comment
Please, Sign In to add comment