Skip to content

Commit

Permalink
Lengthier README
Browse files Browse the repository at this point in the history
  • Loading branch information
josuah committed Sep 27, 2021
1 parent c9f6541 commit ea199ce
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LOG = notqmail-${REF}-${PATCH}.log

all:v
@test -n '${BRANCH}' -a -n '${PATCH}'
@make log COMMIT=${REF} PATCH=${PATCH}
@make log/${REF}-${PATCH}.log COMMIT=${REF} PATCH=${PATCH}

everything:v
@xargs -I {} -n 1 make patches BRANCH={} <conf-branch
Expand All @@ -18,8 +18,6 @@ patches:v
@ls patch | sed 's/.patch$$//' |\
xargs -I {} -n 1 make BRANCH=${BRANCH} PATCH={}

log:v \
log/${COMMIT}-${PATCH}.log
log/${COMMIT}-${PATCH}.log:
@echo building $@
@-make build COMMIT=${COMMIT} PATCH=${PATCH} >$@.tmp 2>&1
Expand All @@ -41,6 +39,11 @@ notqmail.git:
README.md:v
sh README.sh >$@

brokemaster:v
@make patches BRANCH=${BRANCH}
@make patches BRANCH=master
sh brokemaster.sh ${BRANCH}

clean:v
rm -rf notqmail-*/

Expand Down
47 changes: 47 additions & 0 deletions README.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,50 @@ for patch in patch/*; do
done

echo "</table>"

cat <<EOF
Testing an individual branch/patch combo
----------------------------------------
```
make BRANCH=refactoring PATCH=big-todo
```
This will produce log result in `log/$commit-big-todo.log`.
Testing all patches
-------------------
```
make patches BRANCH=refactoring
```
For instance, after a commit, for checking if patches still
apply or if they need a rework.
Testing all branches
--------------------
```
make branches PATCH=big-todo
```
For instance, after changing a patch to check if it now works
better on notqmail.
Branches tested are listed in `conf-branch`.
Testing all patches and all branches
------------------------------------
```
make everything
```
Checking every merge request
----------------------------
```
make brokemaster BRANCH=refactoring
```
This can be used in a script that automatically runs on merge request.
This will return an error only if the current branch broke more patches
than what master did already.
EOF
17 changes: 17 additions & 0 deletions brokemaster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh -eu
branch=$1

master=$(git -C notqmail.git rev-parse master)
commit=$(git -C notqmail.git rev-parse "$branch")

for patch in patch/*.patch; do
patch=$(basename "$patch" .patch)
if tail -n 1 "log/$master-$patch.log" | grep -qx ok; then
if ! tail -n 1 "log/$commit-$patch.log" | grep -qx ok; then
echo "$branch broke $patch"
brokemaster=$((brokemaster+1))
fi
fi
done

exit ${brokemaster:-0}

0 comments on commit ea199ce

Please sign in to comment.