Add jar Publish integration tests to test the generated pom and ivy.xml files.

Review Request #1879 — Created March 6, 2015 and submitted

tejal
pants
78c4ced...
pants-reviews
areitz, ity, jsirois, stuhood

Add test to jar publish to test the contents of generated pom file and ivy.xml file

This is in preparation to change JarPublish task to publish extra products as a separate artifact with its own pom

You will seeing a patch and tests for the same soon.

More context here->
https://groups.google.com/forum/#!search/Proposal$3A$20Make$20JarPublish$20task$20more$20configurable./pants-devel/S5l2_NXBtnw/Mf1pLj7P-kgJ

Thanks
Tejal.

yes.

./pants test.pytest tests/python/pants_test/tasks:jar_publish_integration is green

https://travis-ci.org/pantsbuild/pants/builds/53424691

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
AR
  1. Thanks for doing this, it mostly looks good to me. The resources thing is a nit (and totally optional), but I'd like to see if you can use assertEqual or assertMultilineEqual when comparing the templates -- I think that will give a better error message.

    Alternatively, you can show the error message that results in a mis-match w/ your current code. If that makes it obvious what's wrong, then I'm cool with it.

  2. It seems like it should be possible to tag the resource dir on the python_tests() target in the BUILD file:

    http://pantsbuild.github.io/build_dictionary.html#python_tests

    But I'm not seeing an example of how to access the resources from the python side. I see some stuff in the science repo, but I'm not sure if they're actually using the resource dir supplied by pants.

    1. The consumer of a python_library needs to use pkgutil to extract resources file from a pex. https://pantsbuild.github.io/build_dictionary.html#python_tests

      Pytest runner is not aware of resources like junit runner. It would make sense to add resources only if they are pary of test library.

  3. I think if you used something like assertMultilineEqual():

    https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertMultiLineEqual

    Then we'd get nice error messages in the future, when we change the template but forget to change the test. My understanding is that it will give you a visual diff, highlighting what part of the golden template that needs to be changed.

    1. Sure will do. That surely is helpful.

  4. 
      
TE
AR
  1. Looks awesome, thanks!

  2. 
      
IT
  1. looks good!

  2. 
      
TE
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted here 490cef6860637f25ecc21891865034f6d0da299d

Loading...