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

Add Windows to CI (plus associated fixes) #287

Merged
merged 19 commits into from
Dec 7, 2020

Conversation

altendky
Copy link
Member

@altendky altendky commented Dec 3, 2020

No description provided.

Otherwise coverage tries to run `trial` but it is `trial.exe`.
@codecov-io
Copy link

codecov-io commented Dec 4, 2020

Codecov Report

Merging #287 (55f4966) into master (68ae2f5) will increase coverage by 5.27%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #287      +/-   ##
==========================================
+ Coverage   89.93%   95.20%   +5.27%     
==========================================
  Files          11       20       +9     
  Lines         457     1001     +544     
  Branches       91      102      +11     
==========================================
+ Hits          411      953     +542     
- Misses         25       27       +2     
  Partials       21       21              
Impacted Files Coverage Δ
src/towncrier/test/test_settings.py 100.00% <ø> (ø)
src/towncrier/_writer.py 88.00% <100.00%> (+0.50%) ⬆️
src/towncrier/check.py 93.75% <100.00%> (ø)
src/towncrier/__main__.py 0.00% <0.00%> (ø)
src/towncrier/test/test_format.py 100.00% <0.00%> (ø)
src/towncrier/test/test_build.py 100.00% <0.00%> (ø)
src/towncrier/test/test_project.py 100.00% <0.00%> (ø)
src/towncrier/test/test_create.py 100.00% <0.00%> (ø)
src/towncrier/test/test_builder.py 100.00% <0.00%> (ø)
src/towncrier/test/test_write.py 100.00% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68ae2f5...55f4966. Read the comment docs.

@altendky altendky changed the title Matrix against Linux/macOS/Windows Add Windows to CI Dec 4, 2020
@altendky altendky changed the title Add Windows to CI Add Windows to CI (plus associated fixes) Dec 4, 2020
This was referenced Dec 6, 2020
@altendky altendky requested review from exarkun and adiroiban December 6, 2020 02:36
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@@ -46,6 +48,12 @@ jobs:
task:
- name: Test
tox: tests
exclude:
# Twisted and thus trial don't work on Windows with CPython 3.9
Copy link
Member

Choose a reason for hiding this comment

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

Maybe link to a Trac ticket for Twisted... I am sure this will be fixed ... or maybe is already fixed and just waiting for a new release.

But maybe it is worth migrating towcrier tests to stdlib unit test. In this way we will not depend on twisted for running the tests.

Copy link
Member

Choose a reason for hiding this comment

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

Trial really has a bunch of nice facilities compared to stdlib unittest. There are other options, of course, like pytest and testtools, but you're going to run into exactly the same issues with anything that's not part of the stdlib itself.

As far as Twisted's 3.9 release goes, there's https://twistedmatrix.com/trac/ticket/10027 at least

Copy link
Member

Choose a reason for hiding this comment

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

True. Thanks for the link.

@@ -22,6 +22,9 @@ def create_project(pyproject_path):
f.write("Adds levitation")

call(["git", "init"])
# The default git branch name may not be master, let's make sure we
# are consistent here.
call(["git", "checkout", "-b", "master"])
Copy link
Member

Choose a reason for hiding this comment

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

Do we have to pick master here? It wouldn't surprise me if the answer is yes because other things still assume/use master... But if it works to use some other name like "main" then maybe that would be a better choice.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can switch it over. I think there was one test that explicitly passed master to towncrier as the reference branch. I could also just make the test check the primary branch before creating the 'PR' branch and then specify no name anywhere. I'll do one of the two unless you make a specific request.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I just removed this all together for now. This wasn't actually a Windows related issue and only showed up because I happened to install an updated Git in my Windows VM and allowed it to default to main instead of master. So, it's a real issue in regards to an assumption made by the tests about external configuration, but not a Windows issue nor one that CI is presently forcing us to fix.

#294

coverage run -p {envbindir}/trial {posargs:towncrier}
# coverage fails to run trial on Windows since it is trial.exe
# so just use --module.
coverage run -p --module twisted.trial {posargs:towncrier}
Copy link
Member

Choose a reason for hiding this comment

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

May not make any difference but this could also be python -m coverage .... I expect the right command is on PATH thanks to tox ... but a few lines above it looks like you thought python -m twisted.trial ... was a good idea, so maybe it's a good idea for coverage too?

Copy link
Member Author

Choose a reason for hiding this comment

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

The -m twisted.trial was for consistency with this line which switched as explained in the comment. But sure, could do it for everything. I'll look, or maybe another PR to switch everything if there are several unrelated places where -m would make sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

https://tox.readthedocs.io/en/latest/config.html#conf-allowlist_externals

Hmm, so tox only warns about outside access and doesn't, right there anyways, list an option to make that an error. Anyways, there are several other places this would apply in general so I won't change them here. I did update the comment to better represent coverage's perspective on the run subcommand.

@altendky altendky merged commit 1a38b33 into master Dec 7, 2020
@altendky altendky deleted the test_more_operating_systems branch December 7, 2020 00:41
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.

4 participants