Skip to content

Commit

Permalink
Add new kuttl test for fully fledged frontend config
Browse files Browse the repository at this point in the history
  • Loading branch information
florkbr committed Oct 14, 2024
1 parent d613e23 commit 54beab5
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/e2e/full-frontend/00-create-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: test-full-app
spec:
finalizers:
- kubernetes
97 changes: 97 additions & 0 deletions tests/e2e/full-frontend/01-create-resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
apiVersion: cloud.redhat.com/v1alpha1
kind: FrontendEnvironment
metadata:
name: test-full-app-environment
spec:
generateNavJSON: false
ssl: false
hostname: foo.redhat.com
sso: https://sso.foo.redhat.com
---
apiVersion: cloud.redhat.com/v1alpha1
kind: Frontend
metadata:
name: chrome
namespace: test-full-app
spec:
API:
versions:
- v1
frontend:
paths:
- /
deploymentRepo: https://github.com/RedHatInsights/insights-chrome
envName: test-full-app-environment
image: quay.io/cloudservices/insights-chrome-frontend:720317c
module:
config:
ssoUrl: 'https://'
manifestLocation: /apps/chrome/js/fed-mods.json
serviceTiles:
- section: "section1"
group: "group"
id: "id"
href: "www.redhat.com"
title: "Service 1"
icon: "icon.png"
isExternal: true
- section: "section2"
group: "group"
id: "id2"
href: "www.redhat.com"
title: "Service 2"
icon: "icon.png"
searchEntries:
- id: "id1"
href: "www.redhat.com"
title: "Search Result 1"
description: "the quick brown fox"
alt_title:
- "foo"
- id: "id2"
href: "www.redhat.com"
title: "Search Result 2"
description: "lorem ipsum"
alt_title:
- "foo"
- "bar"
isExternal: true
widgetRegistry:
- scope: "foobar"
module: "./RootApp"
config:
icon: "icon.png"
title: "Widget Title"
- scope: "foobar"
module: "./OtherApp"
config:
icon: "icon.png"
title: "Other Widget Title"
headerLink:
href: "www.redhat.com"
title: "Redhat Site"
permissions:
- method: withEmail
args:
- "@redhat.com"
- 2
- method: isOrgAdmin
modules:
- id: "landing"
module: "./RootApp"
routes:
- pathname: /
exact: true
permissions:
- method: withEmail
args:
- "@redhat.com"
- 2
- id: "landingFoo"
module: "./OtherApp"
routes:
- pathname: /
exact: true
title: Chrome

36 changes: 36 additions & 0 deletions tests/e2e/full-frontend/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: chrome-frontend
namespace: test-full-app
labels:
frontend: chrome
ownerReferences:
- apiVersion: cloud.redhat.com/v1alpha1
kind: Frontend
name: chrome
spec:
selector:
matchLabels:
frontend: chrome
template:
spec:
volumes:
- name: config
configMap:
name: test-full-app-environment
defaultMode: 420
containers:
- name: fe-image
image: 'quay.io/cloudservices/insights-chrome-frontend:720317c'
ports:
- name: web
containerPort: 80
protocol: TCP
- name: metrics
containerPort: 9000
protocol: TCP
volumeMounts:
- name: config
mountPath: /opt/app-root/src/build/stable/operator-generated

0 comments on commit 54beab5

Please sign in to comment.