Adding automated CI testing via Github Actions #175
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR leverages Github Actions to run the current module tests in 4x versions of python (3.7+) running on 2x versions of both Ubuntu and MacOS. I initially wanted to include python2, but ultimately decided the juice wasn't worth the squeeze.
In order for the tests to pass I had to update Jinja2 to 3.0.1 for python 3.10 compatibility as well as change the SSH test to run on a different port since the VMs the tests were on utilize port 22.
I also needed to tweak the Git module test to look for a hostname in the key rather than exactly equal. Long story short,
git-upload-pack
now adds\0version=#\0
to the end of the transport so the hostname was coming up as'HOST': 'localhost\x00\x00version=2'
in the logs. This seemed like it was just because you are using the gitpython module and not running a git CLI command to run the test so I didn't think it needed to be taken into account in the module itself. Plus, it may prove fragile in the future if they add additional extra parameters between thehost=X
andversion=X
, but that's a potential problem for another day.See here for an example of the CI in action: https://github.com/joewesch/opencanary/actions/runs/1856565837