Skip to content

Commit

Permalink
DEV fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
madebyrogal committed Jan 23, 2024
1 parent e0ebcfa commit 783055c
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/branch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,18 @@ jobs:
if: ${{ failure() }}
uses: ./.github/actions/dump-cluster

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() }}
env:
SLACK_USERNAME: Botkube Cloud CI
SLACK_COLOR: 'red'
SLACK_TITLE: 'Message'
SLACK_CHANNEL: 'botkube-cloud-ci-alerts'
SLACK_MESSAGE: 'CLI Migration E2E tests failed :scream:'
SLACK_ICON_EMOJI: ':this-is-fine-fire:'
SLACK_FOOTER: "Fingers crossed it's just an outdated/flaky test..."
SLACK_WEBHOOK: ${{ secrets.SLACK_CI_ALERTS_WEBHOOK }}
# - name: Slack Notification
# uses: rtCamp/action-slack-notify@v2
# if: ${{ failure() }}
# env:
# SLACK_USERNAME: Botkube Cloud CI
# SLACK_COLOR: 'red'
# SLACK_TITLE: 'Message'
# SLACK_CHANNEL: 'botkube-cloud-ci-alerts'
# SLACK_MESSAGE: 'CLI Migration E2E tests failed :scream:'
# SLACK_ICON_EMOJI: ':this-is-fine-fire:'
# SLACK_FOOTER: "Fingers crossed it's just an outdated/flaky test..."
# SLACK_WEBHOOK: ${{ secrets.SLACK_CI_ALERTS_WEBHOOK }}

# cloud-slack-dev-e2e:
# name: Botkube Cloud Slack Dev E2E
Expand Down
70 changes: 70 additions & 0 deletions test/e2e/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ func assertPlugins(t *testing.T, actual []*gqlModel.Plugin) {
Type: "SOURCE",
ConfigurationName: "k8s-create-events",
Configuration: "{\"event\":{\"types\":[\"create\"]},\"namespaces\":{\"include\":[\".*\"]},\"resources\":[{\"type\":\"v1/pods\"},{\"type\":\"v1/services\"},{\"type\":\"networking.k8s.io/v1/ingresses\"},{\"type\":\"v1/nodes\"},{\"type\":\"v1/namespaces\"},{\"type\":\"v1/configmaps\"},{\"type\":\"apps/v1/deployments\"},{\"type\":\"apps/v1/statefulsets\"},{\"type\":\"apps/v1/daemonsets\"},{\"type\":\"batch/v1/jobs\"}]}",
Enabled: true,
Rbac: defaultRBAC,
},
{
Expand All @@ -354,6 +355,7 @@ func assertPlugins(t *testing.T, actual []*gqlModel.Plugin) {
Type: "SOURCE",
ConfigurationName: "k8s-err-with-logs-events",
Configuration: "{\"event\":{\"types\":[\"error\"]},\"namespaces\":{\"include\":[\".*\"]},\"resources\":[{\"type\":\"v1/pods\"},{\"type\":\"apps/v1/deployments\"},{\"type\":\"apps/v1/statefulsets\"},{\"type\":\"apps/v1/daemonsets\"},{\"type\":\"batch/v1/jobs\"}]}",
Enabled: true,
Rbac: defaultRBAC,
},
{
Expand All @@ -362,6 +364,7 @@ func assertPlugins(t *testing.T, actual []*gqlModel.Plugin) {
Type: "SOURCE",
ConfigurationName: "k8s-recommendation-events",
Configuration: "{\"namespaces\":{\"include\":[\".*\"]},\"recommendations\":{\"ingress\":{\"backendServiceValid\":true,\"tlsSecretValid\":true},\"pod\":{\"labelsSet\":true,\"noLatestImageTag\":true}}}",
Enabled: true,
Rbac: defaultRBAC,
},
{
Expand All @@ -370,6 +373,7 @@ func assertPlugins(t *testing.T, actual []*gqlModel.Plugin) {
Type: "SOURCE",
ConfigurationName: "k8s-all-events",
Configuration: "{\"annotations\":{},\"event\":{\"message\":{\"exclude\":[],\"include\":[]},\"reason\":{\"exclude\":[],\"include\":[]},\"types\":[\"create\",\"delete\",\"error\"]},\"filters\":{\"nodeEventsChecker\":true,\"objectAnnotationChecker\":true},\"labels\":{},\"namespaces\":{\"include\":[\".*\"]},\"resources\":[{\"type\":\"v1/pods\"},{\"type\":\"v1/services\"},{\"type\":\"networking.k8s.io/v1/ingresses\"},{\"event\":{\"message\":{\"exclude\":[\".*nf_conntrack_buckets.*\"]}},\"type\":\"v1/nodes\"},{\"type\":\"v1/namespaces\"},{\"type\":\"v1/persistentvolumes\"},{\"type\":\"v1/persistentvolumeclaims\"},{\"type\":\"v1/configmaps\"},{\"type\":\"rbac.authorization.k8s.io/v1/roles\"},{\"type\":\"rbac.authorization.k8s.io/v1/rolebindings\"},{\"type\":\"rbac.authorization.k8s.io/v1/clusterrolebindings\"},{\"type\":\"rbac.authorization.k8s.io/v1/clusterroles\"},{\"event\":{\"types\":[\"create\",\"update\",\"delete\",\"error\"]},\"type\":\"apps/v1/daemonsets\",\"updateSetting\":{\"fields\":[\"spec.template.spec.containers[*].image\",\"status.numberReady\"],\"includeDiff\":true}},{\"event\":{\"types\":[\"create\",\"update\",\"delete\",\"error\"]},\"type\":\"batch/v1/jobs\",\"updateSetting\":{\"fields\":[\"spec.template.spec.containers[*].image\",\"status.conditions[*].type\"],\"includeDiff\":true}},{\"event\":{\"types\":[\"create\",\"update\",\"delete\",\"error\"]},\"type\":\"apps/v1/deployments\",\"updateSetting\":{\"fields\":[\"spec.template.spec.containers[*].image\",\"status.availableReplicas\"],\"includeDiff\":true}},{\"event\":{\"types\":[\"create\",\"update\",\"delete\",\"error\"]},\"type\":\"apps/v1/statefulsets\",\"updateSetting\":{\"fields\":[\"spec.template.spec.containers[*].image\",\"status.readyReplicas\"],\"includeDiff\":true}}]}",
Enabled: true,
Rbac: defaultRBAC,
},
{
Expand All @@ -378,6 +382,7 @@ func assertPlugins(t *testing.T, actual []*gqlModel.Plugin) {
Type: "SOURCE",
ConfigurationName: "k8s-err-events",
Configuration: "{\"event\":{\"types\":[\"error\"]},\"namespaces\":{\"include\":[\".*\"]},\"resources\":[{\"type\":\"v1/pods\"},{\"type\":\"v1/services\"},{\"type\":\"networking.k8s.io/v1/ingresses\"},{\"event\":{\"message\":{\"exclude\":[\".*nf_conntrack_buckets.*\"]}},\"type\":\"v1/nodes\"},{\"type\":\"v1/namespaces\"},{\"type\":\"v1/persistentvolumes\"},{\"type\":\"v1/persistentvolumeclaims\"},{\"type\":\"v1/configmaps\"},{\"type\":\"rbac.authorization.k8s.io/v1/roles\"},{\"type\":\"rbac.authorization.k8s.io/v1/rolebindings\"},{\"type\":\"rbac.authorization.k8s.io/v1/clusterrolebindings\"},{\"type\":\"rbac.authorization.k8s.io/v1/clusterroles\"},{\"type\":\"apps/v1/deployments\"},{\"type\":\"apps/v1/statefulsets\"},{\"type\":\"apps/v1/daemonsets\"},{\"type\":\"batch/v1/jobs\"}]}",
Enabled: true,
Rbac: defaultRBAC,
},
{
Expand All @@ -386,6 +391,7 @@ func assertPlugins(t *testing.T, actual []*gqlModel.Plugin) {
Type: "EXECUTOR",
ConfigurationName: "k8s-default-tools",
Configuration: "{\"defaultNamespace\":\"default\"}",
Enabled: true,
Rbac: defaultRBAC,
},
{
Expand All @@ -394,6 +400,70 @@ func assertPlugins(t *testing.T, actual []*gqlModel.Plugin) {
Type: "EXECUTOR",
ConfigurationName: "k8s-default-tools",
Configuration: "{\"defaultNamespace\":\"default\",\"helmCacheDir\":\"/tmp/helm/.cache\",\"helmConfigDir\":\"/tmp/helm/\",\"helmDriver\":\"secret\"}",
Enabled: true,
Rbac: defaultRBAC,
},
{
Name: "botkube/argocd",
DisplayName: "botkube/argocd",
Type: "SOURCE",
ConfigurationName: "argocd",
Configuration: "{\"argoCD\":{\"notificationsConfigMap\":{\"name\":\"argocd-notifications-cm\",\"namespace\":\"argocd\"},\"uiBaseUrl\":\"http://localhost:8080\"},\"defaultSubscriptions\":{\"applications\":[{\"name\":\"guestbook\",\"namespace\":\"argocd\"}]}}",
Enabled: false,
Rbac: defaultRBAC,
},
{
Name: "botkube/keptn",
DisplayName: "botkube/keptn",
Type: "SOURCE",
ConfigurationName: "keptn",
Configuration: "{\"log\":{\"level\":\"info\"},\"project\":\"\",\"service\":\"\",\"token\":\"\",\"url\":\"http://api-gateway-nginx.keptn.svc.cluster.local/api\"}",
Enabled: false,
Rbac: defaultRBAC,
},
{
Name: "botkube/exec",
DisplayName: "botkube/exec",
Type: "EXECUTOR",
ConfigurationName: "bins-management",
Configuration: "{\"templates\":[{\"ref\":\"github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=v1.7.0\"}]}",
Enabled: false,
Rbac: defaultRBAC,
},
{
Name: "botkube/doctor",
DisplayName: "botkube/doctor",
Type: "EXECUTOR",
ConfigurationName: "ai",
Configuration: "{\"apiBaseUrl\":\"\",\"apiKey\":\"\",\"defaultEngine\":\"\",\"organizationID\":\"\",\"userAgent\":\"\"}",
Enabled: false,
Rbac: defaultRBAC,
},
{
Name: "botkube/flux",
DisplayName: "botkube/flux",
Type: "EXECUTOR",
ConfigurationName: "flux",
Configuration: "{\"github\":{\"auth\":{\"accessToken\":\"\"}},\"log\":{\"level\":\"info\"}}",
Enabled: false,
Rbac: defaultRBAC,
},
{
Name: "botkube/kubernetes",
DisplayName: "Kubernetes Errors with AI support",
Type: "SOURCE",
ConfigurationName: "k8s-err-events-with-ai-support",
Configuration: "{\"event\":{\"types\":[\"error\"]},\"extraButtons\":[{\"button\":{\"commandTpl\":\"doctor --resource={{ .Kind | lower }}/{{ .Name }} --namespace={{ .Namespace }} --error={{ .Reason }} --bk-cmd-header='AI assistance'\",\"displayName\":\"Get Help\"},\"enabled\":true,\"trigger\":{\"type\":[\"error\"]}}],\"namespaces\":{\"include\":[\".*\"]},\"resources\":[{\"type\":\"v1/pods\"},{\"type\":\"v1/services\"},{\"type\":\"networking.k8s.io/v1/ingresses\"},{\"event\":{\"message\":{\"exclude\":[\".*nf_conntrack_buckets.*\"]}},\"type\":\"v1/nodes\"},{\"type\":\"v1/namespaces\"},{\"type\":\"v1/persistentvolumes\"},{\"type\":\"v1/persistentvolumeclaims\"},{\"type\":\"v1/configmaps\"},{\"type\":\"rbac.authorization.k8s.io/v1/roles\"},{\"type\":\"rbac.authorization.k8s.io/v1/rolebindings\"},{\"type\":\"rbac.authorization.k8s.io/v1/clusterrolebindings\"},{\"type\":\"rbac.authorization.k8s.io/v1/clusterroles\"},{\"type\":\"apps/v1/deployments\"},{\"type\":\"apps/v1/statefulsets\"},{\"type\":\"apps/v1/daemonsets\"},{\"type\":\"batch/v1/jobs\"}]}",
Enabled: false,
Rbac: defaultRBAC,
},
{
Name: "botkube/prometheus",
DisplayName: "botkube/prometheus",
Type: "SOURCE",
ConfigurationName: "prometheus",
Configuration: "{\"alertStates\":[\"firing\",\"pending\",\"inactive\"],\"ignoreOldAlerts\":true,\"log\":{\"level\":\"info\"},\"url\":\"http://localhost:9090\"}",
Enabled: false,
Rbac: defaultRBAC,
},
}
Expand Down

0 comments on commit 783055c

Please sign in to comment.