Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate CI tests to GH actions #163

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: k3d integration test
name: warden verify

on:
push:
Expand All @@ -7,10 +7,30 @@ on:
pull_request:

jobs:
k3d-integration-test:

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: true
- uses: golangci/golangci-lint-action@v3
with:
version: v1.54
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: true
- name: unit test
run: make test
integration-test:
needs: unit-test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Create Single Cluster
Expand Down
5 changes: 3 additions & 2 deletions internal/validate/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package validate_test
import (
"context"
"fmt"
"testing"

"github.com/kyma-project/warden/internal/validate"
"github.com/kyma-project/warden/internal/validate/mocks"
"github.com/kyma-project/warden/pkg"
Expand All @@ -11,7 +13,6 @@ import (
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)

func TestValidatePod(t *testing.T) {
Expand Down Expand Up @@ -162,7 +163,7 @@ func TestValidatePod(t *testing.T) {
//THEN
require.NoError(t, err)
require.Equal(t, testCase.expectedStatus, result.Status)
require.EqualValues(t, testCase.expectedFailedImages, result.InvalidImages)
require.ElementsMatchf(t, testCase.expectedFailedImages, result.InvalidImages, "list of images do not match")
})
}
}
Loading