Commit graph

164 commits

Author SHA1 Message Date
Jakub Kadlcik
219efc50a2 Add a possibility to have full datetime entries in changelog
Fix #305

Unfortunatelly we need to use `pytz` instead of `datetime.timezone`
because of python2.
2020-04-24 17:41:00 +02:00
Jakub Kadlcik
a72d4fbe50 Move is_rawhide and is_epel6 definitions to __init__ so other tests can use it 2020-04-23 11:35:03 +02:00
Jakub Kadlčík
3bb01ebb56
Merge pull request #333 from evgeni/get_project_name
make get_project_name more resilient
2020-03-09 10:40:17 +01:00
Jakub Kadlcik
1929f7f5a0 Temporarily skip some createrepo_c tests because it coredumps
This is probably not our fault, createrepo_c coredumps on Fedora
rawhide, please see the upstream issue
https://github.com/rpm-software-management/createrepo_c/issues/202

Once it gets resolved, revert this commit.
2020-01-31 21:23:17 +01:00
Evgeni Golov
fef2cfd161 add tests for get_package_name 2020-01-31 14:08:10 +01:00
Jakub Kadlcik
8afe478b97 Temporarily disable checks for E7 and W6 2020-01-30 23:31:36 +01:00
Jakub Kadlcik
b7d64be5d0 Fix E305 PEP8 error
> expected 2 blank lines after end of function or class
2020-01-30 23:31:36 +01:00
Jakub Kadlcik
30f59ec027 Use pycodestyle pacakge when pep8 is not available 2020-01-30 23:31:34 +01:00
Ernestas Kulik
3a79fdde9f Move to python-blessed
As python-blessings is unmaintained nowadays and is not packaged for
EPEL 8, it might be good to move to an active fork.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1777377
2020-01-13 09:04:38 +01:00
Miroslav Suchý
9c3f00f2cf Partial revert "Fix #335. Handle source tarballs with UTF8 characters in the name."
This partialy reverts commit 03509b36d5.
It removes just test and keep the functionality.

The test cannot be there right now because tito 0.6.11 and older will choke on this and will produce demaged tarball.

This revert can be added back later when all devel has tito in version 0.6.12 or higher.

Resolves: #337
2019-10-03 09:35:24 +02:00
Alex Wood
03509b36d5 Fix #335. Handle source tarballs with UTF8 characters in the name.
Following the principals of https://nedbatchelder.com/text/unipain.html
our goal is to decode bytes in to unicode as soon as we read them and
encode unicode date to bytes at the last second.

The specific problem we were seeing was caused by calling "encode" on a
byte string rather than a unicode string.  Python attempts to be
"helpful" and tries to decode the bytes as ASCII in order to provide a
unicode string to the encode function.  Since the bytes aren't ASCII,
the decode fails and we get the UnicodeDecodeError despite the fact that
we never explicitly asked for a decode at all.

Also, calculate checksums correctly for tarballs that have files with
UTF8 characters in the file name.
2019-04-10 14:20:02 -04:00
Alex Wood
fc12574880 BuildRoot is long deprecated and caused tests to fail. 2019-04-08 17:10:17 -04:00
Devan Goodwin
3e3a6f8aca Merge pull request #287 from pfournier/no-dist-release-line
Don't append 'None' to Release line with no '%{?dist}' part
2017-08-29 12:28:59 -03:00
Patrice Fournier
2a89594819 Don't append 'None' to Release line with no '%{?dist}' part 2017-08-29 09:28:09 -04:00
Evgeni Golov
e4746a6838 also verify that ReleaseTagger supports --use-release 2017-05-22 09:05:33 +02:00
Evgeni Golov
dfbf502749 add test for ReleaseTagger together with --use-version 2017-05-22 08:53:24 +02:00
Vadim Rutkovsky
aadafd4e87 Custom tag support in tito release
Signed-off-by: Vadim Rutkovsky <vrutkovs@redhat.com>
2017-05-05 12:35:23 +02:00
Vadim Rutkovsky
3a08af27ce VersionTagger should support custom tag format
It allows projects to format their own tags
2017-04-28 17:03:35 +02:00
Steve Kuznetsov
ed0d21708b
Use .assertTrue() instead of .assertIn()
CentOS 6 only has Python 2.6 available, on which the unit testing
frameworks do not expose a `.assertIn()` helper method. Instead, we can
use `.assertTrue(x in y)`.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 15:54:41 -05:00
Steve Kuznetsov
4f36972414
Clean up artifacts before test runs, not after
When tests fail, artifacts from that tests are necessary to properly
debug the failure and determine how to fix the test. This is impossible
when artifacts are immediately removed after the test is finished.
Instead, the tests should remove old artifacts before the test run
begins.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-09 10:00:31 -05:00
Steve Kuznetsov
a19a366213
Added --use-release flag for tito tag
When multiple tags exist for one version of a project, or when a version
is passed to `tito tag --use-version` that does not exactly correspond
with a tag in the repository's git history, the auto-generated release
is not guaranteed to monotonically increase. In order for users to
overcome this issue without building complicated logic into `tito`, it
is simpler to allow users to provide a literal release string to use.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-09 10:00:31 -05:00
Martin Sehnoutka
074b129ad7 Fix unit tests. 2016-12-15 15:05:25 +01:00
Martin Sehnoutka
f80debc740 Comments for test class. 2016-12-15 11:19:38 +01:00
Martin Sehnoutka
4d373ee201 Functional test case for CargoBump class. 2016-12-15 11:14:06 +01:00
Martin Sehnoutka
f7014b7527 Rename CargoTagger as CargoBump 2016-11-30 16:19:48 +01:00
Sehny
9bc7a0f76f fix few pep8 errors 2016-11-21 18:51:34 +01:00
Sehny
5da7997995 2 unit tests for cargo tagger. 2016-11-21 18:16:05 +01:00
Sehny
0efa60a77b Add unit test class 2016-11-21 13:31:31 +01:00
Lubomír Sedlář
a86501c1b5 Allow customizing git commit message 2016-05-27 09:46:19 +02:00
Dominic Cleal
de9ef27b3f
Only pass one project_name to copr build command 2016-05-11 18:44:17 +01:00
Devan Goodwin
5d258e7d2e Fix bugs with %autosetup and --test builds.
Extract method, add some tests, and fixed the regex problem.
2016-04-14 16:08:34 -03:00
Eric D Helms
092dc1e6c5 Add ability to specify a custom changelog during tag 2016-04-07 14:04:44 -04:00
Jakub Kadlčík
fa945d5875 Change asserted behavior after fe4c0bf 2015-09-10 13:28:21 +02:00
Alex Wood
3b99185216 Allow a user specific Copr remote SRPM URL.
By using a user specific URL, multiple members of the same team can
submit Copr releases without having to share credentials to the SRPM
remote location.  For example, each member of the team can set
COPR_REMOTE_LOCATION in .titorc to their <username>.fedorapeople.org
space.
2015-07-24 14:05:53 -04:00
Dominic Cleal
8d66889981 Fix rpmbuild_options array handling from builder args
3892359 changed builder args to always be arrays, so concatenation of
rpmbuild options with other strings then failed.

    File "/usr/lib/python2.7/site-packages/tito/release/main.py", line 530, in _koji_release
      builder.srpm(dist=disttag)
    File "/usr/lib/python2.7/site-packages/tito/builder/main.py", line 210, in srpm
      rpmbuild_options = self.rpmbuild_options + self._scl_to_rpmbuild_option()
    TypeError: can only concatenate list (not "str") to list

Change builder args to be joined by a single space, allowing multiple
arguments to be passed in.
2015-06-24 14:19:42 +01:00
Alex Wood
593f702372 Provide ability to turn off colored output. Fixes #182. 2015-06-15 11:02:18 -04:00
Alex Wood
356184c428 Correct style errors and use all caps for user_config option. 2015-06-12 13:36:25 -04:00
Alex Wood
d73ab2d661 Replace old Perl script for munging RPM release number. 2015-06-10 18:31:36 -04:00
Alex Wood
9b1d1c6988 Silence spurious test output. 2015-06-04 17:50:33 -04:00
Alex Wood
a5b43b6b96 Fix Python 3 issues with binary versus string types.
Python 3 is very picky about not mixing binary and string data.  This
patch gets TarFixer running on both Python 2.6+ and Python 3.x.
2015-05-18 14:01:43 -04:00
Alex Wood
07d62cf24e Tell the developer which PEP8 failures were detected. 2015-05-18 14:01:43 -04:00
Alex Wood
a8514c4dda Correct Python version incompatibilities. 2015-05-18 14:01:43 -04:00
Alex Wood
3892359fa4 Allow builder arguments to be given multiple times. 2015-05-18 14:01:43 -04:00
Alex Wood
6fedf5850e Fix failing unit tests.
These tests began failing after a correction to another test.  The
other test had been patching the error_out function without unpatching
it and thus polluted the test environment.

Also reset to a known directory at the beginning of the common tests so
that we don't start in a directory that has since been unlinked.
2015-05-18 14:01:43 -04:00
Alex Wood
4882412610 Alter tar module to correct headers on a Maven-generated tar.
The Maven-generated tar file deviates from the spec in several places.
Fields are padded out with spaces instead of NUL bytes and the user and
group ID are left empty.

This patch alters the tar module to correct these issues and ensures a
consistent unchanging fingerprint for the archive by setting the mtime
on the files to the modified time of the commit.
2015-05-18 14:01:43 -04:00
Alex Wood
b00cb06937 Place the pickle file used for Cheetah in the build directory. 2015-05-18 14:01:36 -04:00
Alex Wood
b0e85268c9 Add flake8 configuration. Fix style issues.
- Remove assignments to unused variables
- Rename variables shadowing builtins
- Fix all flake8 errors in tests
2015-05-18 14:00:19 -04:00
Alex Wood
ea0ea51552 Unit test new common functions and fix revealed bugs. 2015-05-18 14:00:19 -04:00
Alex Wood
53fadc2ae2 Rename tests so they have valid Python module names.
Hyphens are not allowed in module names.
2015-05-18 14:00:19 -04:00
Alex Wood
0c4238f8a4 Remove compatibility test for Python 2.4.
The Python 2.4 style of getting an exception object is forbidden by the
test_exceptions_3 test.  Something has to give, and Tito is not being
built for RHEL 5 anymore.
2015-05-15 13:07:35 -04:00