From 9a456c7be45ad0c78ad56d940c5b52f06765f7b0 Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy Date: Thu, 28 Sep 2023 11:32:22 -0400 Subject: [PATCH] [test] Update manifest; go generate Update description in manifest used for `test/` binaries. Add `test/tools.go` (similar to `tools/tools.go`), to track `goversioninfo` command. Update `.github/workflows/ci.yml` to run `go generate` from within `test/`. Signed-off-by: Hamza El-Saawy --- .github/workflows/ci.yml | 21 ++++++++++++++++++ test/go.mod | 2 ++ test/go.sum | 2 ++ test/pkg/manifest/manifest.xml | 2 +- test/pkg/manifest/resource_windows_386.syso | Bin 998 -> 990 bytes test/pkg/manifest/resource_windows_amd64.syso | Bin 998 -> 990 bytes test/pkg/manifest/resource_windows_arm.syso | Bin 998 -> 990 bytes test/pkg/manifest/resource_windows_arm64.syso | Bin 998 -> 990 bytes test/tools.go | 8 +++++++ 9 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 test/tools.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e346fc3f1f..b523793a93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,6 +195,27 @@ jobs: exit $LASTEXITCODE } + - name: Validate go generate in test + shell: powershell + working-directory: test + run: | + Write-Output "::group::go generate" + go generate -x .\... + Write-Output "::endgroup::" + if ($LASTEXITCODE -ne 0) { + Write-Output "::error title=Go Generate::Error running go generate." + exit $LASTEXITCODE + } + + git add --all --intent-to-add . + Write-Output "::group::git diff" + git diff --stat --exit-code + Write-Output "::endgroup::" + if ($LASTEXITCODE -ne 0) { + Write-Output "::error ::Generated files are not up to date. Please run ``go generate .\...`` from within ``./test``." + exit $LASTEXITCODE + } + test-linux: needs: [lint, protos, verify-vendor, go-gen] runs-on: ubuntu-latest diff --git a/test/go.mod b/test/go.mod index 2060fa127d..1bdb541049 100644 --- a/test/go.mod +++ b/test/go.mod @@ -11,6 +11,7 @@ require ( github.com/containerd/ttrpc v1.2.2 github.com/containerd/typeurl/v2 v2.1.1 github.com/google/go-containerregistry v0.16.1 + github.com/josephspurrier/goversioninfo v1.4.0 github.com/kevpar/cri v1.11.1-0.20220302210600-4c5c347230b2 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.0-rc3 @@ -35,6 +36,7 @@ require ( github.com/Microsoft/didx509go v0.0.2 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect github.com/agnivade/levenshtein v1.0.1 // indirect + github.com/akavel/rsrc v0.10.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/container-orchestrated-devices/container-device-interface v0.5.4 // indirect github.com/containerd/console v1.0.3 // indirect diff --git a/test/go.sum b/test/go.sum index 195647d046..9a6a1e7230 100644 --- a/test/go.sum +++ b/test/go.sum @@ -662,6 +662,7 @@ github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= +github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw= github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -1292,6 +1293,7 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josephspurrier/goversioninfo v1.4.0 h1:Puhl12NSHUSALHSuzYwPYQkqa2E1+7SrtAPJorKK0C8= github.com/josephspurrier/goversioninfo v1.4.0/go.mod h1:JWzv5rKQr+MmW+LvM412ToT/IkYDZjaclF2pKDss8IY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= diff --git a/test/pkg/manifest/manifest.xml b/test/pkg/manifest/manifest.xml index acf4843ede..229e61e1fd 100644 --- a/test/pkg/manifest/manifest.xml +++ b/test/pkg/manifest/manifest.xml @@ -1,6 +1,6 @@ - containerd-shim-runhcs-v1 + hcsshim-test diff --git a/test/pkg/manifest/resource_windows_386.syso b/test/pkg/manifest/resource_windows_386.syso index c4ee2aa22a60895bda36a4fd86fc8a8adc2ceb1f..497a64fa82608b252b579be01a7d115e029b90f3 100644 GIT binary patch delta 62 zcmaFHevh5ghmny11Wrukl;*5pW?--Za<)v=UCg+1Nw#Tl8ox+ST_C7Ty8 O$uI(yFihUXtOEc5a1lrV delta 71 zcmcb|{*0Z|hmny11TIYEl;&(;W?--Za`sHrUCelFOV diff --git a/test/pkg/manifest/resource_windows_amd64.syso b/test/pkg/manifest/resource_windows_amd64.syso index 5e5c9c9ceed15a89e7392e9a4e3150d29748e547..05db0b5231ad618637a7ec296f91cc1c44213e31 100644 GIT binary patch delta 62 zcmaFHevh3qrHzpR1Wrukl;*5pW?--Za<)v=UCg+1Nw#Tl8ox+ST_C7Ty8 O$uI(yFihUXtOEcd;1T5j delta 71 zcmcb|{*0Y7rHzpR1TIYEl;&(;W?--Za`sHrUCelFN)j{kQj1b_i!(BF Yb&E>#GLnmR%M3S9W|Co?yoFf{0PoWlmjD0& diff --git a/test/pkg/manifest/resource_windows_arm64.syso b/test/pkg/manifest/resource_windows_arm64.syso index 83004b1b5d3209329682fc4b6ff1cbeae366a371..eb5df81f125b73d01ce0074d119e25d1a0907289 100644 GIT binary patch delta 62 zcmaFHevh3qWfda>2%MP6Da~2I%)np+2wa%RDb3ly%)np+N)j{kQj1b_i!(BF Yb&E>#GLnmR%M3S9W|Co?yoFf{00IjZ-~a#s diff --git a/test/tools.go b/test/tools.go new file mode 100644 index 0000000000..2604c63aeb --- /dev/null +++ b/test/tools.go @@ -0,0 +1,8 @@ +//go:build tools + +package tools + +import ( + // create syso files for manifesting + _ "github.com/josephspurrier/goversioninfo/cmd/goversioninfo" +)