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

feat: parameteriized sim names in ttk env #450

Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 7 additions & 2 deletions ml-testing-toolkit-cli/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $PARAMETERS := .Values.parameters -}}
{{- $RELEASE_NAME := .Release.Name -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -23,5 +25,8 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
cli-testcase-environment.json: |
{{ .Values.testCaseEnvironmentFile | toJson | replace "$release_name" .Release.Name }}
{{- $environmentFileContent := (.Values.testCaseEnvironmentFile | toPrettyJson | squote | replace "$release_name" $RELEASE_NAME) -}}
{{- range $paramName, $paramValue := $PARAMETERS }}
{{- $environmentFileContent = ($environmentFileContent | replace (printf "$param_%s" $paramName) $paramValue) -}}
{{- end }}
cli-testcase-environment.json: {{ ($environmentFileContent) }}
2 changes: 2 additions & 0 deletions ml-testing-toolkit-cli/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ config:
testSuiteName: GP Tests
environmentName: Development

## Optionally you can specify some parameters here and the references in the environment file like the format '$param_<Param Name>' will be replaced with their values specified here
parameters: {}
configCreds:
## Define AWS Config
AWS_ACCESS_KEY_ID: 'some_aws_access_key'
Expand Down
7 changes: 6 additions & 1 deletion ml-testing-toolkit/chart-backend/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- $RELEASE_NAME := .Release.Name -}}
{{- $MONGODB := (.Values.dependencies.mongodb) -}}
{{- $PARAMETERS := .Values.parameters -}}
{{- $CONNECTION_MANAGER := (.Values.dependencies.connectionManagerBackend) -}}
{{- $API_AUTHENTICATION := index .Values.dependencies (ternary "keycloak" "adminApiAuthentication" .Values.dependencies.keycloak.enabled) -}}
apiVersion: v1
Expand Down Expand Up @@ -29,5 +30,9 @@ metadata:
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
{{- range $k, $v := .Values.extraEnvironments }}
{{ $k }}: {{ ($v | toPrettyJson | squote | replace "$release_name" $RELEASE_NAME) }}
{{- $environmentFileContent := ($v | toPrettyJson | squote | replace "$release_name" $RELEASE_NAME) -}}
{{- range $paramName, $paramValue := $PARAMETERS }}
{{- $environmentFileContent = ($environmentFileContent | replace (printf "$param_%s" $paramName) $paramValue) -}}
{{- end }}
{{ $k }}: {{ ($environmentFileContent) }}
{{- end }}
1 change: 1 addition & 0 deletions ml-testing-toolkit/chart-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ config:
}

extraEnvironments: {}
parameters: {}

service:
type: ClusterIP
Expand Down
Loading