Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target/
**/*.rs.bk
perf.*
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FAKTORY_HOST=127.0.0.1
FAKTORY_PORT=7419
FAKTORY_PORT_UI=7420

.PHONY: check
check:
cargo fmt --check
cargo clippy
cargo d --no-deps --all-features

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

.PHONY: faktory
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

.PHONY: faktory/kill
faktory/kill:
docker stop faktory

README.md: README.tpl src/lib.rs
cargo readme > README.md

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

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

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

.PHONY: test/load
test/load:
cargo run --release --features binaries

.PHONY: test/perf
test/perf:
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -o perf.flamegraph.svg -f binaries -b loadtest

.PHONY: test/perf/clean
test/perf/clean:
rm perf.*
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.