Fix duplicate login options when publishing

Review Request #2560 - Created Aug. 3, 2015 and submitted

Information
Andy Reitz
pants
7fb9175...
Reviewers
pants-reviews
fkorotkov, jsirois, kwlzn, molsen, peiyu

When publishing artifacts to a remote repo that requires authentication, pants will duplicate the username/password on the CLI, one for each artifact published.

Travis run: https://travis-ci.org/pantsbuild/pants/builds/73833709

In addition, when I comment out the copy in jar_publish.py, I see this error from the unit test:

20:56:23 00:00     [pytest]
20:56:23 00:00       [run]
                     ============== test session starts ===============
                     platform darwin -- Python 2.7.6 -- py-1.4.30 -- pytest-2.6.4
                     plugins: cov, timeout
                     collected 2 items 

                     tests/python/pants_test/backend/jvm/tasks/test_jar_publish.py F.

                     ==================== FAILURES ====================
                     _____ JarPublishTest.test_options_with_auth ______

                     self = <pants_test.backend.jvm.tasks.test_jar_publish.JarPublishTest testMethod=test_options_with_auth>

                         def test_options_with_auth(self):
                           self._jar_publish._jvm_options = self.DEFAULT_JVM_OPTS

                           username = 'mjk'
                           password = 'h.'
                           creds_options = ['-Dlogin={}'.format(username), '-Dpassword={}'.format(password)]

                           repo = {
                             'auth': 'blah',
                             'username': username,
                             'password': password,
                           }
                           modified_opts = self._jar_publish._ivy_jvm_options(repo)
                     >     self.assertEqual(modified_opts, self.DEFAULT_JVM_OPTS + creds_options)
                     E     AssertionError: Lists differ: [u'jvm_opt_1', u'jvm_opt_2', u... != [u'jvm_opt_1', u'jvm_opt_2', u...
                     E     
                     E     Second list contains 2 additional elements.
                     E     First extra element 4:
                     E     -Dlogin=mjk
                     E     
                     E     - [u'jvm_opt_1', u'jvm_opt_2', u'-Dlogin=mjk', u'-Dpassword=h.']
                     E     + [u'jvm_opt_1',
                     E     +  u'jvm_opt_2',
                     E     +  u'-Dlogin=mjk',
                     E     +  u'-Dpassword=h.',
                     E     +  u'-Dlogin=mjk',
                     E     +  u'-Dpassword=h.']

                     tests/python/pants_test/backend/jvm/tasks/test_jar_publish.py:63: AssertionError
                     ======= 1 failed, 1 passed in 0.17 seconds =======

Issues

  • 0
  • 3
  • 1
  • 4
Description From Last Updated
Matt Olsen
Andy Reitz
Andy Reitz
Andy Reitz
Matt Olsen
John Sirois
Stu Hood
John Sirois
Andy Reitz
John Sirois
Andy Reitz
Andy Reitz
Andy Reitz
Review request changed

Status: Closed (submitted)

Loading...