Skip to content

Commit

Permalink
Dockerize unit tests (#581)
Browse files Browse the repository at this point in the history
Merge Docker stuff for ease of local testing.
  • Loading branch information
sei-vsarvepalli authored Jun 25, 2024
2 parents 675d49e + 92bee31 commit ead5217
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.12-slim-bookworm

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"]
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ead5217

Please sign in to comment.