372 Commits

Author SHA1 Message Date
Jimmy Berry
acd552c807 tests/OBSLocal: provide osc_user_pop() to make user switching cleaner. 2019-11-04 14:18:08 -06:00
Jimmy Berry
6e1c37b53d tests/OBSLocal: osc_user(): indicate when switching user. 2019-11-04 14:01:34 -06:00
Jimmy Berry
da2e5ea9a8 tests/OBSLocal: disable request cache during testing. 2019-11-04 14:01:34 -06:00
Jimmy Berry
251170b77d osclib/core: provide request_state_change() and utilize. 2019-11-04 14:01:34 -06:00
Jimmy Berry
caabf42f2b osclib/cache: provide osrt.cache.disable config option to disable cache.
Necessary for writing involved tests since the assumptions made by the
cache are violated and thus cause problems.

To keep the tests passing the oscrc intended to be used must be set as
environment variable so when osclib.conf.Config is use the config is not
lost. This would be made simpler without the needless extra config added
by StagingWorkflow.
2019-11-04 14:01:19 -06:00
Stephan Kulow
0cb54b8be0 Add a dummy user/password to the openSUSE:Factory section
See https://github.com/openSUSE/osc/issues/667 - we might want to remove
the feature to override settings locally this way and stop mangling with
osc's config file
2019-11-04 11:59:33 +01:00
Stephan Kulow
fe4f121993 Make exceptions easier to debug in OBSLocal
If the init function fails due to exceptions, python still
shows exceptions caught in the __del__ function, which can
be very confusing. So avoid the destructor if the constructor
failed by setting the variables early on and return in the
destructor if self.api is not yet defined
2019-11-04 11:04:53 +01:00
Stephan Kulow
f741cdc4e6 New basic test case 2019-09-03 19:43:15 +02:00
Stephan Kulow
700cf1e41a Fix repository_path_expand to also work in Factory stagings
I got the algorithm wrong - it overwrites repositories only when used
in the same path, not by recursion
2019-05-12 22:35:59 +02:00
Stephan Kulow
7ee9614ac2
Merge pull request #2002 from coolo/repository_fix
Fix and test repository_path_expand on SLE12-SP5
2019-05-11 16:49:16 +02:00
Stephan Kulow
4db9df6aec Fix and test repository_path_expand on SLE12-SP5
The way OBS collapses repositories is different to what we did
2019-05-11 16:34:31 +02:00
Stephan Kulow
d57ba61df5 Remove more references to vcr
I tried to replace the Mocking of functions with httpretty, but
unfortunately httpretty replaces all other API calls with 404s then.

What we'd need is a library sniping out single requests - possibly
by mocking the http_GET function, but that's tricky as well with
caching already overwriting it
2019-05-11 10:26:35 +02:00
Stephan Kulow
925032e0f9 Redo select tests to test package with multiple spec files 2019-05-06 22:38:57 +02:00
Stephan Kulow
9dcb403753 Merge vcrhelpers into OBSLocal
There are no more vcrs only a local OBS - even if not exported to
localhost
2019-05-05 10:49:05 +02:00
Stephan Kulow
70dd0ef20f Simplify httpretty usage
Don't pass regexps but real URLs, otherwise the matching won't work.
On travis and leap 15.1 we have httpretty 0.9.5 which won't uncover
the problem, but on Tumbleweed we have 0.9.6 that shows it
2019-05-05 10:49:05 +02:00
Stephan Kulow
58d6d7ca16 Python3 fixes 2019-05-04 15:44:44 +02:00
Stephan Kulow
3b568a60dd Create fixtures for devel_project_tests 2019-05-04 15:44:44 +02:00
Stephan Kulow
767f3e453b Fix comment_tests to create fixtures 2019-05-04 15:44:44 +02:00
Stephan Kulow
a4614ac13e Create user before using it 2019-05-04 15:44:44 +02:00
Stephan Kulow
0e00c83f09 Rename OBSLocal.OBSLocalTestCase to OBSLocal.TestCase
And make use of it in the vcrhelper using tests
2019-05-04 15:44:44 +02:00
Stephan Kulow
5721cee783 Create a real staging setup for freeze tests
If it's an empty project only we're freezing, the backend 'remembers' the
mtime of previous versions of the project (delete only marks it for undelete,
so creating a new empty project is just deleting this mark and as such doesn't
change the mtime).

So we need to have a new wine package with fresh content to change mtime
during freeze
2019-05-04 15:44:44 +02:00
Stephan Kulow
8ba4e2fb84 Run the nosetests in a tumbleweed container instead of travis environment
The docker-compose file starts an OBS instance (on 15.0 atm) and runs
the test suite in a test container (tumbleweed), so all tests run in
an isolated environment accessing OBS at api:3000
2019-05-04 15:44:39 +02:00
Stephan Kulow
8a7b65d505 Remove fake OBS in favor of using generated test data 2019-05-04 15:44:39 +02:00
Stephan Kulow
09332504d4
Merge pull request #1968 from coolo/python3_cherry_picks
Python3 cherry picks
2019-05-02 07:59:22 +02:00
Jimmy Berry
11921d78ba osclib/pkgcache: drop as no more uses.
No longer works in python3.
2019-04-30 08:39:18 -05:00
Stephan Kulow
c11313b2dc Fix imports, python3 doesn't import from . 2019-04-30 14:29:16 +02:00
b4083b0861
Merge pull request #1958 from Vogtinator/containercleaner
Add program for cleaning up maintenance_release projects for containers
2019-04-24 13:53:07 +02:00
Stephan Kulow
595e84191e More porting to python3
Travis changed default python to 3.6, which has impact on the way
flake8 checks. So make sure we run fine under flake8 of python 3
2019-04-20 21:16:50 +02:00
e943e27620 More tests in container_cleaner_tests.py 2019-04-17 17:03:59 +02:00
87c74d8451 Add program for cleaning up maintenance_release projects for containers
Only those containers providing binaries to the latest five version for each
archs are kept, all others are deleted.
2019-04-16 18:16:47 +02:00
Jimmy Berry
7bc6a10cc1 tests/obs: provide offering to appease the re-implementation of OBS. 2019-02-15 14:21:49 -06:00
Jimmy Berry
1abca4088a tests/metrics: add basic test to ensure code is executable. 2018-11-28 18:56:33 -06:00
86732dc472 ttm: add minimal staging config for pseudometa package
The config default for pseudometa package (00Meta) does not
exist for Tumbleweed, so we need to add an override for :ARM
to contain the proper information so that the publishing
logic doesn't stop. Also update correspondingly for Leap
2018-11-26 10:51:51 +01:00
Stephan Kulow
cedff89286 Replace urlparse.urlparse for python3 2018-11-17 10:51:36 +01:00
Stephan Kulow
ea9061ccf5 Import urllib2 python agnostic 2018-11-16 09:01:45 +01:00
Stephan Kulow
a0c9375a92 Adapt the unselect test to the current state
There are no revoked requests in Factory today - not perfect, but writing
this json file manually is not perfect either
2018-11-11 19:42:08 +01:00
Stephan Kulow
41a0c3902c Disable DEBUG for obs requests, it makes reading test failures very hard 2018-11-11 19:42:08 +01:00
Stephan Kulow
e1711a2812 Support OBS checks instead of openqa
Updated the test fixtures to current state, so we
don't test on old data
2018-11-11 19:42:08 +01:00
Jimmy Berry
4c8ade1a93 flake8: utilize raw strings to avoid invalid escape character warnings. 2018-10-24 16:34:16 -05:00
Stephan Kulow
ff84b79171 We need the images repo published to have a status check
We can't generally assume ISOs can be fetched from backend (we can't
have this on IBS), so publish it - and disable the actual publishing
on the staging backend of OBS
2018-10-12 13:00:18 +02:00
Stephan Kulow
e6bf5ccb7b Do no longer CC submitters in request comments
Submitters complain more and more about the spam they're getting from
staging projects - and we rather leave that weapon for actual feedback.

One especially annoying case is if a package is added to one staging project
and then later moved to another, the submitter will receive notifications
of all kind of bots and actions for both staging projects.
2018-10-04 09:52:49 +02:00
Jimmy Berry
d74c1c69ff osclib/cache_manager: rework base directory handling.
Ensure the returned directory is always created and while continuing to
handle test mode.
2018-09-13 20:26:08 -05:00
Jimmy Berry
c47bb4c902 Utilize CacheManager for all existing caches. 2018-09-04 15:19:02 -05:00
Jimmy Berry
d1274ecd1b tests/factory_source_tests: update query after osc@f1c3156.
Drop submit xpath references in favor of action only. A prime example
of the brittleness of this style of test.
2018-08-30 21:56:19 -05:00
Jimmy Berry
6069245350 Remove SUSE copyright, warranty, and license headers.
Distinct copyrights were left as I do not wish to track down commit
history to ensure it properly documents the copyright holders. Also left
non-GPLv2 licenses and left bs_copy untouched as a mirror from OBS.

Already have a mix of with and without headers and even OBS does not place
on majority of files. If SUSE lawyers have an issue it will come up in
legal review for Factory.
2018-08-23 19:18:06 -05:00
Jimmy Berry
dbfafe8e85 osclib/conf: utilize repo_checker-project-skip for OBS SLE projects. 2018-08-23 00:13:30 -05:00
Jimmy Berry
f0fadd6a05
Merge pull request #1650 from jberry-suse/conf-exclude-sub-projects
osclib/conf: exclude sub-projects from matching project patterns (and Leap:N:Update defaults)
2018-08-17 10:53:24 -05:00
Jimmy Berry
5b5d917074 osclib/conf: provide cached get() method to supersede ReviewBot cache.
Given the slow migration of everything to the shared project config in
tools that change project contexts multiple times a consistent way of
accessing the config without forcing remote calls is needed.
2018-08-17 10:16:43 -05:00
Jimmy Berry
5b44ea188d osclib/conf: provide Leap:N:Update default settings. 2018-08-17 00:08:09 -05:00
Jimmy Berry
dace1c3997 tests/obs: improve format of default Config attribute. 2018-08-16 21:54:20 -05:00