From 596ab0047e982bd9a5778e4889d47774a7abc819 Mon Sep 17 00:00:00 2001 From: Niko Abeler Date: Sat, 18 May 2024 19:49:55 +0200 Subject: [PATCH] CI prep + README --- README.md | 46 +++++++++++++++++++++++++-------- e2e_tests/docker-compose.ci.yml | 11 ++++++++ 2 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 e2e_tests/docker-compose.ci.yml diff --git a/README.md b/README.md index 0e60f76..ccce69a 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,9 @@ # Owl Blogs -A simple web server for blogs generated from Markdown files. +Owl-blogs is a blogging software focused on simplicity with IndieWeb and Fediverse support. -**_This project is not yet stable. Expect frequent breaking changes! Only use this if you are willing to regularly adjust your project accordingly._** - - - -## Build - -``` -CGO_ENABLED=1 go build -o owl ./cmd/owl -``` +# Usage ## Run @@ -34,4 +26,36 @@ To retrieve a list of all commands run: ``` owl -h -``` \ No newline at end of file +``` + +# Development + +## Build + +``` +CGO_ENABLED=1 go build -o owl ./cmd/owl +``` + +For development with live reload use `air` ([has to be install first](https://github.com/cosmtrek/air)) + +## Tests + +The project has two test suites; "unit tests" written in go and "end-to-end tests" written in python. + +### Unit Tests + +``` +go test ./... +``` + +### End-to-End tests + +- Start the docker compose setup in the `e2e_tests` directory. +- Install the python dependencies into a virtualenv +``` +cd e2e_tests +python3 -m venv venv +. venv/bin/activate +pip install -r requirements.txt +``` +- Run the e2e_tests with `pytest` diff --git a/e2e_tests/docker-compose.ci.yml b/e2e_tests/docker-compose.ci.yml new file mode 100644 index 0000000..161b153 --- /dev/null +++ b/e2e_tests/docker-compose.ci.yml @@ -0,0 +1,11 @@ +services: + web: + build: + context: ../ + dockerfile: Dockerfile + ports: + - "3000:3000" + mock_masto: + build: mock_masto + ports: + - 8000:8000