Commit graph

536 commits

Author SHA1 Message Date
Devan Goodwin
2a39e31dad Merge pull request #113 from domcleal/quiet-package-config-warning
Change package-specific config message to debug
2014-03-24 13:30:55 -03:00
Dominic Cleal
2f11bf2f14 Change package-specific config message to debug
When this feature isn't used, the output of tito seems unnecessarily verbose.
2014-03-24 16:27:06 +00:00
Devan Goodwin
4149b01828 Automatic commit of package [tito] release [0.5.0-1]. 2014-03-24 09:23:56 -03:00
Devan Goodwin
145cdb27b8 Fix mistake in warning message for default_tagger. 2014-03-24 09:00:33 -03:00
Devan Goodwin
0ef8225dc5 Merge pull request #112 from jumanjiman/test_harness
add containerized test harness
2014-03-13 15:07:14 -03:00
Paul Morgan
361eca6195 add test harness based on docker/lxc 2014-03-13 17:56:32 +00:00
Paul Morgan
bc0abf1beb avoid TB in gitannex builder test on python3
Avoids...

Traceback (most recent call last):
  File "/home/sandbox/test/functional/build_gitannex_tests.py", line 87, in test_simple_build
    self.assertEquals(1, len(builder.sources))
nose.proxy.TypeError: TypeError: object of type 'map' has no len()
2014-03-12 19:37:39 +00:00
Paul Morgan
886df517fa avoid TB for encoding in python3
527e60ba added method `run_command_print' to provide
buffered output during long-running commands.

This causes TB in python3 due to IO encoding issues, so for now...

* use getoutput instead of run_command_print
* add TODO in run_command_print to make it compatible asap
2014-03-12 19:20:39 +00:00
Paul Morgan
ff5fd1faf7 skip git-annex tests if distro or git-annex is too old 2014-03-12 19:17:38 +00:00
Devan Goodwin
164d9dee06 Remove some dead code. 2014-03-11 12:28:21 -03:00
Devan Goodwin
78a0d98e70 Merge pull request #111 from jumanjiman/python3_alpha
alpha support for python3
2014-03-11 11:50:24 -03:00
Paul Morgan
00f2dfc84f avoid TB on python3 due to strict dict type
On python3, we need to perform a union (not addition) on
dictionary sets to avoid...

Traceback (most recent call last):
  File "/home/sandbox/test/functional/fetch_tests.py", line 95, in test_with_releaser
    self.source_filename)
  File "/home/sandbox/test/functional/fixture.py", line 103, in tito
    return CLI().main(argstring.split(' '))
  File "/home/sandbox/src/tito/cli.py", line 222, in main
    return module.main(argv)
  File "/home/sandbox/src/tito/cli.py", line 599, in main
    **kwargs)
  File "/home/sandbox/src/tito/release/main.py", line 359, in __init__
    prefix="yumrepo-", **kwargs)
  File "/home/sandbox/src/tito/release/main.py", line 238, in __init__
    auto_accept, **kwargs)
  File "/home/sandbox/src/tito/release/main.py", line 73, in __init__
    _args = config_builder_args.items() + kwargs['builder_args'].items()
nose.proxy.TypeError: TypeError: unsupported operand type(s) for +: 'dict_items' and 'dict_items'
2014-03-11 14:39:32 +00:00
Paul Morgan
bcf29ea34b avoid TB on python3 due to encoding within subprocess pipeline
subprocess.getstatusoutput can fail with utf8 UnicodeDecodeError
http://bugs.python.org/issue9922

Resolves this TB on python3, which was
caused by outputting binary data to the 'tee' command...

Traceback (most recent call last):
  File "/home/sandbox/test/functional/multiproject_tests.py", line 133, in test_build_tgz
    artifacts = tito('build --tgz')
  File "/home/sandbox/test/functional/fixture.py", line 103, in tito
    return CLI().main(argstring.split(' '))
  File "/home/sandbox/src/tito/cli.py", line 222, in main
    return module.main(argv)
  File "/home/sandbox/src/tito/cli.py", line 390, in main
    return builder.run(self.options)
  File "/home/sandbox/src/tito/builder/main.py", line 130, in run
    self.tgz()
  File "/home/sandbox/src/tito/builder/main.py", line 401, in tgz
    self._setup_sources()
  File "/home/sandbox/src/tito/builder/main.py", line 436, in _setup_sources
    os.path.join(self.rpmbuild_sourcedir, self.tgz_filename))
  File "/home/sandbox/src/tito/common.py", line 518, in create_tgz
    run_command(archive_cmd)
  File "/home/sandbox/src/tito/common.py", line 221, in run_command
    (status, output) = getstatusoutput(command)
  File "/home/sandbox/src/tito/compat.py", line 45, in getstatusoutput
    raise(err)
  File "/home/sandbox/src/tito/compat.py", line 41, in getstatusoutput
    (status, output) = subprocess.getstatusoutput(cmd)
  File "/usr/lib64/python3.3/subprocess.py", line 683, in getstatusoutput
    text = pipe.read()
  File "/usr/lib64/python3.3/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
nose.proxy.UnicodeDecodeError: UnicodeDecodeError: ascii
2014-03-11 14:38:03 +00:00
Paul Morgan
a398833e72 avoid TB on python3 due to git format string
Use RawConfigParser instead of ConfigParser to avoid...

Traceback (most recent call last):
  File "/home/sandbox/test/functional/multiproject_tests.py", line 68, in setUp
    self.create_project(TEST_PKG_1, os.path.join(self.repo_dir, 'pkg1'))
  File "/home/sandbox/test/functional/fixture.py", line 198, in create_project
    tito('tag --keep-version --debug --accept-auto-changelog')
  File "/home/sandbox/test/functional/fixture.py", line 103, in tito
    return CLI().main(argstring.split(' '))
  File "/home/sandbox/src/tito/cli.py", line 222, in main
    return module.main(argv)
  File "/home/sandbox/src/tito/cli.py", line 671, in main
    offline=self.options.offline)
  File "/home/sandbox/src/tito/tagger/main.py", line 51, in __init__
    ConfigObject.__init__(self, config=config)
  File "/home/sandbox/src/tito/config_object.py", line 38, in __init__
    config.get(section, options))
  File "/usr/lib64/python3.3/configparser.py", line 1184, in set
    super().set(section, option, value)
  File "/usr/lib64/python3.3/configparser.py", line 889, in set
    value)
  File "/usr/lib64/python3.3/configparser.py", line 399, in before_set
    "position %d" % (value, tmp_value.find('%')))
nose.proxy.ValueError: ValueError: invalid interpolation syntax in '%s (%ae)' at position 0
2014-03-11 14:38:03 +00:00
Paul Morgan
172d67794e StringIO is part of io in python3
> The StringIO and cStringIO modules are gone. Instead, import
> the io module and use io.StringIO or io.BytesIO for text and
> data respectively.

- http://docs.python.org/3.0/whatsnew/3.0.html

Avoid TB in python3 when performing buffered IO.
Buffered IO must use bytes, not string, to avoid...

Traceback (most recent call last):
  File "/home/sandbox/test/functional/multiproject_tests.py", line 68, in setUp
    self.create_project(TEST_PKG_1, os.path.join(self.repo_dir, 'pkg1'))
  File "/home/sandbox/test/functional/fixture.py", line 198, in create_project
    tito('tag --keep-version --debug --accept-auto-changelog')
  File "/home/sandbox/test/functional/fixture.py", line 103, in tito
    return CLI().main(argstring.split(' '))
  File "/home/sandbox/src/tito/cli.py", line 222, in main
    return module.main(argv)
  File "/home/sandbox/src/tito/cli.py", line 674, in main
        found_changelog = False
    return tagger.run(self.options)
  File "/home/sandbox/src/tito/tagger/main.py", line 103, in run
    self._tag_release()
  File "/home/sandbox/src/tito/tagger/main.py", line 123, in _tag_release
    self._make_changelog()
  File "/home/sandbox/src/tito/tagger/main.py", line 229, in _make_changelog
    os.write(fd, "# Create your changelog entry below:\n")
nose.proxy.TypeError: TypeError: 'str' does not support the buffer interface
2014-03-11 14:38:03 +00:00
Devan Goodwin
ce7393ecaa Add test for GitAnnexBuilder. 2014-03-11 11:27:19 -03:00
Devan Goodwin
5a1ed49959 Fix some git annex merge issues. 2014-03-11 10:08:05 -03:00
Devan Goodwin
8d5361861b Merge branch 'git-annex' of https://github.com/domcleal/tito into domcleal-git-annex
Conflicts:
	src/tito/builder/__init__.py
	src/tito/builder/main.py
2014-03-11 10:02:41 -03:00
Devan Goodwin
a80fc5b6b0 Use test util to write files. 2014-03-11 09:25:45 -03:00
Devan Goodwin
527e60bab4 Print output live for longer running rpmbuild commands. 2014-03-11 09:17:52 -03:00
Devan Goodwin
9091afd684 Functional test for the CoprReleaser. 2014-03-11 09:17:52 -03:00
Devan Goodwin
9673394342 Fix MockBuilder bug from refactoring. 2014-03-11 09:17:52 -03:00
Devan Goodwin
b3a14db2e8 Merge pull request #109 from jumanjiman/deprecate_gitpython
Deprecate GitPython
2014-03-10 09:38:16 -03:00
Paul Morgan
3ae1596923 deprecate GitPython
GitPython is not compatible with python3 and may never be:
https://fedoraproject.org/wiki/User:Churchyard/python3
2014-03-09 13:56:17 +00:00
Paul Morgan
a0d0f859c7 resolve another use of commands module for python3 compat
03255001d6 moved commands module to src/tito/compat.py to handle
differences between python2 and python3, but missed a bit that
did not show up in unit or functional tests.

Fix those occurences and add unit test to detect the regression.
2014-03-09 13:12:32 +00:00
Paul Morgan
0e218077b3 HACKING: tests on python3 require rpm-python3 2014-03-08 22:36:57 +00:00
Dominic Cleal
491eb0094f Add GitAnnexBuilder, using git-annex to store blobs
This is an extension of NoTgzBuilder, which instead of storing blobs in source
control directly, allows the use of git-annex to reference blobs in an external
source (e.g. a web URL remote).  When preparing sources, it uses git-annex's
unlock command to temporarily restore the original file.
2014-03-07 23:48:44 +00:00
Devan Goodwin
b88ae7c4bb Bad config references. 2014-03-07 14:52:52 -04:00
Devan Goodwin
a49649ce3e Fix some missed references to deprecated config names. 2014-03-07 14:29:10 -04:00
Devan Goodwin
4ec0213959 Rename for new config section. 2014-03-07 14:21:01 -04:00
Devan Goodwin
11b58b62ae Remove legacy CvsBuilder and CvsReleaser.
These build systems no longer exist to the best of my knowledge.
2014-03-07 14:18:43 -04:00
Devan Goodwin
9c671d09e0 Stop writing temp file to load tito.props from past tag. 2014-03-07 14:02:06 -04:00
Devan Goodwin
167800f75f Remove deprecated support for build.py.props config filename. 2014-03-07 13:53:57 -04:00
Devan Goodwin
e2ac2cac32 Remove a very old hack for assuming config from Makefiles.
This predates build.py.props which predates tito.props. Extremely unlikely
anyone is still using this.
2014-03-07 13:41:22 -04:00
Devan Goodwin
6ee7cf631f Refactor config overriding.
Merge rel-eng/tito.props with package specific tito.props. Package specific
values will be used whenever the same property appears in both.

This patch deprecates the use of [globalconfig], instead favoring
[buildconfig]. Globalconfig will continue to work and just print a warning to
the user, support will be removed entirely later on.
2014-03-07 13:30:43 -04:00
Devan Goodwin
d637425496 Move taggers to sub-directory. 2014-03-07 09:40:05 -04:00
Devan Goodwin
c888383b31 Move releasers to sub-directory. 2014-03-06 15:02:02 -04:00
Devan Goodwin
eeef2ae6e9 Merge pull request #105 from jumanjiman/python3
prepare for python3 compatibility
2014-03-03 08:30:53 -04:00
Devan Goodwin
0ccb1f8e21 Merge pull request #108 from stpierre/version-template-docs
Improved docs for [version_template] section of tito.props
2014-03-03 08:22:22 -04:00
Chris St. Pierre
a5d9bcc3ab Improved docs for [version_template] section of tito.props 2014-02-28 16:42:14 -05:00
Paul Morgan
2a58a9b8e7 allow empty dist tag in functional tests
before this commit: fetch_tests and release_yum_tests
allow *any* dist tag, but the tag must not be empty or
else the glob fails on double-dot in path name.

after this commit: allow the tag to be any *or* empty.
2014-02-28 19:07:53 +00:00
Paul Morgan
4e29304554 docs: createrepo is needed for functional tests 2014-02-28 15:38:25 +00:00
Paul Morgan
9f2c259c85 python 2.4 (rhel 5) does not support 'with...as' syntax
resolves from a73c90cb...

    Using Python 2.4
    Using nose 0.1
    Running tito tests against: /home/sandbox/src
    EEEE.Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
    Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
    ..............................F...........
    ======================================================================
    ERROR: Failure: SyntaxError (invalid syntax (fixture.py, line 159))
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.4/site-packages/nose/loader.py", line 381, in loadTestsFromName
        module = self.importer.importFromPath(
      File "/usr/lib/python2.4/site-packages/nose/importer.py", line 39, in importFromPath
        return self.importFromDir(dir_path, fqname)
      File "/usr/lib/python2.4/site-packages/nose/importer.py", line 86, in importFromDir
        mod = load_module(part_fqname, fh, filename, desc)
      File "/home/sandbox/test/functional/fetch_tests.py", line 27, in ?
        from fixture import TitoGitTestFixture, tito
      File "/home/sandbox/test/functional/fixture.py", line 159
        with open(os.path.join(full_pkg_dir, 'tito.props'), 'w') \
                ^
    SyntaxError: invalid syntax
2014-02-28 15:38:25 +00:00
Paul Morgan
25c6f7f1e0 avoid ImportError in test suite on python 3
python3 does not allow relative imports.

test/unit/__init.py__ and test/functional/__init.py__ already exist,
which means we can use absolute import on all versions of python
without resorting to http://legacy.python.org/dev/peps/pep-0328/
2014-02-28 15:38:25 +00:00
Paul Morgan
2380fd81a0 add python 3.3 to travis-ci build matrix 2014-02-28 15:38:25 +00:00
Paul Morgan
22896be9ce add unit test and use print function for python3 compat
Python 3 does not have the print statement, so convert all
print statements to print functions and add an ugly duckling
unit test to detect regressions.
2014-02-28 15:38:25 +00:00
Paul Morgan
03255001d6 add unit test and module compatibility lib
Add modules compat lib to support both python 2 and 3, and
add unit test to detect regressions.

Tito uses two modules that have changed significantly between
python 2 and 3:

* commands module merged into subprocess module
* ConfigParser module renamed as configparser
2014-02-28 15:38:25 +00:00
Paul Morgan
1182b13713 add unit tests and fix exception clause compatibility
Exceptions are now compatible with both python 2.4 and 3.3,
and we have unit tests to detect regressions.

The syntax for capturing exceptions changed in python 3, but
we need to continue supporting python 2.4 syntax since many
people use tito on RHEL 5, which has python 2.4.

http://docs.python.org/dev/howto/pyporting.html#capturing-the-currently-raised-exception
2014-02-28 15:02:50 +00:00
Paul Morgan
1597d7956a add pep8 tests and fix lexical indentation for python3
These are the pep8 tests that break python3,
such as mixing tabs and spaces for indentation.

I ignored all the pep8 tests that seemed only stylistic,
such as "visual" indentation.

http://docs.python.org/3.3/reference/lexical_analysis.html
2014-02-28 01:34:34 +00:00
Paul Morgan
7846ee875d add pep8 tests and fix redundant backslashes between brackets 2014-02-28 01:34:34 +00:00