Skip to content

Commit 3b0d0da

Browse files
committed
Add test for complex envvars with special characters
This requires changing the test inputs to expect JSON instead of K=V pairs in our e2e runner.
1 parent 4d52883 commit 3b0d0da

File tree

6 files changed

+318
-233
lines changed

6 files changed

+318
-233
lines changed

.github/workflows/integration.yml

Lines changed: 77 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
service: '${{ env.SERVICE_NAME }}'
6363
env_vars: |-
6464
FOO=bar
65-
ZIP=zap
65+
ZIP=zap\,with|separators\,and&stuff
6666
env_vars_file: './tests/fixtures/env_vars.txt'
6767
secrets: |-
6868
MY_SECRET=${{ vars.SECRET_NAME }}:latest
@@ -77,10 +77,28 @@ jobs:
7777
env:
7878
PROJECT_ID: ${{ vars.PROJECT_ID }}
7979
SERVICE: '${{ env.SERVICE_NAME }}'
80-
ENV: 'FOO=bar,ZIP=zap,TEXT_FOO=bar,TEXT_ZIP=zap'
81-
SECRET_ENV: MY_SECRET=${{ vars.SECRET_NAME }}:latest,MY_SECOND_SECRET=${{ vars.SECRET_NAME }}:1
82-
PARAMS: '{"cpu":2, "containerConcurrency":20}'
83-
LABELS: '{"label1":"value1", "label2":"value2"}'
80+
ENV: |-
81+
{
82+
"FOO": "bar",
83+
"ZIP": "zap,with|separators,and&stuff",
84+
"TEXT_FOO": "bar",
85+
"TEXT_ZIP": "zap"
86+
}
87+
SECRET_ENV: |-
88+
{
89+
"MY_SECRET": "${{ vars.SECRET_NAME }}:latest",
90+
"MY_SECOND_SECRET": "${{ vars.SECRET_NAME }}:1"
91+
}
92+
PARAMS: |-
93+
{
94+
"cpu": "2",
95+
"containerConcurrency": "20"
96+
}
97+
LABELS: |-
98+
{
99+
"label1": "value1",
100+
"label2": "value2"
101+
}
84102
85103
- id: 'deploy-cloudrun-again'
86104
name: 'Deploy again'
@@ -98,11 +116,36 @@ jobs:
98116
env:
99117
PROJECT_ID: ${{ vars.PROJECT_ID }}
100118
SERVICE: '${{ env.SERVICE_NAME }}'
101-
ENV: 'FOO=bar,ZIP=zap,TEXT_FOO=bar,TEXT_ZIP=zap,ABC=123,DEF=456'
102-
SECRET_ENV: MY_SECRET=${{ vars.SECRET_NAME }}:latest,MY_SECOND_SECRET=${{ vars.SECRET_NAME }}:1
103-
SECRET_VOLUMES: /api/secrets/my-secret=${{ vars.SECRET_NAME }}:latest
104-
PARAMS: '{"cpu":2, "containerConcurrency":20}'
105-
LABELS: '{"label1":"value1", "label2":"value2", "commit-sha":"${{ github.sha }}", "managed-by":"github-actions"}'
119+
ENV: |-
120+
{
121+
"FOO": "bar",
122+
"ZIP": "zap",
123+
"TEXT_FOO": "bar",
124+
"TEXT_ZIP": "zap",
125+
"ABC": "123",
126+
"DEF": "456"
127+
}
128+
SECRET_ENV: |-
129+
{
130+
"MY_SECRET": "${{ vars.SECRET_NAME }}:latest",
131+
"MY_SECOND_SECRET": "${{ vars.SECRET_NAME }}:1"
132+
}
133+
SECRET_VOLUMES: |-
134+
{
135+
"/api/secrets/my-secret": "${{ vars.SECRET_NAME }}:latest"
136+
}
137+
PARAMS: |-
138+
{
139+
"cpu": "2",
140+
"containerConcurrency": "20"
141+
}
142+
LABELS: |-
143+
{
144+
"label1": "value1",
145+
"label2": "value2",
146+
"commit-sha": "${{ github.sha }}",
147+
"managed-by": "github-actions"
148+
}'
106149
REVISION_COUNT: 2
107150

108151
metadata:
@@ -141,9 +184,20 @@ jobs:
141184
env:
142185
PROJECT_ID: '${{ vars.PROJECT_ID }}'
143186
SERVICE: '${{ env.SERVICE_NAME }}'
144-
PARAMS: '{"cpu":2, "memory":"1Gi", "containerConcurrency":20}'
145-
ANNOTATIONS: '{"run.googleapis.com/cloudsql-instances":"test-project:us-central1:my-test-instance"}'
146-
LABELS: '{"test_label":"test_value"}'
187+
PARAMS: |-
188+
{
189+
"cpu": "2",
190+
"memory": "1Gi",
191+
"containerConcurrency": "20"
192+
}
193+
ANNOTATIONS: |-
194+
{
195+
"run.googleapis.com/cloudsql-instances": "test-project:us-central1:my-test-instance"
196+
}
197+
LABELS: |-
198+
{
199+
"test_label": "test_value"
200+
}
147201
148202
- id: 'deploy-cloudrun-again'
149203
name: 'Deploy again'
@@ -156,6 +210,14 @@ jobs:
156210
env:
157211
PROJECT_ID: '${{ vars.PROJECT_ID }}'
158212
SERVICE: '${{ env.SERVICE_NAME }}'
159-
PARAMS: '{"cpu":2, "memory":"1Gi", "containerConcurrency":20}'
160-
ANNOTATIONS: '{"run.googleapis.com/cloudsql-instances":"test-project:us-central1:my-test-instance"}'
213+
PARAMS: |-
214+
{
215+
"cpu": "2",
216+
"memory": "1Gi",
217+
"containerConcurrency": "20"
218+
}
219+
ANNOTATIONS: |-
220+
{
221+
"run.googleapis.com/cloudsql-instances": "test-project:us-central1:my-test-instance"
222+
}
161223
REVISION_COUNT: 2

dist/main/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)