mirror of
https://github.com/containers/podman-compose.git
synced 2025-06-30 04:30:03 +02:00
Move all tests to single directory "tests"
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
2
tests/integration/env-file-tests/.env
Normal file
2
tests/integration/env-file-tests/.env
Normal file
@ -0,0 +1,2 @@
|
||||
ZZVAR1='This value is overwritten by env-file-tests/.env'
|
||||
ZZVAR3='This value is loaded from env-file-tests/.env'
|
4
tests/integration/env-file-tests/.gitignore
vendored
Normal file
4
tests/integration/env-file-tests/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# This overrides the repository root .gitignore (ignoring all .env).
|
||||
# The .env files in this directory are important for the test cases.
|
||||
!.env
|
||||
!project/.env
|
37
tests/integration/env-file-tests/README.md
Normal file
37
tests/integration/env-file-tests/README.md
Normal file
@ -0,0 +1,37 @@
|
||||
running the following commands should always give podman-rocks-123
|
||||
|
||||
```
|
||||
podman-compose -f project/container-compose.yaml --env-file env-files/project-1.env up
|
||||
```
|
||||
|
||||
```
|
||||
podman-compose -f $(pwd)/project/container-compose.yaml --env-file $(pwd)/env-files/project-1.env up
|
||||
```
|
||||
|
||||
```
|
||||
podman-compose -f $(pwd)/project/container-compose.env-file-flat.yaml up
|
||||
```
|
||||
|
||||
```
|
||||
podman-compose -f $(pwd)/project/container-compose.env-file-obj.yaml up
|
||||
```
|
||||
|
||||
```
|
||||
podman-compose -f $(pwd)/project/container-compose.env-file-obj-optional.yaml up
|
||||
```
|
||||
|
||||
based on environment variable precedent this command should give podman-rocks-321
|
||||
|
||||
```
|
||||
ZZVAR1=podman-rocks-321 podman-compose -f $(pwd)/project/container-compose.yaml --env-file $(pwd)/env-files/project-1.env up
|
||||
```
|
||||
|
||||
_The below test should print three environment variables_
|
||||
|
||||
```
|
||||
podman-compose -f $(pwd)/project/container-compose.load-.env-in-project.yaml run --rm app
|
||||
|
||||
ZZVAR1=This value is overwritten by env-file-tests/.env
|
||||
ZZVAR2=This value is loaded from .env in project/ directory
|
||||
ZZVAR3=This value is loaded from env-file-tests/.env
|
||||
```
|
3
tests/integration/env-file-tests/env-files/project-1.env
Normal file
3
tests/integration/env-file-tests/env-files/project-1.env
Normal file
@ -0,0 +1,3 @@
|
||||
ZZVAR1=podman-rocks-123
|
||||
ZZVAR2=podman-rocks-124
|
||||
ZZVAR3=podman-rocks-125
|
2
tests/integration/env-file-tests/env-files/project-2.env
Normal file
2
tests/integration/env-file-tests/env-files/project-2.env
Normal file
@ -0,0 +1,2 @@
|
||||
ZZVAR1=podman-rocks-223
|
||||
ZZVAR2=podman-rocks-224
|
2
tests/integration/env-file-tests/project/.env
Normal file
2
tests/integration/env-file-tests/project/.env
Normal file
@ -0,0 +1,2 @@
|
||||
ZZVAR1='This value is loaded but should be overwritten'
|
||||
ZZVAR2='This value is loaded from .env in project/ directory'
|
@ -0,0 +1,9 @@
|
||||
services:
|
||||
app:
|
||||
image: busybox
|
||||
command: ["/bin/busybox", "sh", "-c", "env | grep ZZ"]
|
||||
tmpfs:
|
||||
- /run
|
||||
- /tmp
|
||||
env_file:
|
||||
- ../env-files/project-1.env
|
@ -0,0 +1,11 @@
|
||||
services:
|
||||
app:
|
||||
image: busybox
|
||||
command: ["/bin/busybox", "sh", "-c", "env | grep ZZ"]
|
||||
tmpfs:
|
||||
- /run
|
||||
- /tmp
|
||||
env_file:
|
||||
- path: ../env-files/project-1.env
|
||||
- path: ../env-files/project-2.env
|
||||
required: false
|
@ -0,0 +1,9 @@
|
||||
services:
|
||||
app:
|
||||
image: busybox
|
||||
command: ["/bin/busybox", "sh", "-c", "env | grep ZZ"]
|
||||
tmpfs:
|
||||
- /run
|
||||
- /tmp
|
||||
env_file:
|
||||
- path: ../env-files/project-1.env
|
@ -0,0 +1,11 @@
|
||||
services:
|
||||
app:
|
||||
image: busybox
|
||||
command: ["/bin/busybox", "sh", "-c", "env | grep ZZ"]
|
||||
tmpfs:
|
||||
- /run
|
||||
- /tmp
|
||||
environment:
|
||||
ZZVAR1: $ZZVAR1
|
||||
ZZVAR2: $ZZVAR2
|
||||
ZZVAR3: $ZZVAR3
|
@ -0,0 +1,9 @@
|
||||
services:
|
||||
app:
|
||||
image: busybox
|
||||
command: ["/bin/busybox", "sh", "-c", "env | grep ZZ"]
|
||||
tmpfs:
|
||||
- /run
|
||||
- /tmp
|
||||
environment:
|
||||
ZZVAR1: $ZZVAR1
|
Reference in New Issue
Block a user