Split scenarios in different GA jobs

to parallelise better and allow re-running just the failed tests

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis 2023-02-15 09:18:52 +02:00
parent 0c236b6145
commit 1e3efb57cc
No known key found for this signature in database
GPG Key ID: 286DCAFD2C97DDE3
4 changed files with 18 additions and 8 deletions

View File

@ -12,6 +12,15 @@ on:
jobs:
e2e-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: "local-encryption"
- label: "remote-auto"
- label: "remote-static"
- label: "remote-https-pinned"
- label: "remote-https-bad-cert"
steps:
- name: Checkout code
uses: actions/checkout@v3
@ -19,4 +28,4 @@ jobs:
fetch-depth: 0
- name: Run tests
run: |
./earthly.sh +e2e-tests
./earthly.sh +e2e-tests --LABEL=${{ matrix.label }}

View File

@ -99,6 +99,7 @@ e2e-tests-image:
e2e-tests:
FROM +e2e-tests-image
ARG LABEL
WITH DOCKER --allow-privileged
RUN ./scripts/e2e-tests.sh

View File

@ -55,4 +55,4 @@ kubectl apply -k "$SCRIPT_DIR/../tests/assets/"
# https://stackoverflow.com/a/6752280
export KMS_ADDRESS="10.0.2.2.challenger.sslip.io"
PATH=$PATH:$GOPATH/bin ginkgo -v --nodes $GINKGO_NODES --fail-fast -r ./tests/
PATH=$PATH:$GOPATH/bin ginkgo -v --nodes $GINKGO_NODES --label-filter $LABEL --fail-fast -r ./tests/

View File

@ -20,7 +20,7 @@ import (
var installationOutput string
var vm VM
var _ = Describe("local encrypted passphrase", func() {
var _ = Describe("kcrypt encryption", func() {
var config string
BeforeEach(func() {
@ -63,7 +63,7 @@ var _ = Describe("local encrypted passphrase", func() {
})
// https://kairos.io/docs/advanced/partition_encryption/#offline-mode
When("doing local encryption", func() {
When("doing local encryption", Label("local-encryption"), func() {
BeforeEach(func() {
config = `#cloud-config
@ -89,7 +89,7 @@ users:
})
//https://kairos.io/docs/advanced/partition_encryption/#online-mode
When("using a remote key management server (automated passphrase generation)", func() {
When("using a remote key management server (automated passphrase generation)", Label("remote-auto"), func() {
var tpmHash string
var err error
@ -160,7 +160,7 @@ kcrypt:
})
// https://kairos.io/docs/advanced/partition_encryption/#scenario-static-keys
When("using a remote key management server (static keys)", func() {
When("using a remote key management server (static keys)", Label("remote-static"), func() {
var tpmHash string
var err error
@ -262,7 +262,7 @@ spec:
`, strings.TrimSpace(tpmHash)))
})
When("the certificate is pinned on the configuration", func() {
When("the certificate is pinned on the configuration", Label("remote-https-pinned"), func() {
BeforeEach(func() {
cert := getChallengerServerCert()
kcryptConfig := createConfigWithCert(fmt.Sprintf("https://%s", os.Getenv("KMS_ADDRESS")), cert)
@ -297,7 +297,7 @@ install:
})
})
When("the no certificate is set in the configuration", func() {
When("the no certificate is set in the configuration", Label("remote-https-bad-cert"), func() {
BeforeEach(func() {
config = fmt.Sprintf(`#cloud-config