Commit Graph

25 Commits

Author SHA1 Message Date
Martin Basti
902f736a2b py3: test_otptoken_import: fix bytes usage
https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-28 16:26:50 +02:00
Martin Basti
8416d5772d py3: Remove comparison >=2 of debnug log level
We have only one debug log level and it causes issues with py3.
...
  File "/usr/lib/python3.5/site-packages/ipaserver/rpcserver.py", line 490, in marshal
    response, version, pretty_print=self.api.env.debug >= 2
TypeError: unorderable types: str() >= int()

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-28 16:26:50 +02:00
Stanislav Laznicka
db4d0998fd wsgi plugins: mod_wsgi expects bytes as an output
python3-mod_wsgi expects that the application() method returns
bytes otherwise it breaks.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
2017-06-27 16:48:21 +02:00
Martin Basti
10d4fb7ea8 py3: test_location_plugin: fix iteration over changed dict
In py3 dict.items() doesn't return list so we must create a list to
avoid changing dictionary over iteration.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
8116a7b450 py3: test_kerberos_principal_aliases: fix code scope
In py3 the variable is valid only in the block where it is defined. We
must move test definition to global scope.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
c422206cc7 py3: dogtag.py: fix bytes warnings
/usr/lib/python3.5/site-packages/ipaserver/plugins/dogtag.py:1438: BytesWarning: str() on a bytes instance
   "parse_result:\\n%s" % (parse_func.__name__, xml_text, result))

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
b35db9152c py3: travis: enable tests for plugins that are aleready working
These tests just works now

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-23 14:45:05 +02:00
Martin Basti
172a2e7456 Travis: enable temporary Py3 testing
This testconfig is temporary until all plugins are migrated into py3.
After that this temporal config file will be removed and used only the
previous one again

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-20 12:36:29 +02:00
Martin Basti
5fdd0a3f60 Travis: build only py2 packages for py2 testing
We will testing both py2 and py3 packages, first step is use only py2
builds for testing py2 packages

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2017-06-20 12:36:29 +02:00
Martin Babinsky
afe85c3798
Travis CI: explicitly update pip before running the builds
This is to workaround around
https://github.com/travis-ci/travis-ci/issues/7733 and issues with
implicit requirement of python-requests on newer pip.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
2017-05-10 08:54:13 +02:00
Christian Heimes
08fc9d7a68 Run test_ipaclient test suite
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
2017-03-14 17:14:26 +01:00
Martin Babinsky
91341f4035 Travis CI: Upload the logs from failed jobs to transfer.sh
When a non-lint job fails, all the relevant logs from the test runner
will be gzipped and uploaded to https://transfer.sh file sharing
service. The download link will then be displayed at the very end of the
Travis build log.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2017-02-09 13:26:07 +01:00
Martin Babinsky
0ef55a91ef Trim the test runner log to show only pytest failures/errors
If we get to the `run-tests` phase, we no longer care about messages
from previous steps so we can truncate the log output to only show
pytest failures/errors, reducing log size.

As a fallback, the previous behaviour to print last 5000 log lines was
kept in the case the CI tests fail during setup.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
f48d6fc168 Travis CI: use specific Python version during build
This is a preparatory work for the future requirement of running
Python2/3 jobs simultaneously.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
b6216756f6 introduce install step to .travis.yml and cache pip installs
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
b8423492f5 split out lint to a separate Travis job
In order to speed our Travis CI gating even further, the lint step has
been split to a separate job that can be run in parallel with the test
runs. The test runs are in turn launched in developer mode to speed them
up.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
149d86de14 Travis: offload test execution to a separate script
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
aff4e684e1 Put the commands informing and displaying build logs on single line
This prevents Travis log collector to add separate expansion marks to
the echo output and the actuall log output.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
758731088e travis: mark FreeIPA as python project
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
d86cae7748 Bump up ipa-docker-test-runner version
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2017-01-05 16:21:51 +01:00
Martin Babinsky
6d6fbc010e Use ipa-docker-test-runner to run tests in Travis CI
https://github.com/martbab/ipa-docker-test-runner is now used to run the
following tasks in Travis CI:

* pull in a FreeIPA test runner Docker image
* configure/make lint/make rpms
* install rpms
* install FreeIPA server and KRA
* run out-of-tree tests

For performance reasons (last two steps are very time-consuming) the available
tests were split roughly in half and are run as two separate jobs to speed up
the process.

AD trust is not installed as part of tests since the enabled compat plugin
causes false negative errors.

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-12-07 10:32:44 +01:00
Petr Spacek
14c1c8dfd0 Build: add Python lint target
https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-11-09 13:08:32 +01:00
Petr Spacek
fee9bbd85a Build: add make rpms target and convenience script makerpms.sh
make rpms and ./makerpms.sh will produce the same RPM packages. The
advantage of makerpms.sh is that it will take care of initial
autoreconf & configure phases as needed.

rpm-build-4.13.0-1.fc24.x86_64 broke parallel build of RPMs.
If you get error
  INTERNAL: Exiting with 1 jobserver tokens available; should be 8!
undefine the MAKEFLAGS variable and do not specify neither -j nor -l.

https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2016-11-09 13:08:32 +01:00
Jan Cholasta
1077743d90 spec file: do not include BuildRequires for lint by default
Lint is never executed from rpmbuild, so the BuildRequires for lint are
purely informational.

Include them only if %with_lint RPM macro is specified.

Update .travis.yml accordingly.

https://fedorahosted.org/freeipa/ticket/6418

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-24 14:11:08 +02:00
Martin Babinsky
37f3ad8867 Use Travis-CI for basic sanity checks
This patch adds the config file for Travis CI. The config file instructs the
CI to:
* check pep8 errors in PR
* build RPMs in pulled in Fedora builder container
    (docker.io/martbab/freeipa-fedora-builder)

These basic checks should eliminate basic errors that can break the build
itself (formatting errors, Syntax errors/undeclared variables, missing
BuildRequires, broken API.txt, etc.). It does not run any of our
integration/unit tests.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-09-06 17:43:38 +02:00