Skip to content

Commit

Permalink
test: add accidentally missing syslog-ng tests to ci
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
  • Loading branch information
pepov committed Jun 2, 2023
1 parent 0279e63 commit fb559c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ run: generate fmt vet ## Run against the configured Kubernetes cluster in ~/.kub
test: generate fmt vet manifests ${ENVTEST_BINARY_ASSETS} ${KUBEBUILDER} ## Run tests
cd pkg/sdk/logging && ENVTEST_BINARY_ASSETS=${ENVTEST_BINARY_ASSETS} go test ./...
cd pkg/sdk/extensions && go test ./...
cd pkg/sdk/logging/model/syslogng/config && go test ./...
ENVTEST_BINARY_ASSETS=${ENVTEST_BINARY_ASSETS} go test ./controllers/logging/... ./pkg/... -coverprofile cover.out
ENVTEST_BINARY_ASSETS=${ENVTEST_BINARY_ASSETS} go test ./controllers/extensions/... ./pkg/... -coverprofile cover.out

Expand Down
18 changes: 9 additions & 9 deletions pkg/sdk/logging/model/syslogng/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestRenderConfigInto(t *testing.T) {
},
SecretLoaderFactory: &TestSecretLoaderFactory{},
},
wantOut: Untab(`@version: 3.37
wantOut: Untab(`@version: current
@include "scl.conf"
Expand Down Expand Up @@ -159,7 +159,7 @@ log {
SourcePort: 601,
SecretLoaderFactory: &TestSecretLoaderFactory{},
},
wantOut: `@version: 3.37
wantOut: `@version: current
@include "scl.conf"
Expand Down Expand Up @@ -220,7 +220,7 @@ source "main_input" {
},
},
},
wantOut: Untab(`@version: 3.37
wantOut: Untab(`@version: current
@include "scl.conf"
Expand Down Expand Up @@ -302,7 +302,7 @@ log {
},
SourcePort: 601,
},
wantOut: `@version: 3.37
wantOut: `@version: current
@include "scl.conf"
Expand Down Expand Up @@ -358,7 +358,7 @@ destination "output_default_my-output" {
SecretLoaderFactory: &TestSecretLoaderFactory{},
SourcePort: 601,
},
wantOut: `@version: 3.37
wantOut: `@version: current
@include "scl.conf"
Expand Down Expand Up @@ -422,7 +422,7 @@ log {
SecretLoaderFactory: &TestSecretLoaderFactory{},
SourcePort: 601,
},
wantOut: Untab(`@version: 3.37
wantOut: Untab(`@version: current
@include "scl.conf"
Expand Down Expand Up @@ -486,7 +486,7 @@ log {
SecretLoaderFactory: &TestSecretLoaderFactory{},
SourcePort: 601,
},
wantOut: Untab(`@version: 3.37
wantOut: Untab(`@version: current
@include "scl.conf"
Expand Down Expand Up @@ -550,7 +550,7 @@ log {
SecretLoaderFactory: &TestSecretLoaderFactory{},
SourcePort: 601,
},
wantOut: Untab(`@version: 3.37
wantOut: Untab(`@version: current
@include "scl.conf"
Expand Down Expand Up @@ -594,7 +594,7 @@ log {
SecretLoaderFactory: &TestSecretLoaderFactory{},
SourcePort: 601,
},
wantOut: Untab(`@version: 3.37
wantOut: Untab(`@version: current
@include "scl.conf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package test
import (
"testing"

"github.com/cisco-open/operator-tools/pkg/secret"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/kube-logging/logging-operator/pkg/sdk/logging/api/v1beta1"
"github.com/kube-logging/logging-operator/pkg/sdk/logging/model/syslogng/config"
"github.com/kube-logging/logging-operator/pkg/sdk/logging/model/syslogng/output"
"github.com/cisco-open/operator-tools/pkg/secret"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestLogglyOutput(t *testing.T) {
Expand All @@ -43,7 +44,7 @@ func TestLogglyOutput(t *testing.T) {
},
`
destination "output_default_test-loggly-out" {
loggly("localhost" tag("test-tag") token("asd") persist_name("output_default_test-syslog-out"));
loggly("localhost" tag("test-tag") token("asd") persist_name("output_default_test-loggly-out"));
};
`,
)
Expand Down

0 comments on commit fb559c0

Please sign in to comment.