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

Add regression testing #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion bench
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ if [[ -d "$(pwd)/.sass-cache" ]]; then
rm -rf "$(pwd)/.sass-cache"
fi

if [[ -z $DESTINATION_DIR ]]; then
DESTINATION_DIR="destination"
fi

for SITE in $(cat "site-list"); do
echo ""
echo "Sampling: $SITE"
echo ""
SOURCE="$TMPDIR/source/${SITE##*/}"
DESTINATION=${SOURCE/source/destination}
DESTINATION=${SOURCE/source/$DESTINATION_DIR}
if [[ ! -d $SOURCE ]]; then
git clone --recurse-submodules -q "$SITE" "$SOURCE"
fi
Expand Down
39 changes: 39 additions & 0 deletions regression
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# After running `./bench` twice on different versions of Jekyll, this command
# will diff the different builds of each site and complain if they are not
# identical. This will help catch unintentional changes in Jekyll's behavior.

set -e
ulimit -t 1200

function checkFailedBuild {
if [[ $? != 0 ]]; then
echo "Build failed"
exit 1
fi
}

trap checkFailedBuild Exit

# Create tmp/ directory
TMPDIR="$(pwd)/sites"
if [[ -d $TMPDIR ]]; then
rm -rf "$TMPDIR"
fi

SUCCESS=0

for SITE in $(cat "site-list"); do
echo ""
echo "Diffing: $SITE"
echo ""
SOURCE="$TMPDIR/$OLD/${SITE##*/}"
DESTINATION=${SOURCE/$OLD/$NEW}
diff -r $SOURCE $DESTINATION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all that's needed to diff two files? Cool! 🙂

if (( $? != 0 )); then
SUCCESS=1
fi
done

exit $SUCCESS