Skip to content

Commit

Permalink
Refactor e2e-tests.yml workflow (#3627)
Browse files Browse the repository at this point in the history
* Move attach e2e tests into Go test suite

Run the e2e_test_attach.sh tests in Go, as a step toward making all the
e2e tests consistent with one another. This also has the added benefit
of no longer relying on ttl.sh since test images are hosted in the mock
registry server.

These tests were being run in CI under Linux and Mac, since they don't
rely on a Kind instance or any Sigstore services. This change updates
the GitHub workflow for the attach tests to simply run all e2e tests
that are compatible with the macos runner.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Reorganize cross-platform attach tests

Move all the e2e tests for cosign attachments that can be run
independently without other Sigstore services into the new
e2e_attach_test.go file, to make the main e2e_test.go file a more
mantainable size and to get the benefit of running these tests in the
e2e-cross job which runs on macos and linux.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Move TSA MTLS tests into Go test suite

Run the e2e_tsa_mtls.sh tests in Go. With this, a separate step to run
the script is unnecessary for the Github workflow, since it will be run
as part of the e2e-cross job.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

* Move TSA blob tests into Go test suite

Run the e2e_signblob_tsa_mtls.sh tests in Go. The e2e-tsa-mtls job in
the e2e-tests workflow is fully removed since these are now all covered
in e2e-cross.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>

---------

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
  • Loading branch information
cmurphy committed Apr 9, 2024
1 parent d0b9861 commit 302aee6
Show file tree
Hide file tree
Showing 24 changed files with 1,070 additions and 1,661 deletions.
34 changes: 4 additions & 30 deletions .github/workflows/e2e-tests.yml
Expand Up @@ -32,7 +32,7 @@ on:
workflow_dispatch:

jobs:
e2e-secrets:
e2e-cross:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
Expand All @@ -45,34 +45,8 @@ jobs:
go-version: '1.21'
check-latest: true

- uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3

- name: Run e2e_test_attach.sh
shell: bash
run: ./test/e2e_test_attach.sh

e2e-tsa-mtls:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21'
check-latest: true

- uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3

- name: Run e2e_tsa_mtls.sh
shell: bash
run: make && PATH="$PWD:$PATH" ./test/e2e_tsa_mtls.sh

- name: Run e2e_signblob_tsa_mtls.sh
shell: bash
run: make && PATH="$PWD:$PATH" ./test/e2e_signblob_tsa_mtls.sh
- name: Run cross platform e2e tests
run: go test -tags=e2e,cross -v ./test/...

e2e-test-pkcs11:
runs-on: ubuntu-latest
Expand All @@ -81,7 +55,7 @@ jobs:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.21'
go-version: '1.21'
check-latest: true

- name: Run pkcs11 end-to-end tests
Expand Down

0 comments on commit 302aee6

Please sign in to comment.