Skip to content

Commit

Permalink
Add test for complex envvars with special characters
Browse files Browse the repository at this point in the history
This requires changing the test inputs to expect JSON instead of K=V pairs in our e2e runner.
  • Loading branch information
sethvargo committed Mar 28, 2024
1 parent 4d52883 commit 3b0d0da
Show file tree
Hide file tree
Showing 6 changed files with 318 additions and 233 deletions.
92 changes: 77 additions & 15 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
service: '${{ env.SERVICE_NAME }}'
env_vars: |-
FOO=bar
ZIP=zap
ZIP=zap\,with|separators\,and&stuff
env_vars_file: './tests/fixtures/env_vars.txt'
secrets: |-
MY_SECRET=${{ vars.SECRET_NAME }}:latest
Expand All @@ -77,10 +77,28 @@ jobs:
env:
PROJECT_ID: ${{ vars.PROJECT_ID }}
SERVICE: '${{ env.SERVICE_NAME }}'
ENV: 'FOO=bar,ZIP=zap,TEXT_FOO=bar,TEXT_ZIP=zap'
SECRET_ENV: MY_SECRET=${{ vars.SECRET_NAME }}:latest,MY_SECOND_SECRET=${{ vars.SECRET_NAME }}:1
PARAMS: '{"cpu":2, "containerConcurrency":20}'
LABELS: '{"label1":"value1", "label2":"value2"}'
ENV: |-
{
"FOO": "bar",
"ZIP": "zap,with|separators,and&stuff",
"TEXT_FOO": "bar",
"TEXT_ZIP": "zap"
}
SECRET_ENV: |-
{
"MY_SECRET": "${{ vars.SECRET_NAME }}:latest",
"MY_SECOND_SECRET": "${{ vars.SECRET_NAME }}:1"
}
PARAMS: |-
{
"cpu": "2",
"containerConcurrency": "20"
}
LABELS: |-
{
"label1": "value1",
"label2": "value2"
}
- id: 'deploy-cloudrun-again'
name: 'Deploy again'
Expand All @@ -98,11 +116,36 @@ jobs:
env:
PROJECT_ID: ${{ vars.PROJECT_ID }}
SERVICE: '${{ env.SERVICE_NAME }}'
ENV: 'FOO=bar,ZIP=zap,TEXT_FOO=bar,TEXT_ZIP=zap,ABC=123,DEF=456'
SECRET_ENV: MY_SECRET=${{ vars.SECRET_NAME }}:latest,MY_SECOND_SECRET=${{ vars.SECRET_NAME }}:1
SECRET_VOLUMES: /api/secrets/my-secret=${{ vars.SECRET_NAME }}:latest
PARAMS: '{"cpu":2, "containerConcurrency":20}'
LABELS: '{"label1":"value1", "label2":"value2", "commit-sha":"${{ github.sha }}", "managed-by":"github-actions"}'
ENV: |-
{
"FOO": "bar",
"ZIP": "zap",
"TEXT_FOO": "bar",
"TEXT_ZIP": "zap",
"ABC": "123",
"DEF": "456"
}
SECRET_ENV: |-
{
"MY_SECRET": "${{ vars.SECRET_NAME }}:latest",
"MY_SECOND_SECRET": "${{ vars.SECRET_NAME }}:1"
}
SECRET_VOLUMES: |-
{
"/api/secrets/my-secret": "${{ vars.SECRET_NAME }}:latest"
}
PARAMS: |-
{
"cpu": "2",
"containerConcurrency": "20"
}
LABELS: |-
{
"label1": "value1",
"label2": "value2",
"commit-sha": "${{ github.sha }}",
"managed-by": "github-actions"
}'
REVISION_COUNT: 2

metadata:
Expand Down Expand Up @@ -141,9 +184,20 @@ jobs:
env:
PROJECT_ID: '${{ vars.PROJECT_ID }}'
SERVICE: '${{ env.SERVICE_NAME }}'
PARAMS: '{"cpu":2, "memory":"1Gi", "containerConcurrency":20}'
ANNOTATIONS: '{"run.googleapis.com/cloudsql-instances":"test-project:us-central1:my-test-instance"}'
LABELS: '{"test_label":"test_value"}'
PARAMS: |-
{
"cpu": "2",
"memory": "1Gi",
"containerConcurrency": "20"
}
ANNOTATIONS: |-
{
"run.googleapis.com/cloudsql-instances": "test-project:us-central1:my-test-instance"
}
LABELS: |-
{
"test_label": "test_value"
}
- id: 'deploy-cloudrun-again'
name: 'Deploy again'
Expand All @@ -156,6 +210,14 @@ jobs:
env:
PROJECT_ID: '${{ vars.PROJECT_ID }}'
SERVICE: '${{ env.SERVICE_NAME }}'
PARAMS: '{"cpu":2, "memory":"1Gi", "containerConcurrency":20}'
ANNOTATIONS: '{"run.googleapis.com/cloudsql-instances":"test-project:us-central1:my-test-instance"}'
PARAMS: |-
{
"cpu": "2",
"memory": "1Gi",
"containerConcurrency": "20"
}
ANNOTATIONS: |-
{
"run.googleapis.com/cloudsql-instances": "test-project:us-central1:my-test-instance"
}
REVISION_COUNT: 2
6 changes: 3 additions & 3 deletions dist/main/index.js

Large diffs are not rendered by default.

0 comments on commit 3b0d0da

Please sign in to comment.