1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

ci(windows): upload coverage to codecov

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-05-19 21:19:51 +02:00
parent 0ca6e28807
commit 15ed58ffb5
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 55 additions and 10 deletions

View file

@ -131,6 +131,7 @@ jobs:
run: | run: |
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build" New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod" New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
New-Item -ItemType "directory" -Path "bundles"
If ("${{ matrix.os }}" -eq "windows-2019") { If ("${{ matrix.os }}" -eq "windows-2019") {
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ("${{ matrix.os }}" -eq "windows-2022") { } ElseIf ("${{ matrix.os }}" -eq "windows-2022") {
@ -162,9 +163,26 @@ jobs:
name: Test name: Test
run: | run: |
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" ` & docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
-v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" ` -v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
-v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" ` -v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit -v "${{ env.GOPATH }}\src\github.com\docker\docker\bundles:C:\gopath\src\github.com\docker\docker\bundles" `
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit
-
name: Send to Codecov
if: matrix.os == 'windows-2022'
uses: codecov/codecov-action@v3
with:
working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
directory: bundles
env_vars: RUNNER_OS
flags: unit
-
name: Upload reports
if: matrix.os == 'windows-2022'
uses: actions/upload-artifact@v3
with:
name: unit-reports
path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
integration-test: integration-test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -330,12 +348,31 @@ jobs:
- -
name: Test CLI name: Test CLI
run: | run: |
gotestsum --format=standard-verbose -- "-tags" "autogen" "-test.timeout" "200m" & gotestsum --format=standard-verbose --packages="./integration-cli/..." -- `
working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker/integration-cli "-coverprofile" "./bundles/coverage-report-int-cli-tests.txt" `
"-covermode" "atomic" `
"-tags" "autogen" `
"-test.timeout" "200m"
env: env:
DOCKER_HOST: npipe:////./pipe/docker_engine DOCKER_HOST: npipe:////./pipe/docker_engine
GO111MODULE: "off" GO111MODULE: "off"
TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker
-
name: Send to Codecov
if: matrix.os == 'windows-2022'
uses: codecov/codecov-action@v3
with:
working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
directory: bundles
env_vars: RUNNER_OS
flags: integration,${{ matrix.runtime }}
-
name: Upload reports
if: matrix.os == 'windows-2022'
uses: actions/upload-artifact@v3
with:
name: integration-reports-${{ matrix.runtime }}
path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
- -
name: Docker info name: Docker info
run: | run: |

View file

@ -1,5 +1,8 @@
comment: comment: false
layout: header, changes, diff, sunburst
github_checks:
annotations: false
coverage: coverage:
status: status:
patch: patch:
@ -13,5 +16,6 @@ coverage:
target: auto target: auto
threshold: "15%" threshold: "15%"
changes: false changes: false
ignore: ignore:
- "vendor/*" - "vendor/**/*"

View file

@ -328,7 +328,10 @@ Function Run-UnitTests() {
$pkgList = $pkgList | Select-String -NotMatch "github.com/docker/docker/integration" $pkgList = $pkgList | Select-String -NotMatch "github.com/docker/docker/integration"
$pkgList = $pkgList -replace "`r`n", " " $pkgList = $pkgList -replace "`r`n", " "
$goTestArg = "--format=standard-verbose --jsonfile=bundles\go-test-report-unit-tests.json --junitfile=bundles\junit-report-unit-tests.xml -- " + $raceParm + " -cover -ldflags -w -a """ + "-test.timeout=10m" + """ $pkgList" $jsonFilePath = $bundlesDir + "\go-test-report-unit-tests.json"
$xmlFilePath = $bundlesDir + "\junit-report-unit-tests.xml"
$coverageFilePath = $bundlesDir + "\coverage-report-unit-tests.txt"
$goTestArg = "--format=standard-verbose --jsonfile=$jsonFilePath --junitfile=$xmlFilePath -- " + $raceParm + " -coverprofile=$coverageFilePath -covermode=atomic -ldflags -w -a """ + "-test.timeout=10m" + """ $pkgList"
Write-Host "INFO: Invoking unit tests run with $GOTESTSUM_LOCATION\gotestsum.exe $goTestArg" Write-Host "INFO: Invoking unit tests run with $GOTESTSUM_LOCATION\gotestsum.exe $goTestArg"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo $pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = "$GOTESTSUM_LOCATION\gotestsum.exe" $pinfo.FileName = "$GOTESTSUM_LOCATION\gotestsum.exe"
@ -364,13 +367,14 @@ Function Run-IntegrationTests() {
} }
$jsonFilePath = $bundlesDir + "\go-test-report-int-tests-$normDir" + ".json" $jsonFilePath = $bundlesDir + "\go-test-report-int-tests-$normDir" + ".json"
$xmlFilePath = $bundlesDir + "\junit-report-int-tests-$normDir" + ".xml" $xmlFilePath = $bundlesDir + "\junit-report-int-tests-$normDir" + ".xml"
$coverageFilePath = $bundlesDir + "\coverage-report-int-tests-$normDir" + ".txt"
Set-Location $dir Set-Location $dir
Write-Host "Running $($PWD.Path)" Write-Host "Running $($PWD.Path)"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo $pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = "gotestsum.exe" $pinfo.FileName = "gotestsum.exe"
$pinfo.WorkingDirectory = "$($PWD.Path)" $pinfo.WorkingDirectory = "$($PWD.Path)"
$pinfo.UseShellExecute = $false $pinfo.UseShellExecute = $false
$pinfo.Arguments = "--format=standard-verbose --jsonfile=$jsonFilePath --junitfile=$xmlFilePath -- -test.timeout=60m $env:INTEGRATION_TESTFLAGS" $pinfo.Arguments = "--format=standard-verbose --jsonfile=$jsonFilePath --junitfile=$xmlFilePath -- -coverprofile=$coverageFilePath -covermode=atomic -test.timeout=60m $env:INTEGRATION_TESTFLAGS"
$p = New-Object System.Diagnostics.Process $p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo $p.StartInfo = $pinfo
$p.Start() | Out-Null $p.Start() | Out-Null