-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add tests for ensuring project source and root are first env vars
Signed-off-by: Andrew Obuchowicz <[email protected]>
- Loading branch information
Showing
6 changed files
with
134 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
...library/container/testdata/mountsources/projects-source-and-root-first-env-vars.yaml.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: "Ensures PROJECT_ROOT and PROJECT_SOURCE env vars are first in list of env vars" | ||
|
||
input: | ||
projects: | ||
- name: test_project | ||
clonePath: clone-path | ||
components: | ||
- name: testing-container-1 | ||
container: | ||
image: testing-image-1 | ||
memoryRequest: "-1" # isolate test to not include this field | ||
memoryLimit: "-1" # isolate test to not include this field | ||
cpuRequest: "-1" # isolate test to not include this field | ||
cpuLimit: "-1" # isolate test to not include this field | ||
# no mountSources defined -> should mount sources | ||
env: | ||
- name: user-env-var-1 | ||
value: value1 | ||
- name: user-env-var-1 | ||
value: value1 | ||
- name: testing-container-2 | ||
container: | ||
image: testing-image-2 | ||
memoryRequest: "-1" # isolate test to not include this field | ||
memoryLimit: "-1" # isolate test to not include this field | ||
cpuRequest: "-1" # isolate test to not include this field | ||
cpuLimit: "-1" # isolate test to not include this field | ||
# No sourceMapping -> defaults to "/projects" | ||
mountSources: true # mountSources: true -> should mount sources | ||
env: | ||
- name: user-env-var-2 | ||
value: value1 | ||
- name: user-env-var-3 | ||
value: value1 | ||
- name: testing-container-3 | ||
container: | ||
image: testing-image-3 | ||
memoryRequest: "-1" # isolate test to not include this field | ||
memoryLimit: "-1" # isolate test to not include this field | ||
cpuRequest: "-1" # isolate test to not include this field | ||
cpuLimit: "-1" # isolate test to not include this field | ||
sourceMapping: "/projects" | ||
mountSources: false # mountSources: false -> should not mount sources | ||
env: | ||
- name: user-env-var-4 | ||
value: value1 | ||
- name: user-env-var-5 | ||
value: value1 | ||
output: | ||
podAdditions: | ||
containers: | ||
- name: testing-container-1 | ||
image: testing-image-1 | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "-1" | ||
cpu: "-1" | ||
limits: | ||
memory: "-1" | ||
cpu: "-1" | ||
volumeMounts: | ||
- name: "projects" | ||
mountPath: "/projects" | ||
env: | ||
- name: "PROJECTS_ROOT" | ||
value: "/projects" | ||
- name: "PROJECT_SOURCE" | ||
value: "/projects/clone-path" | ||
- name: "DEVWORKSPACE_COMPONENT_NAME" | ||
value: "testing-container-1" | ||
- name: user-env-var-1 | ||
value: value1 | ||
- name: user-env-var-1 | ||
value: value1 | ||
- name: testing-container-2 | ||
image: testing-image-2 | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "-1" | ||
cpu: "-1" | ||
limits: | ||
memory: "-1" | ||
cpu: "-1" | ||
volumeMounts: | ||
- name: "projects" | ||
mountPath: "/projects" | ||
env: | ||
- name: "PROJECTS_ROOT" | ||
value: "/projects" | ||
- name: "PROJECT_SOURCE" | ||
value: "/projects/clone-path" | ||
- name: "DEVWORKSPACE_COMPONENT_NAME" | ||
value: "testing-container-2" | ||
- name: user-env-var-2 | ||
value: value1 | ||
- name: user-env-var-3 | ||
value: value1 | ||
- name: testing-container-3 | ||
image: testing-image-3 | ||
imagePullPolicy: Always | ||
env: | ||
- name: "DEVWORKSPACE_COMPONENT_NAME" | ||
value: "testing-container-3" | ||
- name: user-env-var-4 | ||
value: value1 | ||
- name: user-env-var-5 | ||
value: value1 | ||
resources: | ||
requests: | ||
memory: "-1" | ||
cpu: "-1" | ||
limits: | ||
memory: "-1" | ||
cpu: "-1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters