Split application orchestration by responsibility
This commit is contained in:
parent
f28810ea33
commit
37a7a55bfe
1 changed files with 1545 additions and 1265 deletions
37
tests/application-boundaries.sh
Executable file
37
tests/application-boundaries.sh
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
for module in \
|
||||
src/Nuthatch/Http/Server.hs \
|
||||
src/Nuthatch/Http/Auth.hs \
|
||||
src/Nuthatch/Browse.hs \
|
||||
src/Nuthatch/Transfer.hs \
|
||||
src/Nuthatch/Mutation/Service.hs \
|
||||
src/Nuthatch/Mutation/Recovery.hs \
|
||||
src/Nuthatch/Mutation/Effects.hs; do
|
||||
test -f "$module"
|
||||
done
|
||||
|
||||
test "$(wc -l <src/Nuthatch/App.hs)" -le 40
|
||||
|
||||
if grep -Eq 'Servant|Nuthatch\.Http' \
|
||||
src/Nuthatch/Mutation/Service.hs \
|
||||
src/Nuthatch/Mutation/Recovery.hs \
|
||||
src/Nuthatch/Mutation/Effects.hs; then
|
||||
printf '%s\n' "Mutation protocol services depend on HTTP" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grep -F 'Nuthatch.Mutation.Service' src/Nuthatch/Transfer.hs >/dev/null
|
||||
grep -F 'Nuthatch.Mutation.Service' src/Nuthatch/Http/Server.hs >/dev/null
|
||||
grep -F 'Nuthatch.Mutation.Service' src/Nuthatch/Mutation/Recovery.hs >/dev/null
|
||||
|
||||
if grep -Eq 'recoverOnce|recoverOne|finalizeRecovered|observeObjectWithRetry' \
|
||||
src/Nuthatch/App.hs src/Nuthatch/Http/*.hs; then
|
||||
printf '%s\n' "Recovery implementation leaked into HTTP composition" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf '%s\n' "Application responsibility boundaries passed"
|
||||
Loading…
Reference in a new issue