Commit graph

56 commits

Author SHA1 Message Date
Sebastiaan van Stijn
09a7efb1f7
hack/ci/windows.ps1: disable go modules
INFO: Running integration tests at 05/17/2021 12:54:50...
    INFO: DOCKER_HOST at tcp://127.0.0.1:2357
    INFO: Integration API tests being run from the host:
    INFO: make.ps1 starting at 05/17/2021 12:54:50
    powershell.exe : go: cannot find main module, but found vendor.conf in D:\gopath\src\github.com\docker\docker
    At D:\gopath\src\github.com\docker\docker@tmp\durable-1ed00396\powershellWrapper.ps1:3 char:1
    + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (go: cannot find...m\docker\docker:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

    	to create a module there, run:
    	go mod init
    INFO: make.ps1 ended at 05/17/2021 12:54:51

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8bae2278ba)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-15 22:25:18 +02:00
Paul "TBBle" Hampson
080d9df63e Don't clear the exit code from the Finally block
It turns out that the Finally block does not see the exit code from the
`exit` call that triggered it, but from an earlier state. And it seems
that actions take in the Finally block other than `exit` will not affect
the $LastErrorCode set by the `exit` that triggered the Finally block.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-11-08 23:15:15 +11:00
Stefan Scherer
89bec2e267
Fix collecting the daemon under test logs
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
2020-09-17 21:12:58 +02: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
Sebastiaan van Stijn
97b742676b
hack/ci/windows.ps1: build busybox from local Dockerfile
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-03 09:32:30 +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
Michael Zhao
48b06a2561
Tailor CI for ARM, skip legacy integration test.
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-08 18:37:13 +02:00
Sebastiaan van Stijn
5175ed54e5
hack/ci/windows.ps1 update references to repositories that were moved
Also updated the related docs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 12:14:38 +02:00
Stefan Scherer
4866207543
Zap a fixed folder, add build number to folder inside
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
2019-09-19 15:52:07 +02:00
Brian Goff
4b55f3cf8b
Merge pull request #39854 from thaJeztah/hack_windows_explicit_exit
hack/ci/windows.ps1: explicitly set exit code to result of tests
2019-09-12 11:34:44 -07:00
Brian Goff
15d3310f72
Merge pull request #39877 from thaJeztah/ci_windows_storageopt
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
2019-09-12 11:13:03 -07:00
Tibor Vass
6d8c5bc181
Merge pull request #39878 from thaJeztah/cut_the_tail
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
2019-09-11 10:03:11 -07:00
Tibor Vass
6754976015
Merge pull request #39888 from vikramhh/move_windows_gopath_out_of_goroot
Move GOPATH out from under the GO source tree
2019-09-10 14:33:12 -07:00
Vikram bir Singh
ecf91f0d7f Move GOPATH out from under the GO source tree
Unlike Linux which uses a temp dir as GOPATH, Windows
uses c:\go. Among other things, this blocks go get.

Moving GOPATH to c:\gopath and updating references in
comments and documentation.

Currently the change is being scoped narrowly. In the
future GOPATH value could be passed as a parameter to
the ps1 scripts.

Signed-off-by: Vikram bir Singh <vikrambir.singh@docker.com>
2019-09-10 16:57:33 +00:00
Tibor Vass
8bffe9524d remove per-test -timeout logic because it does not work
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-09 21:09:57 +00:00
Tibor Vass
7cd028f2d0 hack: update scripts
- remove -check.* flags
- use (per-test) -timeout flag
- allow user to override TEST_SKIP_* regardless of TESTFLAGS
- remove test-imports validation

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-09 21:09:57 +00:00
Sebastiaan van Stijn
e1636ad5fa
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
There's already a step in  "Nuke Everything", but lets' stop it
after stopping the daemon as well

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-07 17:50:01 +02:00
Sebastiaan van Stijn
b6f596c411
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-07 17:46:23 +02:00
Sebastiaan van Stijn
7eb522a235
hack/ci/windows.ps1 print all environment variables to check how Jenkins runs this script
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-06 23:32:57 +02:00
Sebastiaan van Stijn
8e8c52c4ab
hack/ci/windows.ps1: explicitly set exit code to result of tests
Trying to see if this helps with the cleanup step exiting in CI, but
Jenkins continuing to wait for the script to end afterwards.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-06 23:31:07 +02:00
Sebastiaan van Stijn
6ee61f5493
Jenkinsfile: create bundles for Windows stages
CI already stores the logs of the test daemon, so we might as well
store them as artifacts

```
[2019-09-03T12:49:39.835Z] INFO: Tidying up at end of run
[2019-09-03T12:49:39.835Z] INFO: Saving daemon under test log (d:\CI-2\CI-3593e7622\dut.out) to C:\windows\TEMP\CIDUT.out
[2019-09-03T12:49:39.835Z] INFO: Saving daemon under test log (d:\CI-2\CI-3593e7622\dut.err) to C:\windows\TEMP\CIDUT.err
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-03 18:48:27 +02:00
Kirill Kolyshkin
1a117b8b5c
Merge pull request #39804 from thaJeztah/defender_warning_only
integration: windows.ps1: turn defender error into a warning
2019-09-02 18:34:48 +03:00
Sebastiaan van Stijn
c0ef45e90c
Merge pull request #39831 from StefanScherer/fix-dutimgVersion
Fix docker inspect for dutimgVersion
2019-09-02 10:41:03 +02:00
Stefan Scherer
52a53e2587
Fix docker inspect for dutimgVersion
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
2019-08-30 12:44:20 +02:00
Sebastiaan van Stijn
156ad54fb7
windows.ps1: fix leaked NdisAdapters not being cleaned up on RS1
Windows RS1 has problems with leaking NdisAdapters during the integration
tests; the windows.ps1 script has a cleanup stesp to remove those
leaked adapters.

For internal testing at Microsoft on internal builds, this cleanup step
was skipped, and only ran on the CI machines in our Jenkins.

Due to the move to our new Jenkins, the names of Windows machines changed,
and because of that, the cleanup step was never executed, resulting in the
leaked adapters not being cleaned up:

```
20:32:23  WARNING: There are 608 NdisAdapters leaked under Psched\Parameters
20:32:23  WARNING: Not cleaning as not a production RS1 server
20:32:24  WARNING: There are 608 NdisAdapters leaked under WFPLWFS\Parameters
20:32:24  WARNING: Not cleaning as not a production RS1 server
```

```
22:01:31  WARNING: There are 1209 NdisAdapters leaked under Psched\Parameters
22:01:31  WARNING: Not cleaning as not a production RS1 server
22:01:31  WARNING: There are 1209 NdisAdapters leaked under WFPLWFS\Parameters
22:01:31  WARNING: Not cleaning as not a production RS1 server
```

This patch removes the check for non-production builds, and unconditionally
cleans up leaked adapters if they are found.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-29 23:47:23 +02:00
Sebastiaan van Stijn
31885181fc
integration: windows.ps1: turn defender error into a warning
Some integration tests are known to fail if Windows Defender is
enabled. On the machines that run our CI, defender is disabled
for that reason.

Contributors likely will have defender enabled, and because of
that are currently not able to run the integration tests.

This patch changes the ERROR into a WARNING, so that contributors
can still run (a limited set of) the integration tests, but get
informed that some may fail.

We should make this requirement more specific, and only skip
tests that are known to require defender to be disabled, but
while that's not yet in place, let's print a warning instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-28 16:08:53 +02:00
Stefan Scherer
ca3e230b77
Use new windows labels
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
2019-08-21 13:12:52 +02:00
Sebastiaan van Stijn
a43123cab1
Consistently use DOCKER_EXPERIMENTAL=1 instead or =y
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-09 20:24:00 +02:00
Andrew Hsu
aac6e62209
added hack/ci/master as entry point for master codeline checks
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2019-07-22 20:00:07 +02: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
Sebastiaan van Stijn
c6281bc438 Dockerfile: use GO_VERSION build-arg for overriding Go version
This allows overriding the version of Go without making modifications in the
source code, which can be useful to test against multiple versions.

For example:

    make GO_VERSION=1.13beta1 shell

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-18 17:36:09 -07:00
Sebastiaan van Stijn
6aafe0fd9e
WIP Move docker-py tests first again
See if networking works if we run it first

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-16 19:53:17 +02:00
Sebastiaan van Stijn
bd5c5373f1
Remove Codecov
Codecov has shown to be flaky, and calculate the wrong diff, in
addition, it doesn't show coverage for integration tests, which
makes the coverage report not useful.

Removing it for now, while we look at alternatives.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-15 20:30:59 +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
Olli Janatuinen
61815f6763 Windows CI - Corrected LOCALAPPDATA location
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-05-29 23:44:40 +03:00
Michael Crosby
265b605118 Move docker-py tests to the end
These tests have bad output and its hard to figure out what went wrong
when one of them fails.  Move them to the end to atleast get the real
test output first and better debug things.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-04-05 10:15:08 -04:00
xichengliudui
1d62807db3 Delete duplicate words
update pull request

Signed-off-by: “xichengliudui” <“liuduidui@beyondcent.com”>
2019-03-14 07:53:38 -04:00
John Howard
bc80e8df3e Windows CI: Dump possible panic log
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-02-05 09:17:40 -08:00
Olli Janatuinen
8a8fd37f6f CI: Introduce flaky test finder
comparing PR commit(s) to HEAD of moby/moby master branch and if founds
new (or renamed) integration tests will run stress tests for them.

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-01-11 01:11:07 +02:00
Sebastiaan van Stijn
f9dbd383bb
Merge pull request #38418 from thaJeztah/mega_power
PowerShell: various cleanups / fixes
2019-01-08 00:03:23 +01:00
Sebastiaan van Stijn
5580b79813 PowerShell: fix "Nuke-Everything" failing to remove images
I noticed this error in CI:

```
20:37:25 INFO: Non-base image count on control daemon to delete is 9
20:37:25 "docker rmi" requires at least 1 argument.
20:37:25 See 'docker rmi --help'.
20:37:25
20:37:25 Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]
20:37:25
20:37:25 Remove one or more images
```

Which indicated that the PowerShell script managed to find images to delete, but
not actually passing the images to `docker rmi`.

The reason for this failing was that the script attempted to convert the
collection/array to a string, which produces;

```powershell
Write-Output $(docker images --format "{{.Repository}}:{{.ID}}" | `
>>         select-string -NotMatch "windowsservercore" | `
>>         select-string -NotMatch "nanoserver" | `
>>         select-string -NotMatch "docker" `
>>         ).ToString()
System.Object[]
```

Which, when trying to split by the chosen separator (`:`), will return the same;

```powershell
Write-Output "System.Object[]".Split(":")[0]
```

This patch:

- Adds an intermediate variable (`$allImages`) to make the code better readable
- Switches the separator to `#`, to prevent breaking on images pulled from a
  repository with a port in its name (`myregistry:5000/my/image`)
- Switches to use a comma-separated list for `-NotMatch` (for readability)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-22 22:51:14 +01:00
Sebastiaan van Stijn
755d3057ab
PowerShell: Go-version check; only select the first match
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-22 21:35:51 +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
Sebastiaan van Stijn
b394d25f03
PowerShell: move $null to left-hand for comparisons
see https://rencore.com/blog/powershell-null-comparison/

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-22 21:34:27 +01:00
Sebastiaan van Stijn
0f8b616c0c
PowerShell: fix mixed tabs/spaces
Fixed some mixed/tabs spaces for indentation, and used
tabs for auto-generated Go code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-22 20:53:52 +01:00
John Howard
561e0f6b7f Windows: Bump busybox to v1.1
Signed-off-by: John Howard <jhoward@microsoft.com>

This is a follow-on from https://github.com/moby/moby/pull/38277
but had to be done in a couple of stages to ensure that CI didn't
break. v1.1 of the busybox image is now based on a CMD of "sh"
rather than using an entrypoint. And it also uses the bin directory
rather than `c:\busybox`. This makes it look a lot closer to the
Linux busybox image, and means that a couple of Windows-isms in
CI tests can be reverted back to be identical to their Linux
equivalents.
2018-11-26 14:50:47 -08:00
John Howard
14c8b67e51 Windows:Tie busybox to version
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-11-26 08:45:49 -08:00
Deep Debroy
7d1c1a411b Renamed windowsRS1.ps1 to windows.ps1
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-09-28 13:09:01 -07:00
Salahuddin Khan
4c8b1fd5a2 Enabling Windows integration tests
Signed-off-by: Salahuddin Khan <salah@docker.com>
2018-09-26 15:57:40 -07:00