Fix GoFetch and test.

Review Request #3888 - Created May 14, 2016 and submitted

Information
John Sirois
pants
jsirois/issues/3424/fix_fetch
3424, 3442
3889
7bd2e61...
Reviewers
pants-reviews
benjyw, kwlzn
The `GoFetch._find_meta_tag` function was broken in return type and the
`GoFetchTest` failed to arrange a correct 3rdparty source root.  Fix both.

 contrib/go/src/python/pants/contrib/go/tasks/go_fetch.py             | 15 ++++++++++++---
 contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch.py |  6 +++++-
 2 files changed, 17 insertions(+), 4 deletions(-)

Before this fix, on my machine, this failed 3 for 3:

./pants test \
  contrib/go/tests/python/pants_test/contrib/go/tasks/:go_fetch -- \
    -vktest_transitive_download_remote_libs_

Green after the fix.

CI went green here:
http://jenkins.pantsbuild.org/job/pantsbuild/job/pants/branch/PR-3442/4/

John Sirois
Benjy Weinberger
Stu Hood
John Sirois
Review request changed

Status: Closed (submitted)

Change Summary:

Now on master:

git log -1 origin/master
commit 0571cff6837f70d328147f3f786628cd54695289
Author: John Sirois <john.sirois@gmail.com>
Date:   Sun May 15 10:23:47 2016 -0600

    Fix GoFetch and test.
    
    The `GoFetch._find_meta_tag` function was broken in return type and the
    `GoFetchTest` failed to arrange a correct 3rdparty source root.  Fix both.
    
    Testing Done:
    Before this fix, on my machine, this failed 3 for 3:
    ```
    ./pants test \
      contrib/go/tests/python/pants_test/contrib/go/tasks/:go_fetch -- \
        -vktest_transitive_download_remote_libs_
    ```
    
    Green after the fix.
    
    CI went green here:
      http://jenkins.pantsbuild.org/job/pantsbuild/job/pants/branch/PR-3442/4/
    
    Bugs closed: 3424, 3442
    
    Reviewed at https://rbcommons.com/s/twitter/r/3888/
Yujie Chen

   

I have some confusions around this expression. If use triple quotes here, then the new line and indentation spaces in each line is also compiled into patterns, right?

For some website like bazil.org, meta tag is a single line in html source. In that case, this expression won't match the meta tag.

  1. You are correct, save for the `re.VERBOSE` flag, which ignores whitespace in the regular expression.
  2. cool! I didn't know VERBOSE does that. thanks!

    One more thing, it seems on my Mac, requests.session cannot get to bazil.org, I got error like sslv3 handshake error. Googled online, seems have something to do with openSSL on Mac.

    I wonder if you have seen the same thing before?

  3. I have not, but a friend who uses OSX linked this trail of tears that seems related: https://github.com/pyca/cryptography/issues/2138
    Don't use OSX is a super simple fix for this and much more ;)
Loading...