Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile with useful repetitive commands #47

Merged
merged 6 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FAKTORY_HOST=127.0.0.1
FAKTORY_PORT=7419
FAKTORY_PORT_UI=7420

check:
jonhoo marked this conversation as resolved.
Show resolved Hide resolved
cargo fmt --check
cargo clippy
cargo d --no-deps --all-features

doc:
RUSTDOCFLAGS='--cfg docsrs' cargo +nightly d --all-features --open

faktory:
docker run --rm -d \
-v faktory-data:/var/lib/faktory \
-p ${FAKTORY_HOST}:${FAKTORY_PORT}:7419 \
-p ${FAKTORY_HOST}:${FAKTORY_PORT_UI}:7420 \
--name faktory \
contribsys/faktory:latest \
/faktory -b :7419 -w :7420

faktory/kill:
docker stop faktory

fmt:
cargo fmt

jonhoo marked this conversation as resolved.
Show resolved Hide resolved
readme:
rustworthy marked this conversation as resolved.
Show resolved Hide resolved
cargo readme > README.md

test:
cargo t --locked --all-features --all-targets

test/doc:
cargo test --locked --all-features --doc

test/e2e:
FAKTORY_URL=tcp://${FAKTORY_HOST}:${FAKTORY_PORT} cargo test --locked --all-features --all-targets

test/load:
cargo run --features binaries
jonhoo marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ After that run the tests:
FAKTORY_URL=tcp://127.0.0.1:7419 cargo test --all-features --locked --all-targets
```
Please note that setting "FAKTORY_URL" environment variable is required for e2e tests to not be skipped.

Provided you have [make](https://www.gnu.org/software/make/#download) installed and `docker` daemon running,
you can launch a `Faktory` container with `make faktory` command. After that, hit `make test/e2e` to run the end-to-end test suite.
Remove the container with `make faktory/kill`, if it's no longer needed.
4 changes: 4 additions & 0 deletions README.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ After that run the tests:
FAKTORY_URL=tcp://127.0.0.1:7419 cargo test --all-features --locked --all-targets
```
Please note that setting "FAKTORY_URL" environment variable is required for e2e tests to not be skipped.

Provided you have [make](https://www.gnu.org/software/make/#download) installed and `docker` daemon running,
you can launch a `Faktory` container with `make faktory` command. After that, hit `make test/e2e` to run the end-to-end test suite.
Remove the container with `make faktory/kill`, if it's no longer needed.
Loading