148 Commits

Author SHA1 Message Date
Jimmy Berry
2a00de2bb5 Add lxml as test requirement and fix tests. 2017-01-24 22:34:27 -06:00
Jimmy Berry
cff5befed3 Provide cache for expensive and cache-able staging requests.
The two slowest staging API calls are for information that rarely changes.
By caching the result the commands typically execute over twice as fast.
Going further can see improvements of an order of magnitude or more by
caching almost all the GET requests.

In contrast to osclib/memoize.py this cache operates at the HTTP request
level. This has several advantages:

- Caches the expensive part (ie the HTTP request). There are a number of
  functions in osc.core and elsewhere that make the same API request, but
  process the result differently which would require multiple API calls
  using memoize.
- Handles cases were a loader function uses class attributes as input and
  output and thus no relevant method parameters or return. An important
  example is StagingAPI._generate_ring_packages().
- Storage is project aware which allows caches to be deleted when a project
  is known to have changed.
- Due to project awareness, can utilize OBS /statistics/latest_updated API
  call to determine which projects need to be expired.

The cache file structure is as follows:

- hostname(apiurl)
  - project
    - sha1(url)
  - sha1(url)

See Cache.PATTERNS for changing the time to live (ttl) or add patterns to
be cached.
2017-01-11 10:23:54 -06:00
Ludwig Nussel
9c4382c1a9 Accept requests that are only stuck in Factory staging
If only the review by a factory staging project is left in state new and
all others are in state accepted it means legal, opensuse-review team
etc have completed. So it's safe to consider such a request accepted for
inclusion into Factory. So let's not waste time waiting for the next
Factory checkin round.
2016-09-09 10:30:05 +02:00
46c2c2304c Update fixtures 2016-06-13 16:55:05 +08:00
Ludwig Nussel
70c3d34731 Only call _invalidate_all if it exists
the memoize decorator adds the _invalidate_all function when called.
Due to the deferred initialization that may not happen in a test.
2016-05-10 10:29:37 +02:00
69e1771a11 API: add a is_user_member_of() function 2015-08-06 15:54:56 +02:00
Alberto Planas
90412c30a4 Clean the cache after every test. 2015-08-03 13:21:45 +02:00
Stephan Kulow
47fc31b93d move constructor in tests 2015-07-18 13:48:15 +02:00
Stephan Kulow
77e9276340 no longer accept non-ring packages but show them in list 2015-07-16 12:42:25 +02:00
6f7e3f2a02 Fixes the logic error in checkTagNotRequired() 2015-07-09 20:04:31 +08:00
Kristoffer Grönlund
6b6f2f8863 Use server side issue listing to check tags
Instead of reimplementing the issue digging in the check script,
ask the server for mentioned issues.
2015-06-23 14:36:59 +02:00
Kristoffer Grönlund
6ffc0182fa Passing tests 2015-06-16 10:48:24 +02:00
Antonio Larrosa
0df1662207 New version of the check_tags_in_requests script and its tests
- Now it looks for correctly formed tags (not only 'bnc#' but 'bnc#[0-9]+' and so on)
- It doesn't look in the request description anymore, now it checks that
  tags appear in the diff of the modified .changes files (and there must be at least
  one .changes file being modified)
- The tests have been reworked from scratch, now they're more complete, cleaner and nicer
2015-03-26 14:47:27 +01:00
Antonio Larrosa
fe2b5ddc06 Added copyright note and removed shebang for similarity with other tests 2015-03-25 01:56:23 +01:00
Antonio Larrosa
d3dcb164c5 rename check_tags_in_sle.py to a more proper name, check_tags_in_requests.py 2015-03-25 01:48:49 +01:00
Antonio Larrosa
534f5ff13a Add new review bot that checks that request descriptions contain certain tags (bnc#, boo#, etc.) 2015-03-25 01:42:48 +01:00
Dinar Valeev
c3bc54cf1f Fix expected architectures
With extention osc_freeze command to the new architecture, we've forgot
to add tests. Lets fix it

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
2015-03-19 10:47:14 +01:00
Alberto Planas
37c7e2a6c6 Add a test for accept command when there are multiple SPECs 2015-03-02 11:15:24 +01:00
Alberto Planas
b4b5cd34a9 Move the Config call from checkrepo to the caller. 2015-02-26 11:47:11 +01:00
Alberto Planas
c9d1e06ca8 Refactor configuration parameters into configuration file. 2015-02-19 11:39:05 +01:00
Ludwig Nussel
cfd6641f82 rename CPE -> Backports 2015-02-04 16:43:56 +01:00
Ludwig Nussel
a2cf55aaff fix double review, add testcase
closes #278
2015-01-26 11:42:00 +01:00
Ludwig Nussel
a590787e33 new review bots factory-source and maintbot
factory-source checks if submissions contain sources already accepted in
Factory. maintbot makes sure maintenance submissions are authored by the
Factory package maintainer.

Both are based on a new generic ReviewBot.py class that can serve as
common framework for review bots.
2014-11-25 14:36:22 +01:00
Alberto Planas
4af48f4c96 Improve clean_cache method. Add a test. 2014-10-14 17:10:07 +02:00
Alberto Planas
425a7ea663 Implement an external cache for checkrepo 2014-10-01 17:49:39 +02:00
Alberto Planas
1e2ea101e2 Replace subprojects array with subproject. 2014-09-29 11:51:43 +02:00
Alberto Planas
627a6e0aa6 action #3772 - replace 'factory' with actual project in accept 2014-09-29 11:25:15 +02:00
5790cdf1e4 Fix tests 2014-09-22 17:57:11 +02:00
f6e7d98701 Fix the code according to https://github.com/openSUSE-Team/obs_factory/pull/24 2014-09-12 15:19:20 +02:00
Stephan Kulow
4185bfc552 adapt test fixtures 2014-09-01 11:14:44 +02:00
Stephan Kulow
e2ff3e8afa changed the paths again after discussion 2014-08-25 12:44:05 +02:00
af41f78daa action #3078 - adapt check_command to the new dashboard route 2014-08-22 14:30:41 +02:00
Ludwig Nussel
b389171619 list pending staging requests for correct project 2014-08-20 13:52:20 +02:00
08b6227a15 Fix tests after changes in pending_requests() 2014-08-15 09:34:52 +02:00
29b8bcca6b Makes staging pluging Factory agnostic. 2014-08-07 12:58:47 +02:00
5962765901 action #2858 Remove code from staging relate with the old osc staging check command 2014-07-31 14:16:54 +02:00
3d5201b5c6 Fix fixtures and tests. 2014-07-17 14:58:02 +02:00
8c3e87e246 Needs have too many e's. 2014-07-15 11:08:28 +02:00
2cbddb6f9d Add failing modules information for openQA. 2014-07-09 17:50:06 +02:00
79086419bc Add architecture to the report. 2014-07-08 17:06:31 +02:00
7048597bf4 Remove more superflous data. 2014-07-08 16:54:56 +02:00
5750f4dfb0 action #2628 adapt osc staging check to read the information from obs_factory. 2014-07-08 15:33:39 +02:00
b73b0bb45d Fix tests 2014-07-04 15:20:28 +02:00
70631b27d9 Remove empty line. 2014-07-01 09:30:54 +02:00
414ad1390e Enable comments. 2014-06-27 09:50:08 +02:00
ccfb48511e Add initial test for check_specs. 2014-06-25 14:17:52 +02:00
53d7614f97 Fix description. 2014-06-25 12:00:07 +02:00
46c5c5c001 Initial tests for checkrepo. 2014-06-25 12:00:07 +02:00
c5daf9a956 Remove fake oscs for testing. 2014-06-23 15:06:03 +02:00
4c0d469a96 Remove pep8 complains. 2014-06-23 14:20:11 +02:00