Skip to content

Dockerfile.e2e: copy test sources#39150

Merged
thaJeztah merged 2 commits intomoby:masterfrom
kolyshkin:dockerfile.e2e
May 3, 2019
Merged

Dockerfile.e2e: copy test sources#39150
thaJeztah merged 2 commits intomoby:masterfrom
kolyshkin:dockerfile.e2e

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

(this is a quick followup to #39116)

Package "gotest.tools/assert" uses source introspection to
print more info in case of assertion failure. When source code
is not available, it prints an error instead.

In other words, before this commit:

--- SKIP: TestCgroupDriverSystemdMemoryLimit (0.00s)
cgroupdriver_systemd_test.go:32: failed to parse source file: /go/src/github.com/docker/docker/integration/system/cgroupdriver_systemd_test.go: open /go/src/github.com/docker/docker/integration/system/cgroupdriver_systemd_test.go: no such file or directory
cgroupdriver_systemd_test.go:32:

and after:

--- SKIP: TestCgroupDriverSystemdMemoryLimit (0.09s)
cgroupdriver_systemd_test.go:32: !hasSystemd()

This increases the resulting image size by about 2 MB
on my system (from 758 to 760 MB).

Comment thread Dockerfile.e2e Outdated
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, but otherwise looks good 🤗

Comment thread Dockerfile.e2e Outdated
Comment thread Dockerfile.e2e Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 29, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@e516af6). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #39150   +/-   ##
=========================================
  Coverage          ?   37.01%           
=========================================
  Files             ?      612           
  Lines             ?    45428           
  Branches          ?        0           
=========================================
  Hits              ?    16815           
  Misses            ?    26329           
  Partials          ?     2284

Package "gotest.tools/assert" uses source introspection to
print more info in case of assertion failure. When source code
is not available, it prints an error instead.

In other words, before this commit:

> --- SKIP: TestCgroupDriverSystemdMemoryLimit (0.00s)
>     cgroupdriver_systemd_test.go:32: failed to parse source file: /go/src/github.com/docker/docker/integration/system/cgroupdriver_systemd_test.go: open /go/src/github.com/docker/docker/integration/system/cgroupdriver_systemd_test.go: no such file or directory
>     cgroupdriver_systemd_test.go:32:

and after:

> --- SKIP: TestCgroupDriverSystemdMemoryLimit (0.09s)
>    cgroupdriver_systemd_test.go:32: !hasSystemd()

This increases the resulting image size by about 2 MB
on my system (from 758 to 760 MB).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Copy Markdown
Contributor Author

@seemethere PTAL (second patch)

@kolyshkin kolyshkin requested a review from thaJeztah May 1, 2019 20:32
Comment thread Dockerfile.e2e Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should do the job;

Suggested change
ARG DOCKER_GITCOMMIT=${DOCKER_GITCOMMIT:-undefined}
ARG DOCKER_GITCOMMIT=undefined

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right; fixed

1. There is no need to persist DOCKER_GITCOMMIT,
as it's not needed for runtime, only for build.
So, remove ENV.

2. In case $GITCOMMIT is not defined during build time
(and it happens if .git directory is not present),
we still need to have some value set, so set it to
`undefined`. Otherwise we'll have something like

>  => ERROR [builder 2/3] RUN hack/make.sh build-integration-test-binary
> ------
>  > [builder 2/3] RUN hack/make.sh build-integration-test-binary:
> moby#32 0.488
> moby#32 0.505 error: .git directory missing and DOCKER_GITCOMMIT not specified
> moby#32 0.505   Please either build with the .git directory accessible, or specify the
> moby#32 0.505   exact (--short) commit hash you are building using DOCKER_GITCOMMIT for
> moby#32 0.505   future accountability in diagnosing build issues.  Thanks!

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants