-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
[3.4] Backport CI config from master #2475
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
Conversation
vstinner
commented
Jun 28, 2017
- Add .travis.yml for Travis CI
- Add .github/ for AppVeyor and CodeCov.
Ok, here is my first attempt for enable Travis CI and AppVeyor to the 3.4 branch. It should help to test automatically backported security fixes. I'm not sure about enabling CodeCov. Do we need CodeCov on 3.4? Once this PR will work and be merged, I will backport it to the 3.3 branch. |
The doc job failed with:
=> need to backport the commit e7ffb99. |
The Travis CI job failed on:
Need to remove this from .travis.yml. At least, the compilation succeeded ;-) AppVeyor failed on:
Need to replace the option with --slow. |
I removed CodeCov config from .github/ and tried to fix CI failures. |
New failure of the Travis CI doc job:
|
Failure of the Travis CI python job:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly fine, a couple of things pointed out below.
.travis.yml
Outdated
# Only run on Linux as the check only needs to be run once. | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi | ||
# `-r -w` implicitly provided through `make buildbottest`. | ||
- make buildbottest TESTOPTS="-j4 -uall,-cpu,-tzdata" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/,-tzdata// (as you probably already saw in the build log :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I wrote the same fix, again, I will push it shortly.
.travis.yml
Outdated
after_script: # Probably should be after_success once test suite updated to run under coverage.py. | ||
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files. | ||
- source ./venv/bin/activate | ||
- bash <(curl -s https://codecov.io/bash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the codecov config missing, you can just remove this entire build. If you still want GCC coverage, you could change the main Linux build to GCC, since clang is covered by the OSX builder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I was going to remove it, but I'm looking at failures of the doc job ;-)
I removed the Travis CI doc job. It requires too many changes to fix it. The doc wasn't tested, so it's not like it's a regresion. Moreover, security fixes don't touch Doc/ usually, so it should be fine. |
In that case, let's remove the changes in |
4 tests failed on Windows:
|
On Travis CI, the same 2 test_imaplib tests failed. |
@zware: "In that case, let's remove the changes in Doc/ as well." Oh, it's a mistake. I reverted most Doc changes, but I forgot one. It's now fixed. I backported another fix for test_imaplib which removes the 2 failing tests. |
Oh yeah! Travis CI now pass. AppVeyor will likely fail in test_os again, I didn't identifier the right commit to cherry-pick yet. @serhiy-storchaka: Do you recall which commit fixed test_os random failures on os.walk on Windows? see #2475 (comment) failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This review is only for the Travis file.
Ok, the Python test suite now pass on Linux (Travis CI) and Windows (AppVeyor). Summary of the PR:
This PR doesn't contain:
@brettcannon: I really prefer to fix all CI issues in a single PR, and not have to handle 2 or 3 PR to get a working CI. @zware: Would you mind to review this PR? You worked on these CI recently, so you should be able to check it :-) @larryhastings: Would you mind to review this PR? It should help to be more confident when merging security fixes in 3.4, since the 3.4 buildbots were removed. Thanks @serhiy-storchaka, I backported you bpo-23808 fix and it seems like it was just enough ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I have added a suggestion.
exit | ||
fi | ||
./configure --with-pydebug | ||
make -j4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should perhaps keep the make clinic
check. That might require also backporting .gitattributes
(which might not be a bad idea anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should perhaps keep the make clinic check.
I don't think that it's worth it to add too many tests. I expect less than 10 commits in 3.4 next months, and each commit is carefully reviewed, and is very likely simply a backport.
That might require also backporting .gitattributes (which might not be a bad idea anyway).
This is for Windows end of line? I tried to forget this one. Tests pass on Windows on AppVeyor. Do we really need gitattributes?
Anyway, I suggest to create a separated change once this one is merged, if you consider that we should backport gitattributes.
@Haypo I have no problem with rolling up the fixes to go with the |
@@ -468,16 +468,6 @@ def test_logincapa(self): | |||
_server = self.imap_class(self.host, self.port) | |||
self.check_logincapa(_server) | |||
|
|||
def test_logincapa_with_client_certfile(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were these tests removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the commit 2bef165e1a142b83bc3f14e1017cd2aad50c9af8 of this PR which contains the full context, it's just a backport; http://bugs.python.org/issue30231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Why is this bugfix part of the "Backport CI config from master" PR? As far as I can tell, it has nothing to do with backporting the config for AppVeyor, CodeConv, and Travis.
Unless this bugfix is necessary for running AppVeyor, CodeConv, or Travis, I would like this change removed from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@larryhastings: Please see my summary of this PR, #2475 (comment)
Technically, I don't think that you can merge a PR if the CI fails. So it's not posisble to add the CI config in one PR and then fix failing tests. I could do the opposite, but it's not possible to make a PR depends on another one. Moreover, I used this issue to see which tests on the CI and test my fixes.
I think this reply below was actually meant to be in-line here. I am replying to it here.
2bef165 says "Remove the two tests which are already skipped." If they're skipped, then they're not failing, and they don't need to be removed.
Are they actually failing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. I used "git cherry-pick -x" which keeps the commit message unchanged. In Python 3.6 and master, first I skipped the test using skipIf(True, "...") to take decide what to do with these tests. But later, we decided that it's not possible to fix the test, so I removed them in all branches.
The IMAP server now always reject our TLS certificate, so the test always fail. The question is more why the server accepted your TLS certificate in the past? :-)
@@ -770,7 +770,11 @@ def setUp(self): | |||
if support.can_symlink(): | |||
os.symlink(os.path.abspath(t2_path), self.link_path) | |||
os.symlink('broken', broken_link_path, True) | |||
self.sub2_tree = (sub2_path, ["link"], ["broken_link", "tmp3"]) | |||
if os.path.isdir(broken_link_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this code modified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See bpo-23808.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Why is this bugfix part of the "Backport CI config from master" PR? As far as I can tell, it has nothing to do with backporting the config for AppVeyor, CodeConv, and Travis.
Unless this bugfix is necessary for running AppVeyor, CodeConv, or Travis, I would like this change removed from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI fails without this fix. If the CI fails, you cannot merge this PR.
Moreover, a prefer a green CI to more easily spot failures, than to have to compare with the previous CI build to check if there are new failures ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll accept this into 3.4, Even Though It's In Security Fixes Only Mode etc etc etc.
FWIW, there's some automation when cutting releases that removes dotfiles we don't want to leak into Python release tarballs. New dotfiles like .travis.yaml (and ".mention-bot", and ".github") need to be explicitly pruned. I'm gonna follow up and make sure this happens for 3.6.2 final and 3.6.4rc1. In the future, we release managers would appreciate a heads-up warning us when people add new dotfiles to the root of cpython, so we can make sure we don't ship them. |
I guess that you use some scripts, are they public? |
@Haypo my guess is https://github.com/python/release-tools, but there's no explicit dot file list that I see there so I may be wrong |
Brett's link to release-tools is the right place. The logic to strip the dotfiles is hidden inside. But please don't touch it right now. @ned-deily has done a lot of work on it to update it to Github, but he hasn't checked in those changes yet. I appreciate you being willing to fix release-tools when you add new dotfiles but please wait until release.py doesn't call "hg" anymore ;-) |
@larryhastings: Please see my summary of this PR, #2475 (comment) Technically, I don't think that you can merge a PR if the CI fails. So it's not posisble to add the CI config in one PR and then fix failing tests. I could do the opposite, but it's not possible to make a PR depends on another one. Moreover, I used this issue to see which tests on the CI and test my fixes. |
I just rebased this PR on top of the 3.4 branch, since many security PRs just have been merged. So it would help to check if everything is fine on 3.4 :-) |
Oh, everything is not fine, test_subprocess fails: http://bugs.python.org/issue30730#msg298218 |
Oh, I forgot that null character/byte errors were of type TypeError before 3.5. The simplest fix is changing corresponding |
* Add .travis.yml for Travis CI * Add .github/ for AppVeyor and CodeCov.
The regen-all Makefile rule doesn't exist in Python 3.4, only since Python 3.5 and newer (and 2.7).
tzdata resource doesn't exist in Python 3.4.
Fix test_invalid_cmd() and test_invalid_env(), TypeError is raised on Python 3.4. (cherry picked from commit 5e22721)
It took me one minute to understand that this commit comes from PR #2363 which is not merged yet :-) I changed the commit message and added it at the end of this PR. I also rebased this PR on top of 3.4. |
Yeah, tests pass again \o/ @larryhastings: Ok, it's your turn ;-) |
Ping @larryhastings: does it now look good to you? |
(The PR was already approved by 3 core devs, maybe 4 if you include myself.) |
I look forward to 3.4 entering the age of automation! |