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

Add support for %ci, %h and @TAG_OFFSET@ to obsinfo files #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add support for %ci, %h and @TAG_OFFSET@ to obsinfo files #138

wants to merge 1 commit into from

Conversation

lbeltrame
Copy link

This is done by repeated calls to get_version, so this part may be up
for optimizations.

Tests still pass (except bzr, but because it's broken locally for me).

This should fix issue #137. Notice: I didn't find anything in the test suite for testing obsinfo files.

@aspiers aspiers requested review from aspiers and M0ses April 12, 2017 12:01
This is done by repeated calls to detect_version, so this part may be up
for optimizations.

Tests still pass (except bzr, but because it's broken locally for me).

This should fix issue #137. Notice: I didn't find anything in the test suite for testing obsinfo files.
@lbeltrame
Copy link
Author

Rebased on top of latest master. Please review when you can.

Copy link
Member

@aspiers aspiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbeltrame Thanks a lot - any chance you could add the corresponding test?

@aspiers
Copy link
Member

aspiers commented May 7, 2017

Oh, I just noticed you said there are no tests for obsinfo yet. That's not good ... Well, this is a good excuse to add them ;-)

@lbeltrame
Copy link
Author

Good point about tests. I'll see if I can do something about it. Where is a good point to check for existing tests, and where should they best put in?

@aspiers aspiers mentioned this pull request May 17, 2017
@aspiers
Copy link
Member

aspiers commented May 17, 2017

Firstly, you should read TESTING.md if you didn't already.

Next, it'll be a question of adding tests under the tests/ subdirectory. Unfortunately due to the limited capacity of my brain, I can't remember anything about obsinfo, so until #155 is resolved I can't make any more specific suggestions. But let me know if you have questions about the way the existing tests work.

@aspiers
Copy link
Member

aspiers commented Jul 20, 2017

@lbeltrame I think we have at least one obsinfo test now, thanks to all the great work from @M0ses:

@unittest.skip("Broken test, relies on the results of an other test case")

However I'm not sure exactly what that test is supposed to be testing, and currently it's broken anyway. Maybe you can liase with @M0ses to figure out the best way to write the test for the new functionality in this PR?

fake_args = args.copy()
fake_args["versionformat"] = field
value = str(scm_object.detect_version(fake_args))
metafile.write(names[field] + value + "\n")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks very specific to git to me. Maybe this should be handled in a SCM specific method and TarSCM.scm.base should have a generic method which simply 'pass'. Otherwise I guess it could break e.g. svn/bzr/...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, git-specific stuff should remain in the Git class.

@M0ses
Copy link
Collaborator

M0ses commented Jul 21, 2017

I think, we need at least some unittests for each SCM here, but maybe some integration test would be better.
@aspiers - you mentioned one of my test cases, which is broken.
Anyway, I think this would have not prevented us from breaking other SCM's.
Maybe we could consider this in #148

fake_args = args.copy()
fake_args["versionformat"] = field
value = str(scm_object.detect_version(fake_args))
metafile.write(names[field] + value + "\n")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, git-specific stuff should remain in the Git class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants