Skip to content
Open
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 @@
.idea
tampermonkey_scripts
.annertech_tests_timestamps
4 changes: 4 additions & 0 deletions commands/web/behat
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ fi

# Run behat with the provided flags/arguments
bin/behat "$@"

# Create/update timestamp file
cd ../..
touch ${DDEV_APPROOT}/.ddev/.annertech_tests_timestamps
24 changes: 24 additions & 0 deletions scripts/git-hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

# Annertech's tests timestamps file
TIMESTAMP_FILE=.ddev/.annertech_tests_timestamps

# Check if the timestamp is more recent than 1 hour
one_hour_ago=$(date -d '-1 hour' "+%s")
last_test_run=$(date -r $TIMESTAMP_FILE "+%s")
if [ $one_hour_ago -gt $last_test_run ];
then
read -r -p "You haven't run tests recently. Do you want to run them now? [y/N] " response < /dev/tty
case "$response" in [yY][eE][sS]|[yY])
# Disallow the push
echo git push aborted. Run your testing suite and git push again
exit 1
;;
*)
echo pushing...
;;
esac
fi

# Allow the push.
exit 0
27 changes: 0 additions & 27 deletions scripts/git-hooks/pre-push.wip

This file was deleted.