diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9905af4be..66fefe39e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,13 +1,13 @@ +--- name: go on: push: pull_request: jobs: - lint: + lint: # <- name strategy: matrix: os: [macos-latest, windows-2019, ubuntu-latest] - name: lint runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -20,3 +20,15 @@ jobs: if: ${{ matrix.os != 'windows-2019' }} with: args: --enable goimports + + test-unit: # <- name + strategy: + matrix: + os: [macos-latest, windows-2019, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - run: go run github.com/onsi/ginkgo/v2/ginkgo run -r --keep-going --skip-package integration diff --git a/platform/cert/cert_manager_test.go b/platform/cert/cert_manager_test.go index 7b451703d..39219e1ae 100644 --- a/platform/cert/cert_manager_test.go +++ b/platform/cert/cert_manager_test.go @@ -14,11 +14,12 @@ import ( "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" - "github.com/cloudfoundry/bosh-agent/v2/platform/cert" - boshdir "github.com/cloudfoundry/bosh-agent/v2/settings/directories" "github.com/cloudfoundry/bosh-utils/logger" boshsys "github.com/cloudfoundry/bosh-utils/system" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" + + "github.com/cloudfoundry/bosh-agent/v2/platform/cert" + boshdir "github.com/cloudfoundry/bosh-agent/v2/settings/directories" ) const cert1 string = `-----BEGIN CERTIFICATE----- @@ -427,6 +428,9 @@ if (Test-Path %[1]s) { if runtime.GOOS != "windows" { Skip("Only run on Windows") } + if os.Getenv("GITHUB_ACTIONS") == "true" { + Skip("`cert.UpdateCertificates()` does not appear to be supported on Github Action windows workers") + } fs = boshsys.NewOsFileSystem(log) var err error @@ -448,7 +452,6 @@ if (Test-Path %[1]s) { It("should create the tmpDir if doesn't exist", func() { _, err := os.Stat(dirProvider.TmpDir()) - fmt.Println("BEfore", dirProvider.TmpDir(), err) missing := os.IsNotExist(err) Expect(missing).To(BeTrue()) err = certManager.UpdateCertificates(validCerts) @@ -462,6 +465,7 @@ if (Test-Path %[1]s) { err := fs.MkdirAll(dirProvider.TmpDir(), os.FileMode(0777)) Expect(err).To(BeNil()) }) + It("adds certs to the trusted cert chain", func() { err := certManager.UpdateCertificates(validCerts) Expect(err).To(BeNil()) @@ -494,7 +498,6 @@ if (Test-Path %[1]s) { Eventually(session.Out).Should(gbytes.Say("0")) }) }) - }) }) }) diff --git a/platform/windows_platform_test.go b/platform/windows_platform_test.go index 3f7b8df15..61b829698 100644 --- a/platform/windows_platform_test.go +++ b/platform/windows_platform_test.go @@ -1067,6 +1067,10 @@ var _ = Describe("BOSH User Commands", func() { }) It("can delete a user, and any files in the user home directory which aren't in use by the registry", func() { + if os.Getenv("GITHUB_ACTIONS") == "true" { + Skip("User deletion does not appear to be supported on Github Action windows workers") + } + Expect(platform.CreateUser(testUsername, "")).To(Succeed()) Expect(userExists(testUsername)).To(Succeed())