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

CI: add GitHub Actions test workflow #58

Merged
merged 1 commit into from
Sep 5, 2022
Merged

Conversation

ichard26
Copy link
Contributor

It doesn't look like Travis CI isn't (or was never?) used so let's instead set up a GitHub Actions workflow to simply run the test suite across all supported platforms.

This should help keep the codebase in good shape by automatically testing changes as they're committed and proposed (via PRs). This will also catch any packaging mistakes as tox does a clean build as part of the session run. Seemed relevant to mention that :p

I'll note that this is 100% free for public repos. GitHub graciously provides public repos with up 20 concurrent jobs (only 5 for macOS jobs).


(un?)fortunately this PR reveals that the test suite currently fails on Windows. I'm not familiar with the codebase so I'd appreciate help / guidance in fixing them.

@ichard26
Copy link
Contributor Author

ichard26 commented Aug 22, 2022

I'm not entirely sure how things look like on your end, but there should be a button to approve workflows to run or something (since I'm a first-time contributor to this repo and GitHub Actions requires approval for these folks me -- to combat abuse probably). If so, please click it so the workflow can run and you can see how it works. If not, you might have to first enable GitHub Actions by going to the "Actions" tab in the bar above.

Lemme know if you have any questions. I'm happy to help!

@ichard26 ichard26 changed the title [CI] add GitHub Actions test workflow CI: add GitHub Actions test workflow Aug 22, 2022
@ichard26 ichard26 changed the title [CI] add GitHub Actions test workflow CI: add GitHub Actions test workflow Aug 22, 2022
It doesn't look like Travis CI isn't (or was never?) used so let's
instead set up a GitHub Actions workflow to simply run the test suite
across all supported platforms.

This should help keep the codebase in good shape by automatically
testing changes as they're committed and proposed (via PRs). This will
also catch any packaging mistakes as tox does a clean build as part of
the session run. Seemed relevant to mention that :p
@cpburnz
Copy link
Owner

cpburnz commented Sep 5, 2022

Travis CI was originally setup by a pull request such as this one. I never maintained it however. I do think GitHub is the better location to have automated testing because it's where this repo is hosted. I always test my changes on Linux but I don't have a setup for Windows or Mac. Thanks.

The Windows failures are expected failures. Windows can't create and thus cannot test symlinks without admin permissions. Windows also has a broken realpath implementation which prevents recursion detection.

@cpburnz cpburnz merged commit bad28c8 into cpburnz:master Sep 5, 2022
@ichard26
Copy link
Contributor Author

ichard26 commented Sep 5, 2022

The Windows failures are expected failures. Windows can't create and thus cannot test symlinks without admin permissions. Windows also has a broken realpath implementation which prevents recursion detection.

Looking at the logs, it appears that the tests are failing due to slashes that are being converted to backslashes which isn't expected. I don't see any issues related to symlinks here.

======================================================================
FAIL: test_05_match_entries (tests.test_pathspec.PathSpecTest)
Test matching files collectively.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\python-pathspec\python-pathspec\tests\test_pathspec.py", line 314, in test_05_match_entries
    self.assertEqual(results, {
AssertionError: Items in the first set but not the second:
'Y\\Z\\c.txt'
'X\\a.txt'
'X\\Z\\c.txt'
'Y\\a.txt'
Items in the second set but not the first:
'X/a.txt'
'Y/a.txt'
'X/Z/c.txt'
'Y/Z/c.txt'

======================================================================
FAIL: test_05_match_tree_entries (tests.test_pathspec.PathSpecTest)
Test matching a file tree.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\python-pathspec\python-pathspec\tests\test_pathspec.py", line 393, in test_05_match_tree_entries
    self.assertEqual(results, {
AssertionError: Items in the first set but not the second:
'Y\\Z\\c.txt'
'X\\a.txt'
'X\\Z\\c.txt'
'Y\\a.txt'
Items in the second set but not the first:
'X/a.txt'
'Y/a.txt'
'X/Z/c.txt'
'Y/Z/c.txt'

======================================================================
FAIL: test_05_match_tree_files (tests.test_pathspec.PathSpecTest)
Test matching a file tree.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\python-pathspec\python-pathspec\tests\test_pathspec.py", line 423, in test_05_match_tree_files
    self.assertEqual(results, {
AssertionError: Items in the first set but not the second:
'Y\\Z\\c.txt'
'X\\a.txt'
'X\\Z\\c.txt'
'Y\\a.txt'
Items in the second set but not the first:
'X/a.txt'
'Y/a.txt'
'X/Z/c.txt'
'Y/Z/c.txt'

These look like they should be fixable, no?

I do see that on Windows with Python 3.7 test_2_1_check_realpath is failing. It's probably best to simply skip this test if on Windows with Python 3.7 so when CI goes red, you know it's a genuine new issue. (it's best to prevent old failures from hiding new failures)

@ichard26 ichard26 deleted the add-gha-ci branch September 5, 2022 18:01
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.

2 participants