CI: Enable testing on macOS and Windows#707
Conversation
|
Unfortunately, running the tests with coverage on PyPy fails on Windows, so we had to exclude the corresponding jobs from the test matrix with a85eabc. -- https://github.com/panodata/apprise/actions/runs/3261675617/jobs/5357105180 |
97a35b4 to
f817d1e
Compare
Codecov ReportBase: 99.98% // Head: 99.98% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #707 +/- ##
=======================================
Coverage 99.98% 99.98%
=======================================
Files 113 113
Lines 14533 14539 +6
Branches 2960 2961 +1
=======================================
+ Hits 14531 14537 +6
Misses 1 1
Partials 1 1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
11f631f to
e6a006d
Compare
|
For Windows testing, I'm not sure if we have to go beyond just picking a single flavor of Python and rolling with that. It's absolutely amazing that you got it to work with all version though. What are your thoughts here? |
Single-platform builds for daily business
I fully agree with this, see #702 (comment):
Full matrix once
Thanks. I just wanted to see it working at least once, before I will limit it again. |
092364a to
b9b03a7
Compare
5056ea0 brings all into an appropriate shape now. I decided to group the jobs into two halves: The first one, let's call it "primary", runs CPython 3.10 on all variants of (standard, bare, macOS, and Windows). The second one will spawn the full test matrix on the CPython version axis on Linux. |
5056ea0 to
2e72374
Compare
| # return results | ||
| return results | ||
|
|
||
| @property |
There was a problem hiding this comment.
This is great, but if you grep for pki (for example), this list is used in several locations. The Todo in place was more to move this into the utils.py' or maybe a new file called secure.py`. A general reuse locating basically.
It would allow reuse. I need to verify how many other spots there are though. I think it was used for xmpp too, but that was dropped for now. I still like the way you massaged it.
There was a problem hiding this comment.
If you grep for pki (for example), this list is used in several locations.
I just tried, but did not find any other occurrances.
I think it was used for
xmpptoo, but that was dropped for now.
Ah. That makes sense!
The todo in place was more to move this into the
utils.pyor maybe a new file calledsecure.py.
I don't think it will need to go to a dedicated file. Let's refactor it when needed.
I still like the way you massaged it.
Thanks. It only needed to be done in order to be able to add certifi.where(). It would not have been possible within the body of the class.
| @pytest.mark.skipif(sys.platform == "win32", reason="Does not work on Windows") | ||
| def test_detect_language_windows_users_croaks_please_review(): | ||
| """ | ||
| When enabling CI testing on Windows, those tests did not produce the | ||
| correct results. They may want to be reviewed. | ||
| """ |
There was a problem hiding this comment.
I moved some tests from test_locale.py into this test case function, because they did not produce the expected outcomes on Windows. You may want to review those now, or postpone it into the future. d5f07a3 is the corresponding commit which was needed here.
| # Remove our file before we exit the with clause | ||
| # this causes our delete() call to throw gracefully inside | ||
| os.unlink(str(log_file)) | ||
| # Concurrent file access is not possible on Windows. | ||
| # PermissionError: [WinError 32] The process cannot access the file | ||
| # because it is being used by another process. | ||
| if sys.platform != "win32": | ||
| # Remove our file before we exit the with clause | ||
| # this causes our delete() call to throw gracefully inside | ||
| os.unlink(str(log_file)) | ||
|
|
||
| # Verify file is gone | ||
| assert not os.path.isfile(str(log_file)) | ||
| # Verify file is gone | ||
| assert not os.path.isfile(str(log_file)) |
There was a problem hiding this comment.
I don't know what was intended to be tested here, but like it's done here will croak on Windows. The reason is because concurrent file access is not possible on Windows.
PermissionError: [WinError 32] The process cannot access the file
because it is being used by another process.
43dd1be fixes it.
|
There has also been a fluke on the most recent test run, see #692 (comment). Unfortunately, I am not able to give it a kick, so I will force-push to re-run completely. |
|
This is amazing work @amotl ! I would only ask that we drop the It's a small request as it just keeps dependencies really low. Otherwise 😲... just awsome work; it's an easy merge thereafter. Thoughts? |
|
Dear Chris,
The value is that it will work universally on all platforms where Apprise can be installed, not only on the Linux-based systems explicitly enumerated there. Other than this, the I think the I also would like to recommend to add an option to let the user provide a path to a certificate bundle, in the specific context of MQTT. In contrast to HTTP, there isn't really a public infrastructure of MQTT brokers out there. When using MQTT with TLS encryption, users will mostly run their own PKIs. With kind regards, Footnotes |
`detect_language` yields `en` here.
Concurrent file access is not possible on Windows:
PermissionError: [WinError 32] The process cannot access the file
because it is being used by another process.
…review` When enabling CI testing on Windows, some tests did not produce the correct results. They may want to be reviewed. All those test cases are now bundled within this function, in order to make CI succeed.
This will support all Python installations on platforms where the operating system does not provide such a certificate bundle.
This will save resources when pushing to the same PR branch multiple times in (quick) succession. Mostly, there is no need to finish the workflow jobs which are currently running.
ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none) ERROR: No matching distribution found for pywin32
When invoking the tests using `coverage` on Windows/PyPy, it segfaults.
Hi again,
this patch addresses some shortcomings when it comes to making the test suite succeed on Windows. Mostly, it is about replacing the
NotifySyslognotifier with another one within some test cases, because thesyslogpackage is not present on Windows installations of Python.Other than this, it uses the
certifipackage to add an operating system agnostic source to the list of root certificate authority (CA) bundle candidates,CA_CERTIFICATE_FILE_LOCATIONS, forNotifyMQTT.Visually, it will look like outlined below.
With kind regards,
Andreas.
[1]
Appendix: CI/GHA jobs view
-- https://github.com/caronc/apprise/actions/runs/3277660846/usage
Appendix: First successful run
-- https://github.com/panodata/apprise/actions/runs/3264695345/usage
For daily business, it will be limited to a single slot for macOS and Windows. See discussion below.