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

fix(rss2twitter): fix templating and add unit tests (#663) #716

Merged
merged 4 commits into from
Sep 20, 2023
Merged
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
2 changes: 1 addition & 1 deletion charts/rss2twitter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
description: A Helm chart for https://github.com/umputun/rss2twitter
name: rss2twitter
type: application
version: 0.0.4
version: 0.0.5
9 changes: 9 additions & 0 deletions charts/rss2twitter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# RSS 2 Twitter

This chart deploys [rss2twitter](https://github.com/umputun/rss2twitter).

## Running this yourself

```
helm install -f values.yaml -f values.local.yaml --name rss2twitter .
```
32 changes: 32 additions & 0 deletions charts/rss2twitter/tests/custom_values_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
suite: Test with custom values
templates:
- _helper.tpl
- deployment.yaml
- exclusion-patterns-configmap.yaml
- secret.yaml
tests:
- it: should create a Secret with the correct value
set:
twitter:
consumerKey: consumer-key
consumerSecret: consumer-secret
accessToken: access-token
accessSecret: access-secret
template: secret.yaml
asserts:
- hasDocuments:
count: 1
- isKind:
of: Secret
- equal:
path: data.TWI_CONSUMER_KEY
value: Y29uc3VtZXIta2V5
- equal:
path: data.TWI_CONSUMER_SECRET
value: Y29uc3VtZXItc2VjcmV0
- equal:
path: data.TWI_ACCESS_TOKEN
value: YWNjZXNzLXRva2Vu
- equal:
path: data.TWI_ACCESS_SECRET
value: YWNjZXNzLXNlY3JldA==
17 changes: 17 additions & 0 deletions charts/rss2twitter/tests/defaults_values_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
suite: Test with default values
templates:
- _helper.tpl
- deployment.yaml
- exclusion-patterns-configmap.yaml
- secret.yaml
tests:
- it: should define the default deployment with the image umputun/rss2twitter
template: deployment.yaml
asserts:
- hasDocuments:
count: 1
- isKind:
of: Deployment
- equal:
path: spec.template.spec.containers[0].image
value: umputun/rss2twitter:v0.7.0
8 changes: 7 additions & 1 deletion charts/rss2twitter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ podSecurityContext: {}
securityContext:
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsUser: 1001 # app
resources: {}
Expand All @@ -40,3 +40,9 @@ env:
# disables publishing to twitter and sends updates to logger only
dryMode: true
debugMode: false

twitter:
consumerKey: ""
consumerSecret: ""
accessToken: ""
accessSecret: ""