55 Commits

Author SHA1 Message Date
35679d10b3 tests: fix testsuite for virtually accept 2017-10-02 17:15:55 +08:00
Jimmy Berry
dd68116c9c select_tests: fix after comment rework.
These tests are very ugly due to mocking.
2017-06-01 10:12:27 +02:00
Jimmy Berry
931c8a2908 tests/unselect_tests: add test for cleanup fitler. 2017-05-04 15:08:13 -05:00
Jimmy Berry
412763bc81 tests/obs: define PROJECT as openSUSE:Factory. 2017-05-04 15:08:13 -05:00
Jimmy Berry
cabc9abf40 conf-tess: ensure a blank config is not rewritten (ie loop). 2017-05-01 22:33:20 -05:00
Jimmy Berry
77b2185500 obslock: implement test suite. 2017-05-01 17:10:36 -05:00
Jimmy Berry
8109772372 stagingapi: get_open_requests(): replace query string with dictionary. 2017-04-12 17:32:38 -05: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
69e1771a11 API: add a is_user_member_of() function 2015-08-06 15:54:56 +02: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
c9d1e06ca8 Refactor configuration parameters into configuration file. 2015-02-19 11:39:05 +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
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
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
b73b0bb45d Fix tests 2014-07-04 15:20:28 +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
4c0d469a96 Remove pep8 complains. 2014-06-23 14:20:11 +02:00
Stephan Kulow
4b432b9bb1 fix the test suite for the subpkg tests
actually the biggest impact has my refusal to select into outdated prjs
2014-06-17 14:39:51 +02:00
Ancor Gonzalez Sosa
c7774d8b8b AcceptCommand only adds one comment
Added tests for AcceptCommand with a new Staging:C fixture.
2014-06-16 17:15:24 +02:00
Ancor Gonzalez Sosa
af8a8341c5 Use markdown comments to hide the mark on generated OBS comments 2014-06-04 18:34:08 +02:00
Ancor Gonzalez Sosa
507e50d633 Write only one comment per action
* For every 'select' or 'unselect' a single comment is written in
   every affected project
 * Previous automatic comments are deleted (as a first approach)
 * For more info, see https://progress.opensuse.org/issues/2564
2014-06-04 16:54:21 +02:00
77d1d18c48 Rewrite OBS mockup test, fixtures and tests. 2014-06-04 11:04:37 +02:00
9dd73418f0 Add completely useless OBS response for comments. 2014-05-20 14:39:16 +02:00
Michal Hrusecky
eda367cd99 Fix yet another test 2014-03-07 15:05:22 +01:00
Michal Hrusecky
23a1cef719 Fix test 2014-03-07 14:46:25 +01:00
Michal Hrusecky
32a1765e0f Allow searching for requests 2014-03-07 14:28:53 +01:00
Michal Hrusecky
37eab408ed Try to implement more package handling 2014-03-07 13:58:33 +01:00
Michal Hrusecky
da70085a34 Small obs class cleanup 2014-03-06 15:24:34 +01:00
4608d12b69 Make the OBS class a bit more PEP8-compilant 2014-03-05 16:22:17 +01:00
Michal Hrusecky
cf136d31c1 Minor fixes to the test suite
* devel project is always home:Admin
* fix creation of links to be really created
2014-03-05 11:13:07 +01:00
Michal Hrusecky
75d88686ec Improve select test suite 2014-03-04 16:35:30 +01:00
Michal Hrušecký
e8c3dcaf81 Merge pull request #88 from scarabeusiv/master
Implement non-ring project verification to not wait on obs/openQA
2014-03-04 15:46:23 +01:00
Michal Hrusecky
ba8dd50bd5 Implement a way to use custom statuses 2014-03-04 15:13:19 +01:00
Tomáš Chvátal
cdee7e8e9f Whitespace. Remove unused mock function. 2014-03-04 14:17:53 +01:00
Stephan Kulow
958a226ee2 test the basics for select 2014-03-04 10:55:55 +01:00
Michal Hrusecky
dbb547555b Merge branch 'master' of github.com:openSUSE/osc-plugin-factory 2014-03-03 23:28:58 +01:00
Michal Hrusecky
9d807410ce Providing fake build results for staging projects 2014-03-03 23:26:44 +01:00
Michal Hrusecky
e42e9d0da0 Initial support for testing project check 2014-03-03 16:17:41 +01:00
780073f6d8 Fix headers and comment dead code. 2014-02-28 11:45:06 +01:00
Tomáš Chvátal
a1cc405c3e Really test ring comparsion. 2014-02-27 13:39:57 +01:00
Michal Hrusecky
a4694f6344 Ugly hack to migrate the rest of the tests 2014-02-26 16:22:56 +01:00
Michal Hrusecky
6f3dae1fb6 Migrate build results tests 2014-02-26 16:11:32 +01:00
Michal Hrusecky
3fb324a774 Basic implementation for packages and link creation 2014-02-26 15:23:33 +01:00
Michal Hrusecky
d306d60de6 Recursion when handler not found
Allow to get into recursion if exact request is not found.
2014-02-26 14:17:27 +01:00
Michal Hrusecky
0d782f50da Testing removing package from project 2014-02-26 10:59:41 +01:00
Michal Hrusecky
ca9e98baa7 Support for DELETE
Adding to the framework support for DELETE as well, as it happens from time to
time in API as well.
2014-02-26 10:10:17 +01:00