[med-svn] [Git][med-team/snakemake][debian-v7] 2 commits: Tests: don't fail if the pipe buffer is small.

Rebecca N. Palmer (@rnpalmer-guest) gitlab at salsa.debian.org
Sat Aug 3 09:42:29 BST 2024



Rebecca N. Palmer pushed to branch debian-v7 at Debian Med / snakemake


Commits:
adf6af9c by Rebecca N. Palmer at 2024-08-03T09:39:54+01:00
Tests: don't fail if the pipe buffer is small.

- - - - -
2e7ededd by Rebecca N. Palmer at 2024-08-03T09:41:00+01:00
Skip tests that crash in persistent_dict because
Debian's pytools is too old (workaround for #1076925).

- - - - -


5 changed files:

- debian/changelog
- debian/patches/cancelscript_debug.patch
- debian/patches/series
- + debian/patches/test_piperead.patch
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,10 @@
-snakemake (7.32.4-4) UNRELEASED; urgency=medium
+snakemake (7.32.4-4) unstable; urgency=medium
 
-  * cancelscript debug
+  * Tests: don't fail if the pipe buffer is small.
+  * Skip tests that crash in persistent_dict because
+    Debian's pytools is too old (workaround for #1076925).
 
- -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Fri, 02 Aug 2024 21:51:55 +0100
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Sat, 03 Aug 2024 09:40:51 +0100
 
 snakemake (7.32.4-3) unstable; urgency=medium
 


=====================================
debian/patches/cancelscript_debug.patch
=====================================
@@ -7,27 +7,20 @@ Forwarded: not-needed
 
 --- a/tests/common.py
 +++ b/tests/common.py
-@@ -226,6 +226,7 @@ def run(
-                     process.send_signal(signal.SIGINT)
-                     time.sleep(2)
-                     success = process.returncode == 0
-+                    run_stdout=process.stdout.read()
-         except subprocess.CalledProcessError as e:
-             success = False
-             print(e.stdout.decode(), file=sys.stderr)
-@@ -251,6 +252,9 @@ def run(
+@@ -257,6 +257,10 @@ def run(
          )
  
      if shouldfail:
 +        if shellcmd and "cancel" in shellcmd:
-+            print("cancel stdout:",run_stdout,"\nWorkdir:")
++            import io
++            print("buffer size",io.DEFAULT_BUFFER_SIZE,"cancel stdout:",run_stdout,"\nWorkdir:")
 +            print_tree(tmpdir, exclude=".snakemake/conda")
          assert not success, "expected error on execution"
      else:
          if not success:
 --- a/tests/tests.py
 +++ b/tests/tests.py
-@@ -133,11 +133,13 @@ def test_cluster_cancelscript():
+@@ -133,6 +133,7 @@ def test_cluster_cancelscript():
          cleanup=False,
          sigint_after=4,
      )
@@ -35,13 +28,7 @@ Forwarded: not-needed
      scancel_txt = open("%s/scancel.txt" % outdir).read()
      scancel_lines = scancel_txt.splitlines()
      assert len(scancel_lines) == 1
-     assert scancel_lines[0].startswith("cancel")
-     assert len(scancel_lines[0].split(" ")) == 3
-+    assert False, str(glob.glob(outdir+'/**/*',recursive=True))
- 
- 
- @skip_on_windows
-@@ -162,6 +164,7 @@ def test_cluster_cancelscript_nargs1():
+@@ -162,6 +163,7 @@ def test_cluster_cancelscript_nargs1():
          cleanup=False,
          sigint_after=4,
      )


=====================================
debian/patches/series
=====================================
@@ -18,4 +18,5 @@ skip-test_workflow_calling.patch
 no_mix_tabs_spaces.patch
 fstring.patch
 1068010_appdirs_to_platformdirs.patch
+test_piperead.patch
 cancelscript_debug.patch


=====================================
debian/patches/test_piperead.patch
=====================================
@@ -0,0 +1,28 @@
+Description: Don't fail tests if the pipe buffer is small
+
+(too small for the test stdout+stderr;
+unknown if this is why test_cluster_cancel* are failing on riscv64)
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Forwarded: no
+
+--- a/tests/common.py
++++ b/tests/common.py
+@@ -222,9 +222,15 @@ def run(
+                     stderr=subprocess.STDOUT,
+                     stdout=subprocess.PIPE,
+                 ) as process:
+-                    time.sleep(sigint_after)
++                    try:
++                        run_stdout,_=process.communicate(timeout=sigint_after)
++                    except TimeoutExpired as e:
++                        run_stdout=e.stdout
+                     process.send_signal(signal.SIGINT)
+-                    time.sleep(2)
++                    try:
++                        run_stdout=run_stdout+process.communicate(timeout=2)[0]
++                    except TimeoutExpired as e:
++                        run_stdout=run_stdout+e.stdout
+                     success = process.returncode == 0
+         except subprocess.CalledProcessError as e:
+             success = False


=====================================
debian/rules
=====================================
@@ -8,7 +8,7 @@ export PYBUILD_DESTDIR_python3=debian/snakemake
 # copy the tests and run them from there to avoid having to clean up after them
 export PYBUILD_BEFORE_TEST_python3=chmod +x {dir}/bin/snakemake; cp -r {dir}/bin {dir}/tests {build_dir}
 export PYBUILD_AFTER_TEST_python3=rm -fr {build_dir}/bin {build_dir}/tests
-export PYBUILD_TEST_ARGS=python{version} -m pytest -o faulthandler_timeout=60 -v {build_dir}/tests/test*.py -k 'not test_cwl and not test_cwl_singularity and not test_url_include and not test_wrapper and not test_issue1083 and not test_github_issue78 and not test_container and not test_singularity and not test_singularity_conda and not test_convert_to_cwl and not test_report and not test_report_zip and not test_archive and not test_jupyter_notebook and not test_conda and not test_upstream_conda and not test_conda_custom_prefix and not test_script and not test_issue635 and not test_issue1093 and not test_default_resources and not test_default_remote and not test_remote and not test_output_file_cache_remote and not test_tibanna and not test_module_complex and not test_module_complex2 and not test_module_with_script and not test_module_report and not test_modules_meta_wrapper and not test_tes and not test_deploy_script and not test_deploy_hashing and not test_peppy and not test_modules_peppy and not test_report_display_code and not test_wrapper_local_git_prefix and not test_github_issue1396 and not test_az_batch_executor and not test_modules_prefix and not test_ancient and not test_github_issue1062 and not test_symlink_time_handling and not test_env_modules and not test_github_issue1460 and not test_rule_inheritance_globals and not test_prebuilt_conda_script'
+export PYBUILD_TEST_ARGS=python{version} -m pytest -o faulthandler_timeout=60 -v {build_dir}/tests/test*.py -k 'not test_cwl and not test_cwl_singularity and not test_url_include and not test_wrapper and not test_issue1083 and not test_github_issue78 and not test_container and not test_singularity and not test_singularity_conda and not test_convert_to_cwl and not test_report and not test_report_zip and not test_archive and not test_jupyter_notebook and not test_conda and not test_upstream_conda and not test_conda_custom_prefix and not test_script and not test_issue635 and not test_issue1093 and not test_default_resources and not test_default_remote and not test_remote and not test_output_file_cache_remote and not test_tibanna and not test_module_complex and not test_module_complex2 and not test_module_with_script and not test_module_report and not test_modules_meta_wrapper and not test_tes and not test_deploy_script and not test_deploy_hashing and not test_peppy and not test_modules_peppy and not test_report_display_code and not test_wrapper_local_git_prefix and not test_github_issue1396 and not test_az_batch_executor and not test_modules_prefix and not test_ancient and not test_github_issue1062 and not test_symlink_time_handling and not test_env_modules and not test_github_issue1460 and not test_rule_inheritance_globals and not test_prebuilt_conda_script and not test_persistent_dict and not test_issue328'
 
 # Skipped because they download executables (which is forbidden in Debian buildd and debci)
 # Snakefile/snakemake-wrapper/CWL scripts: test_cwl, test_cwl_singularity, test_url_include, test_wrapper, test_wrapper_local_git_prefix, test_module_with_script, test_module_report, test_module_complex(2), test_modules_meta_wrapper
@@ -33,6 +33,7 @@ export PYBUILD_TEST_ARGS=python{version} -m pytest -o faulthandler_timeout=60 -v
 # Skipped in build to let reproducibility tests pass (it fails under faketime, with what looks like the outer script but not the rules running under it), but run in autopkgtest: test_symlink_time_handling
 
 # possibly an actual bug: test_env_modules
+# pytools too old, #1076925, only fail in build and not autopkgtest: test_persistent_dict test_issue328
 # should be marked google_credentials: test_github_issue1396
 # needs Azure credentials: test_az_batch_executor
 # the -o faulthandler_timeout=60 is because test_pipes_fail sometimes hangs



View it on GitLab: https://salsa.debian.org/med-team/snakemake/-/compare/e5cf130dda0a362caa4374fc8de95bbbdd05ba83...2e7ededd42d81005f1b1ccce65e20eb294480e72

-- 
View it on GitLab: https://salsa.debian.org/med-team/snakemake/-/compare/e5cf130dda0a362caa4374fc8de95bbbdd05ba83...2e7ededd42d81005f1b1ccce65e20eb294480e72
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240803/dacbdb11/attachment-0001.htm>


More information about the debian-med-commit mailing list