Skip to content

Commit

Permalink
feature: updated Makefile, updated accordingly README.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelWritesCode committed Mar 9, 2023
1 parent 12fc7f7 commit 764c752
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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} .
13 changes: 13 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 764c752

Please # to comment.