From 87c71b286d0d4ee8a8bc9183529669cbf9e80f28 Mon Sep 17 00:00:00 2001 From: "Allen D. Householder" Date: Thu, 13 Jun 2024 09:56:50 -0400 Subject: [PATCH 1/4] empty dockerfile --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..ee827a92 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM ubuntu:latest +LABEL authors="adh" + +ENTRYPOINT ["top", "-b"] \ No newline at end of file From 5950b4a45f6ca6674bfce35218925fe95cd9cae2 Mon Sep 17 00:00:00 2001 From: "Allen D. Householder" Date: Thu, 13 Jun 2024 10:30:28 -0400 Subject: [PATCH 2/4] Dockerfile to run pytest --- Dockerfile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee827a92..23db2cbd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,18 @@ -FROM ubuntu:latest -LABEL authors="adh" +FROM python:3.11 -ENTRYPOINT ["top", "-b"] \ No newline at end of file +WORKDIR /app + +# install requirements +COPY requirements.txt . +RUN pip install -r requirements.txt + +# Copy the files we need +COPY src/ . +COPY data ./data + +# install pytest +RUN pip install pytest + +# run the unit tests \ +ENTRYPOINT ["pytest"] +CMD ["test"] From 641ddd3774b09281d1b94e9e6d62a2514d987b9c Mon Sep 17 00:00:00 2001 From: "Allen D. Householder" Date: Thu, 13 Jun 2024 10:48:05 -0400 Subject: [PATCH 3/4] Mention docker in README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 2af0f382..ae0a2910 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,29 @@ Navigate to http://localhost:8001/ to see the site. (Hint: You can use the `--dev-addr` argument with mkdocs to change the port, e.g. `mkdocs serve --dev-addr localhost:8000`) +## Run tests + +We include a few tests for the `ssvc` module. + +### With Docker + +```bash + +docker build -t ssvc_test . +docker run -it --rm ssvc_test +``` + +### Without Docker + +```bash +pip install pytest # if you haven't already + +pytest # should find tests in src/test/* +``` + + + + ## Contributing - [SSVC Community Engagement](https://certcc.github.io/SSVC/about/contributing/) has more detail on how to contribute to the project. From 92bee317511f7107ea4574bbc66a2c87c6a5bcfa Mon Sep 17 00:00:00 2001 From: "Allen D. Householder" Date: Thu, 13 Jun 2024 11:37:04 -0400 Subject: [PATCH 4/4] use 3.12 slim bookworm as base container --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 23db2cbd..37a6d682 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11 +FROM python:3.12-slim-bookworm WORKDIR /app