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

Versioneer #489

Closed
wants to merge 7 commits into from
Closed

Versioneer #489

wants to merge 7 commits into from

Conversation

mikofski
Copy link
Contributor

Fixes issue in release robot that doesn't detect unannotated tags. IE if tag created with out the -a option.

Also add test of get_recent_tags that compares 95 tags from beginning of dulwich repo.

$ nosetests dulwich/contrib/test_release_robot.py  -v
test_dulwich_tags (dulwich.contrib.test_release_robot.TagPatternTests) ... ok
test_tag_pattern (dulwich.contrib.test_release_robot.TagPatternTests) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.062s

OK

Also change docstring to give example similar to this gist of how to emulate versioneer.

Release 0.16.3.

# gpg: Signature made Sat, Jan 14, 2017 12:02:08 PM PST
# gpg:                using RSA key 9A2D24A504D1E9F8
# gpg: Can't check signature: public key not found
- if tag is not annotated, then it will be a commit object, instead of
creating a tag object
- don't check if ref object is tag, instead check if "tags" is in the
ref name
- change docstring to show how release_robot could be used as alternate
to versioneer, ie: copy and paste gist

https://gist.github.com/mikofski/e923750b415e4e4961b65a8eb42999e8#file-xyz__init__-py
- don't use contrib folder as default projdir, instead default to '.'
- return tag meta data if there is any from get_recent_tags() as tuple
(tag time, tag id, tag name) otherwise it's (None, None, None)
- remove test_tag_pattern from release_robot since it's in
test_release_robot()
- add test of current 95 dulwich tags to test_release_robot

Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
@jelmer
Copy link
Owner

jelmer commented Jan 18, 2017

Thanks for the patch.

One of the tests seems to be timezone-specific:

======================================================================
FAIL: test_dulwich_tags (dulwich.contrib.test_release_robot.TagPatternTests)

Traceback (most recent call last):
File "dulwich/contrib/test_release_robot.py", line 58, in test_dulwich_tags
self.assertEqual(metadata[0].isoformat(), test_data[0]) # date
AssertionError: '2017-01-14T20:21:52' != u'2016-04-24T15:39:37'

@jelmer
Copy link
Owner

jelmer commented Jan 18, 2017

Ah, I see what's happening. Please construct a test repository and run tests against that, rather than using the dulwich repository itself.

This is problematic because it means local changes cause the tests to fail, and also because anybody who is running dulwich from e.g. a tarball won't be able to run the test.

* does this fix the assert failures for commit times?
* setup class to clone github dulwich repo
* teardown class to close repo and remove repo dir
* move constants for tag test to class
* separate tag test into its own test class
* set tag meta to None for unannotated tags, instead of (None, None,
None)
* change test and test data wrt to unannotated tags
* clarify get_recent_tags() docstring

Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
* use zipped test repo instead of github repo
* add some logging
* put each test repo in temp dir, no race conditions on travis?

Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
@mikofski
Copy link
Contributor Author

mikofski commented Jan 18, 2017

it's passing both Python versions for me now:

Python-2

$ py -2 -m nose dulwich/contrib/test_release_robot.py -v --nologcapture
test get recent tags ... ok
test tag patterns ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.118s

OK

Python-3

$ py -3 -m nose dulwich/contrib/test_release_robot.py -v --nologcapture
test get recent tags ... ok
test tag patterns ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.131s

OK

feel free to squash commits. it's a mess. I had to use zip file and a tempdir

@jelmer
Copy link
Owner

jelmer commented Jan 18, 2017 via email

@mikofski
Copy link
Contributor Author

workin' on it

@mikofski
Copy link
Contributor Author

ok, I think it's ready now

@jelmer
Copy link
Owner

jelmer commented Jan 20, 2017

Merged, thanks!

@jelmer jelmer closed this Jan 20, 2017
@mikofski mikofski deleted the versioneer branch July 4, 2018 00:53
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.

None yet

2 participants