Commit graph

55 commits

Author SHA1 Message Date
CrazyMax
ca8b659a06
ci(integration-cli): move integration-cli run to make script
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-17 10:59:05 +02:00
CrazyMax
15ed58ffb5
ci(windows): upload coverage to codecov
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-20 10:12:10 +02:00
CrazyMax
1efda78f2b
use go-winres for windows build and cleanup autogen and winresources
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-04-14 19:52:36 +02:00
Sebastiaan van Stijn
5f89a6a78e
pkg/urlutil: deprecate, and move to builder/remotecontext/urlutil
pkg/urlutil (despite its poorly chosen name) is not really intended as a generic
utility to handle URLs, and should only be used by the builder to handle (remote)
build contexts.

- IsURL() only does a very rudimentary check for http(s):// prefixes, without any
  other validation, but due to its name may give incorrect expectations.
- IsGitURL() is written specifically with docker build remote git contexts in
  mind, and has handling for backward-compatibility, where strings that are
  not URLs, but start with "github.com/" are accepted.

Because of the above, this patch:

- moves the package inside builder/remotecontext, close to where it's intended
  to be used (ideally this would be part of build/remotecontext itself, but this
  package imports many other dependencies, which would introduce those as extra
  dependencies in the CLI).
- deprecates pkg/urlutil, but adds aliases as there are some external consumers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-12 19:58:05 +02:00
Paul "TBBle" Hampson
142b2b785b Add TestBuildWCOWSandboxSize integration test
This test validates that `RUN` and `COPY` both target a read-write
sandbox on Windows that is configured according to the daemon's
`storage-opts` setting.

Sadly, this is a slow test, so we need to bump the timeout to 60 minutes
from the default of 10 minutes.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-11-10 19:51:46 +11:00
Olli Janatuinen
82b5ff8026 Windows CI: Make sure that CI fails on any error
- If unit tests fails
- If intergration tests fails

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2020-09-17 08:59:49 +03:00
Sebastiaan van Stijn
aadc55c605
Dockerfile.windows: fix build of gotestsum
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-16 20:12:39 +02:00
Vikram bir Singh
8d2e1ee546
Build and use gotestsum for running all tests
1. Dockerfile.Windows modified to build gotestsum.exe

2. Use gotestsum.exe in invoking the execution of:

   (a) Unit tests (run in containers),
   (b) Integration tests (run outside containers)
   (c) Integration-cli (run outside containers)

No changes made to other categories of tests (e.g.
LCOW).

3. Copy .xml files produced by gotestsum in
   appropriate paths where Jenkins can ingest them

4. Modify Jenkinsfile to mark results output as
   being jUnit "type" as well as to archive the
   .xml test result files as artifacts.

Signed-off-by: Vikram bir Singh <vikrambir.singh@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-19 20:31:22 +01:00
Sebastiaan van Stijn
61450a651b
hack/ci/windows.ps1: fix Go version check (due to trailing .0)
The Windows Dockerfile downloads the Go binaries, which (unlike
the Golang images) do not have a trailing `.0` in their version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-10 11:40:31 +02:00
Sebastiaan van Stijn
6ae46aeabf
make.ps1: Run-IntegrationTests(): set working directory for test suite
This function changed to the correct working directory before starting the tests
(which is the same as on Linux), however the `ProcessStartInfo` process does
not inherit this working directory, which caused Windows tests to be running
with a different working directory as Linux (causing files used in tests to not
be found).

From the documentation; https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.workingdirectory?view=netframework-4.8

> When `UseShellExecute` is `true`, the fully qualified name of the directory that contains
> the process to be started. When the `UseShellExecute` property is `false`, the working
> directory for the process to be started. The default is an empty string (`""`).

This patch sets the `ProcessStartInfo.WorkingDirectory` to the correct working
directory before starting the process.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 13:20:04 +02:00
Brian Goff
abece9b562 Improvements to the test runners
1. Use `go list` to get list of integration dirs to build. This means we
   do not need to have a valid `.go` in every subdirectory and also
   filters out other dirs like "bundles" which may have been created.
2. Add option to specify custom flags for integration and
   integration-cli. This is needed so both suites can be run AND set
   custom flags... since the cli suite does not support standard go
   flags.
3. Add options to skip an entire integration suite.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2019-07-31 16:37:17 -07:00
Sebastiaan van Stijn
4fa57a8191
Windows: fix Golang version checks for GO_VERSION build-arg
This check was used to make sure we don't bump Go versions independently
(Linux/Windows). The Dockerfile switched to using a build-arg to allow
overriding the Go version, which rendered this check non-functional.

It also fails if Linux versions use a specific variant of the image;

08:41:31 ERROR: Failed 'ERROR: Mismatched GO versions between Dockerfile and Dockerfile.windows. Update your PR to ensure that both files are updated and in sync. ${GO_VERSION}-stretch ${GO_VERSION}' at 07/20/2019 08:41:31
08:41:31 At C:\gopath\src\github.com\docker\docker\hack\ci\windows.ps1:448 char:9
08:41:31 +         Throw "ERROR: Mismatched GO versions between Dockerfile and D ...
08:41:31 +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This patch fixes the check by looking for the value of `GO_VERSION` instead
of looking at the `FROM` line (which is harder to parse).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-20 12:54:50 +02:00
Olli Janatuinen
2f22247cad Enable integrations API tests for Windows CI
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-06-10 21:32:36 +03:00
corbin-coleman
edc639e99f Add ability to override the version in make.ps1
Checks for environment variable VERSION if it exists then it sets dockerVersion to VERSION

Signed-off-by: corbin-coleman <corbin.coleman@docker.com>
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-04-19 18:39:57 +00:00
Sebastiaan van Stijn
468eb93e5a
Use 17.06 stable channel for CLI used in CI
Update to the latest patch release of 17.06.2. This
keeps the same API requirements.

This also enables pre-built binaries for armhf instead
of compiling from source.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-31 11:42:40 +01:00
Sebastiaan van Stijn
6130c89cce
PowerShell: remove aliases, use their real commands instead
This patch replaces PowerShell aliases for their real commands, see https://blogs.technet.microsoft.com/heyscriptingguy/2012/04/21/when-you-should-use-powershell-aliases/

For example;

- use `Get-Location` instead of `pwd`
- use `Set-Location` instead of `cd`
- use `ForEach-Object` instead of the `%` shorthand
- use `Write-Output` instead of `echo`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-22 21:34:39 +01:00
Kir Kolyshkin
8ad648b59a hack/make.ps1: remove the .0 suffix from go version
We would like to use a version with .0 suffix (like 1.11.0) in
Dockerfile, so that once a .1 version is out (like 1.11.1) we
won't accidentally switch to it.

Unfortunately it's not possible to use .0 suffix currently
as it breaks the check in make.ps1. This patch fixes that.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-06 15:24:34 -07:00
Kir Kolyshkin
d2788cb2f0 hack/make.ps1: know where we failed
In case of an exception, it makes great sense to print out some
information telling where exactly it happened.

_.InvocationInfo.PositionMessage gives script name, line number,
character position and (depending on the PS version) highlights
the part where error has happened.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-27 18:04:57 -07:00
Kir Kolyshkin
6a2851332d hack/make.ps1: don't use ENV GO_VERSION
Modify hack/make.ps1 to use the version value used in
"FROM golang" statement.

While at it:
 1. Make search expression a bit more strict (use ^ to match at BOL only).
 2. Simplify by removing Get-Contents as Select-String can read files.

After this, ENV GO_VERSION can be removed from Dockerfile.
Unfortunately it can't be done in one commit as Windows CI
fails (presumably because Dockerfile is being modified in
place).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-08-15 12:16:39 +03:00
Tibor Vass
195919d9d6 builder: set buildkit's exported product variable via PRODUCT
This introduces a PRODUCT environment variable that is used to set a constant
at dockerversion.ProductName.

That is then used to set BuildKit's ExportedProduct variable in order to show
useful error messages to users when a certain version of the product doesn't
support a BuildKit feature.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-07-16 21:41:54 +00:00
John Stephens
ee508d47c3
hack/make.ps1: fix Validate-PkgImports
In Go 1.10.1, the Deps for pkg\tarsum\tarsum_test.go are empty ([]) and
the PowerShell script ends up setting its import list to a string value
of False instead of an empty array. This can be remedied by forcing the
result to be an array, by concatenating to an empty array (@() + ...)

Signed-off-by: John Stephens <johnstep@docker.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit ec3f9230d70506c536a24e844da0f0b3af9b43f6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:37:10 -07:00
Tibor Vass
cb8283a6e9 Fix windows
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-12-06 23:23:55 +01:00
Daniel Nephin
1e1ad008db Remove version file
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-11-01 16:25:03 -04:00
Daniel Nephin
cef786f787 Pin docker-cli version to the 17.06-ce release version
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-22 14:29:16 -04:00
Daniel Nephin
e593b72cc9 Fix exclude list in make.ps1
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:03:20 -04:00
Josh Soref
39bcaee47b
Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-03 13:13:09 -07:00
Daniel Nephin
96e61f3173 Remove bindata
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-21 11:20:05 -04:00
Vincent Demeester
ef07964ab7 Merge pull request #33235 from Microsoft/jjh/tweakmakeps1
make.ps1 default to just building daemon
2017-05-17 16:24:23 +02:00
John Howard
0a9c79f93b make.ps1 default to just building daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-16 13:39:16 -07:00
John Stephens
eab0f58661
Ensure the correct Windows client is built
This script builds the client by cloning the repository to a temporary
location and building from there by temporarily changing GOPATH.
However, it was previously building by package name, and a package with
the same name in GOROOT overrides. This update changes the current
directory, and builds from there, instead of specifying a package name.

Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-16 12:13:28 -07:00
John Stephens
632a8635a0
Fix make.ps1 client build for Windows
Always clone the client to the docker directory, even if the specified
client repository is a fork. This is simpler than modifying the build
command to specify the package path of the fork.

Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-15 12:38:10 -07:00
John Stephens
32d47be263
Build client on Windows in a temporary directory
Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-10 11:45:10 -07:00
John Stephens
2bc6fffacb
Update make.ps1 to respect client repo
Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-09 13:07:09 -07:00
Arnaud Porterie (icecrime)
32915b1d0a Remove cmd/docker and other directories in cli/ in accordance with the new Moby project scope
Starting with this commit, integration tests should no longer rely on
the docker cli, they should be API tests instead. For the existing tests
the scripts will use a frozen version of the docker cli with a
DOCKER_API_VERSION frozen to 1.30, which should ensure that the CI remains
green at all times.

To help contributors develop and test manually with a modified docker
cli, this commit also adds a DOCKER_CLI_PATH environment variable to the
Makefile. This allows to set the path of a custom cli that will be
available inside the development container and used to run the
integration tests.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-05-05 12:14:29 -07:00
Victor Vieux
47396d6377 Switch to new versioning scheme
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-02-15 23:22:50 -08:00
John Howard
f48f1ff34c Windows: make.ps1 emit commit ID
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-09 20:01:23 -08:00
Sebastiaan van Stijn
0a51ad2586 Merge pull request #30639 from Microsoft/jjh/makeshortcut
Windows: Make.ps1 default to build binaries
2017-02-07 07:39:33 -08:00
Sebastiaan van Stijn
4af2555a35 Merge pull request #30290 from vdemeester/carry-pr-27834
Carry #27834 — Do not require `.git` in the build context
2017-02-04 19:19:16 -08:00
Alexander Morozov
12b8432413 Merge pull request #30644 from Microsoft/jjh/makecheckgoversion
Windows: make.ps1 validate go version
2017-02-02 11:39:56 -08:00
Vincent Demeester
8ed8366efd Merge pull request #29896 from Microsoft/jjh/gofmt
Windows: gofmt checker fixes
2017-02-02 12:12:57 +01:00
John Howard
a08e1304d4 Windows: gofmt check write out right filename
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-01 19:13:33 -08:00
John Howard
5e7a9e523f Windows: make.ps1 validate go version
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-01 10:31:27 -08:00
John Howard
674247f5f0 Windows: Make.ps1 default to build binaries
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-02-01 09:54:04 -08:00
John Howard
f32b267d1c
Windows updates for .git in .dockerignore
Signed-off-by: John Howard jhoward@microsoft.com
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-24 14:43:02 +01:00
Vincent Demeester
ba4f8f06b3 Merge pull request #29147 from Microsoft/jjh/makeroot
Windows: make.ps1 calc root
2017-01-20 15:01:58 +01:00
Zhang Wei
827bbe90a0 Fix some typos
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-01-19 15:29:28 +08:00
Daniel Nephin
38d08b0bd1 Add validation for compose schema bindata.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-28 14:45:44 -05:00
John Stephens
0ce6c12f88
Fix regular expression for PowerShell DCO check
Signed-off-by: John Stephens <johnstep@docker.com>
2016-12-20 15:32:39 -08:00
Sebastiaan van Stijn
611a633ba4
fix powershell dco check
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-12-16 23:48:27 +01:00
John Howard
e538c1fdca Windows: make.ps1 fix DCO check
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-12-07 17:58:07 -08:00