]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109162: libregrtest: add worker.py (#109229)
authorVictor Stinner <vstinner@python.org>
Sun, 10 Sep 2023 23:11:22 +0000 (01:11 +0200)
committerGitHub <noreply@github.com>
Sun, 10 Sep 2023 23:11:22 +0000 (01:11 +0200)
commita939b65aa63e2cae1eec7d27e1dc56324aee01d7
tree46d5c1d3485b3788013192fe8ff22b0ffe188269
parente55aab95786e0e9fb36a9a1122d2d0fb3d2403cd
gh-109162: libregrtest: add worker.py (#109229)

Add new worker.py file:

* Move create_worker_process() and worker_process() to this file.
* Add main() function to worker.py. create_worker_process() now
  runs the command: "python -m test.libregrtest.worker JSON".
* create_worker_process() now starts the worker process in the
  current working directory. Regrtest now gets the absolute path of
  the reflog.txt filename: -R command line option filename.
* Remove --worker-json command line option.
  Remove test_regrtest.test_worker_json().

Related changes:

* Add write_json() and from_json() methods to TestResult.
* Rename select_temp_dir() to get_temp_dir() and move it to utils.
* Rename make_temp_dir() to get_work_dir() and move it to utils.
  It no longer calls os.makedirs(): Regrtest.main() now calls it.
* Move fix_umask() to utils. The function is now called by
  setup_tests().
* Move StrPath to utils.
* Add exit_timeout() context manager to utils.
* RunTests: Replace junit_filename (StrPath) with use_junit (bool).
Lib/test/libregrtest/cmdline.py
Lib/test/libregrtest/main.py
Lib/test/libregrtest/refleak.py
Lib/test/libregrtest/results.py
Lib/test/libregrtest/runtest.py
Lib/test/libregrtest/runtest_mp.py
Lib/test/libregrtest/setup.py
Lib/test/libregrtest/utils.py
Lib/test/libregrtest/worker.py [new file with mode: 0644]
Lib/test/test_regrtest.py