-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04a1441
commit eec8025
Showing
2 changed files
with
66 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Docker Image Structural Testing | ||
The configuration file `test/config.yaml` defines various "structural" checks to perform on the docker image created by `../Dockerfile`. | ||
|
||
The test require the use of the [container-structure-test](https://github.com/GoogleContainerTools/container-structure-test) from Google. | ||
|
||
Follow their documentation to install. | ||
|
||
## Usage | ||
Generate your docker image using your preferred method e.g. | ||
```shell | ||
docker build -t api . | ||
``` | ||
|
||
To run the tests against the image, run the following: | ||
```shell | ||
container-structure-test test --image api --config tests/config.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,49 @@ | ||
schemaVersion: 2.0.0 | ||
|
||
commandTests: | ||
- name: check psql is installed | ||
command: psql | ||
args: ["--version"] | ||
exitCode: 0 | ||
- name: check django is installed | ||
command: pip | ||
args: ["show", "-q", "Django"] | ||
exitCode: 0 | ||
- name: check djangorestframework is installed | ||
command: pip | ||
args: ["show", "-q", "djangorestframework"] | ||
exitCode: 0 | ||
- name: check psycopg2 is installed | ||
command: pip | ||
args: ["show", "-q", "psycopg2"] | ||
exitCode: 0 | ||
- name: check Pillow is installed | ||
command: pip | ||
args: ["show", "-q", "Pillow"] | ||
exitCode: 0 | ||
- name: check uwsgi is installed | ||
command: pip | ||
args: ["show", "-q", "uwsgi"] | ||
exitCode: 0 | ||
- name: check flake8 is installed | ||
command: pip | ||
args: ["show", "-q", "flake8"] | ||
exitCode: 0 | ||
|
||
fileExistenceTests: | ||
- name: entrypoint | ||
path: /scripts/entrypoint.sh | ||
shouldExist: true | ||
permissions: "-rwxr-xr-x" | ||
- name: requirements | ||
path: /requirements.txt | ||
shouldExist: true | ||
permissions: "-rw-r--r--" | ||
- name: /vol/web/media | ||
path: /vol/web/media | ||
shouldExist: true | ||
permissions: "drwxr-xr-x" | ||
- name: /vol/web/static | ||
path: /vol/web/static | ||
shouldExist: true | ||
permissions: "drwxr-xr-x" |