Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #317 from xwp/feature/run-after-tests
Browse files Browse the repository at this point in the history
Add run_after_tests function
  • Loading branch information
derekherman authored Apr 28, 2020
2 parents f0864d9 + a2e8c53 commit e9f2a93
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
codecept.phar
/vendor/
/node_modules/
.idea
6 changes: 5 additions & 1 deletion sample-config/.dev-lib
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash

function run_tests {
# Run your custom checks before the default linters, tests, etc.
# Run your custom tests before the default linters, tests, etc.
}

function run_after_tests {
# Run your custom tests after the default linters, tests, etc.
}

function after_wp_install {
Expand Down
7 changes: 6 additions & 1 deletion scripts/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ install_tools
echo "## Checking files, scope $CHECK_SCOPE:"
cat "$TEMP_DIRECTORY/paths-scope"

# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib
# Run any custom tests by defining a run_tests function, see sample-scripts/.dev-lib
if [ "$( type -t run_tests )" != '' ]; then
run_tests
fi
Expand All @@ -56,6 +56,11 @@ run_qunit
run_phpunit_local
run_codeception

# Run any custom tests after all other tests by defining a run_after_tests function, see sample-scripts/.dev-lib
if [ "$( type -t run_after_tests )" != '' ]; then
run_after_tests
fi

# Make sure the readme.md never gets out of sync with the readme.txt, if it is staged for commit.
if [[ $SYNC_README_MD == 1 ]] && [ -e readme.txt ] && cat "$TEMP_DIRECTORY/paths-scope" | remove_diff_range | grep -sqE '^readme\.txt$'; then
MARKDOWN_README_PATH=$($DEV_LIB_PATH/generate-markdown-readme)
Expand Down
7 changes: 6 additions & 1 deletion scripts/travis.script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [[ -z $SKIP_ECHO_PATHS_SCOPE ]] && [[ $CHECK_SCOPE != "all" ]]; then
fi
echo

# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib
# Run any custom tests by defining a run_tests function, see sample-scripts/.dev-lib
if [ "$( type -t run_tests )" != '' ]; then
run_tests
fi
Expand All @@ -20,3 +20,8 @@ lint_xml_files
run_qunit
run_phpunit_travisci
run_codeception

# Run any custom tests after all other tests by defining a run_after_tests function, see sample-scripts/.dev-lib
if [ "$( type -t run_after_tests )" != '' ]; then
run_after_tests
fi

0 comments on commit e9f2a93

Please sign in to comment.