This PR's main goal is to add a pre-push hook to enforce "make check" tests to pass before one is able to push to the remote.
In order to be able to push this PR to remote I had to:
disable the tests for parsePy (referenced in issue #26)
added 2 required function declarations in poet_yacc.y to address a build error in C99
To test the pre-push hook in this PR, please follow these steps:
checkout feat-add-hooks
edit to add: might want to fork the repo and experiment on a forked version for the following steps
checkout a new branch (based on feat-add-hooks so you get the hook)
might require rebuilding POET depending on your system
update git's default hooks directory (local only to this repository) with:
find .git/hooks -type l -exec rm {} \; //removes any already existing symlinks
find hooks -type f -exec ln -sf ../../{} .git/hooks/ \; //creates a symlink to hooks/pre-push
make a small test change and commit
for example, to see the pre-push hook rejecting pushes when make check doesn't pass, one can add parsePy to testdirs in configure.ac to re-enable parsePy tests
git push --> this should push if tests pass
Future developments
I'd like to add a script to run during build so that the user does not have to manually create symlinks mentioned previously in step 3
Users are still able to bypass this hook by using git push --no-verify so we still need a server-side hook (Github actions?)
This PR's main goal is to add a pre-push hook to enforce "make check" tests to pass before one is able to push to the remote.
In order to be able to push this PR to remote I had to:
To test the pre-push hook in this PR, please follow these steps:
checkout feat-add-hooks
find .git/hooks -type l -exec rm {} \;
//removes any already existing symlinksfind hooks -type f -exec ln -sf ../../{} .git/hooks/ \;
//creates a symlink to hooks/pre-pushparsePy
totestdirs
inconfigure.ac
to re-enable parsePy testsgit push
--> this should push if tests passFuture developments
git push --no-verify
so we still need a server-side hook (Github actions?)