From 764c752851cee807510062761b6f3f91fa685ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielewski?= Date: Thu, 9 Mar 2023 20:01:44 +0100 Subject: [PATCH] feature: updated Makefile, updated accordingly README.MD --- Makefile | 12 ++++++------ README.MD | 13 +++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 86ee62c..6b88b63 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ assets_dir=./assets # image_tag represents default tag name for docker image image_tag=godog-http-api -all: build env tests-using-docker +all: env download-dependencies build # env creates .env file and populates it with default values env: @@ -32,12 +32,15 @@ env: GODOG_MY_APP_URL=${GODOG_MY_APP_URL}\n\ GODOG_JSON_SCHEMA_DIR=${GODOG_JSON_SCHEMA_DIR}" > .env - # download-dependencies download go packages and godog binary download-dependencies: go mod download go install github.com/cucumber/godog/cmd/godog@v0.12.6 +# build builds docker image from Dockerfile and tags it +build: + docker build -t ${image_tag} . + # clean removes directories with binaries, git repository, github actions workflow and test suite clean: rm -rf ${git_dir} @@ -46,7 +49,7 @@ clean: rm -rf ${features_dir} rm ${gitignore_path} -# tests-using-host demonstrates how tests can be run using host OS +# tests-using-host demonstrates how tests can be run using godog binary on host side # command runs all tests from features/httpbin/* directory tests-using-host: godog --format=progress --concurrency=2 --random ${features_dir}/httpbin @@ -85,6 +88,3 @@ tests-using-compose: down: sudo docker compose down --remove-orphans -# build builds docker image from Dockerfile and tags it -build: - docker build -t ${image_tag} . \ No newline at end of file diff --git a/README.MD b/README.MD index bbac046..1586a67 100644 --- a/README.MD +++ b/README.MD @@ -11,6 +11,19 @@ that implements 🥒[cucumber/gherkin](https://cucumber.io/docs/gherkin/) syntax This project **shorten initial development phase** and allows to quickly bootstrap e2e test framework with **plenty of utility methods**. Just grab it and write tests right away using provided steps! +## Quickstart +**Note**: Some users may require to run some commands with `sudo` +```shell +git clone https://github.com/pawelWritesCode/godog-http-api.git && cd godog-http-api +make all +``` +Afterwards you can run tests using 3 distinct ways +```shell +make tests-using-host +make tests-using-docker +make tests-using-compose +``` + ![features](./assets/svg/features.svg) ## Documentation