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

Add new kuttl test for fully fledged frontend config #197

Closed
Closed
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
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
98 changes: 98 additions & 0 deletions tests/e2e/full-frontend/01-create-resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
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
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"
isExternal: true
- 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
module:
config:
ssoUrl: 'https://'
manifestLocation: /apps/chrome/js/fed-mods.json
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

49 changes: 49 additions & 0 deletions tests/e2e/full-frontend/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
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
---
kind: ConfigMap
apiVersion: v1
metadata:
name: test-full-app-environment
namespace: test-full-app
labels:
frontendenv: test-full-app-environment
ownerReferences:
- apiVersion: cloud.redhat.com/v1alpha1
name: test-full-app-environment
data:
fed-modules.json: '{"chrome":{"manifestLocation":"/apps/chrome/js/fed-mods.json","modules":[{"id":"landing","module":"./RootApp","routes":[{"pathname":"/","exact":true,"permissions":[{"method":"withEmail","args":["@redhat.com",2]}]}]},{"id":"landingFoo","module":"./OtherApp","routes":[{"pathname":"/","exact":true}]}],"config":{"ssoUrl":"https://sso.foo.redhat.com"},"fullProfile":false}}'
Loading