Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding automated CI testing via Github Actions #175

Merged
merged 4 commits into from
Jun 23, 2022

Conversation

joewesch
Copy link
Contributor

@joewesch joewesch commented Feb 17, 2022

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 the host=X and version=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

Copy link
Contributor

@HybridAU HybridAU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing. I was looking at the issue with SMB logs, and thinking "this is a simple regression, we should really have a unit test for that". Then I was thinking we really need unit tests to run automatically.

Copy link
Contributor

@jayjb jayjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so great! Thank you so much. Ill try get the other platforms and python2 working too.

@jayjb jayjb merged commit 3b6f7d4 into thinkst:master Jun 23, 2022
@joewesch joewesch deleted the github_actions branch March 21, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants