Skip to content

Commit

Permalink
Migrate CI tests to GH actions (#163)
Browse files Browse the repository at this point in the history
* Migrate CI tests to GH actions

* linting job

* fix unit test
  • Loading branch information
kwiatekus authored Jan 3, 2024
1 parent 4158872 commit bea9261
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
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")
})
}
}

0 comments on commit bea9261

Please sign in to comment.