dgroup / docker-unittests

Testing of base docker images during CI/CD process
MIT License
35 stars 4 forks source link

NotModifiedException for simple test #242

Closed g4s8 closed 5 years ago

g4s8 commented 5 years ago

I tried to run docker-unittests against simple tests file:

version: 1.1
setup:
    - "apk --update --no-cache add curl"
tests:
    - assume: curl version is 7.xxx
      cmd: curl --version
      output:
          startsWith: curl 7.
          matches:
              - "^curl\\s7.*\\n.*\\nProtocols.+ftps.+https.+telnet.*\\n.*\\n$"

with command:

java -jar docker-unittests-app-1.1.0.jar -f tests.yml -i alpine:latest

but it fails without explanation about this error:

    Docker image testing (v1.1.0)
                      ##         .
                ## ## ##        ==
             ## ## ## ##       ===
         /""""""""""""""""___/ ===
    ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /===- ~~~
         \______ o          __/
          \    \        __/
           \____\______/

    Found scenarios: 1.
    App failed due to com.github.dockerjava.api.exception.NotModifiedException
    at com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter.filter(ResponseStatusExceptionFilter.java:40)
    at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:133)
    at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:121)
    at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
    at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:283)
    at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$0(JerseyInvocation.java:753)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:229)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)
    at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:752)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:445)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:351)
    at com.github.dockerjava.jaxrs.StopContainerCmdExec.execute(StopContainerCmdExec.java:31)
    at com.github.dockerjava.jaxrs.StopContainerCmdExec.execute(StopContainerCmdExec.java:12)
    at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
    at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
    at com.github.dockerjava.core.command.StopContainerCmdImpl.exec(StopContainerCmdImpl.java:63)
    at com.github.dgroup.dockertest.process.docker.cmd.Remove.lambda$new$0(Remove.java:51)
    at com.github.dgroup.dockertest.process.docker.DockerProcessEnvelope.execute(DockerProcessEnvelope.java:66)
    at com.github.dgroup.dockertest.concurrent.Concurrent.execute(Concurrent.java:152)
    at com.github.dgroup.dockertest.App.start(App.java:154)
    at com.github.dgroup.dockertest.App.main(App.java:102)

I don't know, maybe something is wrong with test file, but I'm not able to understand what exactly, it should work fine.

I checked that I can run these commands (from setup and from tests) and the output is correct:

$ docker run -it alpine:latest /bin/sh -c 'apk add --update --no-cache curl && curl --version'
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ca-certificates (20171114-r3)
(2/5) Installing nghttp2-libs (1.32.0-r0)
(3/5) Installing libssh2 (1.8.2-r0)
(4/5) Installing libcurl (7.61.1-r2)
(5/5) Installing curl (7.61.1-r2)
Executing busybox-1.28.4-r1.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 6 MiB in 18 packages
curl 7.61.1 (x86_64-alpine-linux-musl) libcurl/7.61.1 LibreSSL/2.0.0 zlib/1.2.11 libssh2/1.8.2 nghttp2/1.32.0
Release-Date: 2018-09-05
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy
dgroup commented 5 years ago

@g4s8, the issue should be fixed. Could you please test the latest version?

g4s8 commented 5 years ago

@dgroup great, thanks, now it's working