ci: Improve pre-commit-hook testing#421
Conversation
…ommit-hooks into feat/improve-testing
SMoraisAnsys
left a comment
There was a problem hiding this comment.
Thanks for the changes @klmcadams, just wondering if we should think about using prek instead of pre-commit in the tests given the discussion we had in the past. Might be something to question in our meeting to know how many of us started to migrate to prek.
| cp ../hooks-repo/tests/test_tech_review_files/AUTHORS . | ||
| cp ../hooks-repo/tests/test_tech_review_files/CODE_OF_CONDUCT.md . | ||
| cp ../hooks-repo/tests/test_tech_review_files/CONTRIBUTING.md . | ||
| cp "../hooks-repo/tests/test_tech_review_files/dependabot_pyproject.yml" .github/dependabot.yml || true |
There was a problem hiding this comment.
| cp "../hooks-repo/tests/test_tech_review_files/dependabot_pyproject.yml" .github/dependabot.yml || true |
Given that it is performed separately in the coming lines, it should be removed from here
| exit 1 | ||
| fi | ||
|
|
||
| integration-tech-review: |
There was a problem hiding this comment.
Isn't it possible to run that step as a precommit hook from the project side (I mean development) and not as a job in the CI ?
RobPasMue
left a comment
There was a problem hiding this comment.
Nice idea for testing... however, I am wondering... Why couldn't this be set up as integration tests inside our tests folder and using subprocess? Doesn't seem to be incompatible, right? You could leverage fixtures to make sure the wheel gets build and you use subprocess to call the tests from a dedicated virtual environment you create inside the tests folder for example...
We can discuss offline if you prefer. It might be more cumbersome to set up but at least the tests would remain within pytest and they would be easily runnable.. the main problem we have now (as CI/CD-based tests) is that they are only replicable on CI/CD.
It's fine on my side if this is the way to go but I just wanted to bring this up in case it wasn't considered... and if it was considered, I'd like to read the reasoning/rationale =)
Created a workflow file for testing the pre-commit hook as if it were running on external repos. For the add-license-headers hook, it tests each of the arguments