Commit Graph
24 Commits
Author SHA1 Message Date
mnightingale 59218a687d Fix race in TestAddingNZBsClean and share the NZB-adding helpers (#3571)
Jobs are listed in the history output as soon as they enter the
post-processing queue, and a stopped job has its status set to Failed at
the very start of process_job. The duplicate alternative is only released
near the end of it, so waiting for the job to show up in the history as
failed does not guarantee the alternative was already released. The gap
is tiny when running serially, but wide enough to fail the test under the
load of pytest-xdist. Wait for the label to be dropped instead.

Also move the helpers shared by both adding-NZB test classes into a base
class in testhelper, so the clean tests no longer have to import the
other test module to copy its methods.
2026-08-16 15:46:05 +02:00
mnightingale ec6ba3baae Speed up tests with pytest-xdist (#3546)
* Speed up tests with pytest-xdist

* Ignore request failures when the server disappeared

* Fix tests which modify module globals

* Fix lang change leaking

* Fix transaction compilation order breaking tests

* Always load a clean config and fix related tests

* No module globals

* Fix other test classes assigning module level by making calls

* Replace from sabnzbd.cfg import so monkeypatch works

* More global poisoning

* Fix dependant tests which worksteal breaks

* More global vars

* Drop loadscope until more failures are resolved

* Due to how pytest-xdist is implemented, the -s/--capture=no option does not work

* monkeypatch db_path

* Also patch startup_done

* loadscope
2026-08-10 17:44:18 +01:00
Safihre 0950393b82 Correctly format tests based on new rules and remove star imports 2026-06-05 14:34:17 +02:00
Safihre 8be8af018f Refactor RSS processing for clarity and option precedence
Refactor RSS feed processing logic to enhance clarity and ensure correct precedence for resolved options. Renames functions and variables for better understanding, and inlines feed configuration logic. Adds new tests to verify how category, post-processing, script, and priority settings are applied hierarchically. Also provides a default display for empty RSS log categories.
2026-05-11 15:45:24 +02:00
Safihre 2122503762 Update copyright to 2026 2026-02-09 16:44:38 +01:00
Safihre 3384beed24 Make black 26.1.0 happy again - almost 2026-01-19 12:42:51 +01:00
thezoggy dd0122865a bump copyright year (#3034) 2025-02-17 14:06:12 +01:00
thezoggy 9f6a9f9912 normalize and update copyright year 2024-01-02 09:42:17 +01:00
Safihre d516cbf363 Correct tests and improvements for new Duplicate handling 2023-11-22 16:13:22 +01:00
Safihre 223fa421c7 Implement more sophisticated duplicate handling
[skip ci]
2023-11-22 16:13:22 +01:00
Safihre 16803b9f17 Remove build_history to unpack_history hack and make output consistent
`id` is only internal id, external apps cannot use it for anything and should use `nzo_id`
`script_log` is always empty
2023-10-06 10:20:18 +02:00
Safihre 7cbbff727f Remove (almost) all references to unused team@sabnzbd.org 2023-07-21 11:33:51 +02:00
Safihre fe0c4e4f92 Update formatting with black 23 rules 2023-02-01 20:42:06 +01:00
thezoggyandSafihre fb04b58b57 selenium syntax update (#2271)
* handle sab path with spaces

* fix py3.10 win "Unable to remove cache dir"

* remove unused imports

* update selenium find_element(s) syntax

* Fix selenium_wrapper usage

Co-authored-by: Safihre <safihre@sabnzbd.org>
2022-08-19 22:25:48 +02:00
Safihre 73ec5df88d Move test_adding_nzbs_nzoids to separate module to have a clean instance 2022-04-28 11:08:50 +02:00
Safihre 82e0635995 Previous tests could break nzo_ids test 2022-04-27 14:30:53 +02:00
Safihre bbce0afbf4 Add tests for correct nzo_ids on failed NZBs 2022-04-26 16:00:08 +02:00
Safihre a7c29fa317 Refactor NZB rejection, no nzo_ids were returned for Fail to history
See: https://forums.sabnzbd.org/viewtopic.php?p=127386
2022-04-26 12:36:46 +02:00
Safihre 651591a063 Correctly implement skipping duplicate check if the job is forced
Closes #2032
2022-01-21 16:39:08 +01:00
jcfp 68eded2c0c remove unused imports (#1966) 2021-10-19 19:29:54 +02:00
Safihre a7a3334c9a Duplicate check based on md5 was performed before md5 was calculated
The side effect of this change is also that if you have an nzb-backup dir with the file already present that this second will be found duplicate, even before the first job has finished in the queue. Relates to #727
2021-07-01 10:46:51 +03:00
jcfp 5ab6de8123 cut closer to the middle to avoid random test failures (#1874) 2021-04-30 10:45:51 +02:00
Safihre faf1a44944 Black formatting update 2021-04-26 10:52:11 +02:00
jcfp 29c727319d Test adding nzbs (#1760)
* add tests for adding nzbs

* restore clean_cache_dir fixture, unbreak utils tests

* include tests for partial and malformed nzbs

* test handling of prio from nzb metadata category

* update params of test_adding_nzbs_malformed

* add metadata to sabnews nzb creator

* also test with size_limit

* test prio with dupe detection

* remove leftover todo entry

* move pause and cleanup to fixture; rename functions
2021-02-02 22:58:20 +01:00