[med-svn] [Git][med-team/snakemake][master] 3 commits: (Build-)Depends: python3-pygraphviz

Andreas Tille gitlab at salsa.debian.org
Mon Jul 9 13:13:34 BST 2018


Andreas Tille pushed to branch master at Debian Med / snakemake


Commits:
f5bd582b by Andreas Tille at 2018-06-29T16:48:09+02:00
(Build-)Depends: python3-pygraphviz

- - - - -
973feff8 by Andreas Tille at 2018-06-29T16:59:06+02:00
TODO: How to exclude tests requiring remote access?

- - - - -
b6373c55 by Andreas Tille at 2018-07-09T14:13:10+02:00
Skip tests on missing inet connection or if not in CI

- - - - -


4 changed files:

- debian/changelog
- debian/control
- + debian/patches/0012-skip_test_needing_networ_connection.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,9 +8,12 @@ snakemake (5.1.5-1) UNRELEASED; urgency=medium
   * Build-Depends: r-cran-rmarkdown and disable patch that skips test using
     RMarkdown
   * Recommends: r-cran-rmarkdown
-  * Build-Depends: python3-datrie, python3-networkx, python3-recommonmark
+  * (Build-)Depends: python3-datrie, python3-networkx, python3-recommonmark,
+    python3-pygraphviz, python3-pytest
   * Point Vcs-fields to Salsa
   * Drop X-Python-Version
+  * Merge upstream commit to skip tests needing network access (upstream issue
+    #902)
 
  -- Andreas Tille <tille at debian.org>  Tue, 26 Jun 2018 11:18:08 +0200
 


=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends: debhelper (>= 11~),
                python3-networkx,
                python3-nose,
                python3-psutil,
+               python3-pygraphviz,
                python3-pytools,
                python3-ratelimiter,
                python3-recommonmark,
@@ -22,6 +23,7 @@ Build-Depends: debhelper (>= 11~),
                python3-wrapt,
                python3-yaml,
                python3-sphinx-rtd-theme,
+               python3-pytest,
                ca-certificates,
                r-cran-rmarkdown
 Standards-Version: 4.1.4
@@ -39,6 +41,7 @@ Depends: ${misc:Depends},
          python3-datrie,
          python3-networkx,
          python3-psutil,
+         python3-pygraphviz,
          python3-pytools,
          python3-ratelimiter,
          python3-recommonmark,


=====================================
debian/patches/0012-skip_test_needing_networ_connection.patch
=====================================
--- /dev/null
+++ b/debian/patches/0012-skip_test_needing_networ_connection.patch
@@ -0,0 +1,195 @@
+Origin: https://bitbucket.org/snakemake/snakemake/commits/4741705d0b07e1131ed0cc940b53a802f49ead42
+Description: Skip tests on missing inet connection or if not in CI.
+Author: Johannes Köster <johannes.koester at tu-dortmund.de>
+Last-Update: Mon Jul 9 11:30:23 2018 +0200
+Bug-Upstream: https://bitbucket.org/snakemake/snakemake/issues/902/how-to-reliably-exclude-tests-requiring
+
+--- a/tests/tests.py
++++ b/tests/tests.py
+@@ -13,6 +13,7 @@ import hashlib
+ import urllib
+ from shutil import rmtree, which
+ from shlex import quote
++import pytest
+ 
+ from snakemake import snakemake
+ from snakemake.shell import shell
+@@ -43,6 +44,18 @@ def is_connected():
+         return False
+ 
+ 
++def is_ci():
++    return "CI" in os.environ
++
++
++def has_gcloud_service_key():
++    return "GCLOUD_SERVICE_KEY" in os.environ
++
++
++def has_gcloud_cluster():
++    return "GCLOUD_CLUSTER" in os.environ
++
++
+ def copy(src, dst):
+     if os.path.isdir(src):
+         shutil.copytree(src, os.path.join(dst, os.path.basename(src)))
+@@ -52,7 +65,6 @@ def copy(src, dst):
+ 
+ def run(path,
+         shouldfail=False,
+-        needs_connection=False,
+         snakefile="Snakefile",
+         subpath=None,
+         check_md5=True, cores=3, **params):
+@@ -61,12 +73,6 @@ def run(path,
+     There must be a Snakefile in the path and a subdirectory named
+     expected-results.
+     """
+-
+-    if needs_connection and not is_connected():
+-        print("Skipping test because of missing internet connection",
+-              file=sys.stderr)
+-        return False
+-
+     results_dir = join(path, 'expected-results')
+     snakefile = join(path, snakefile)
+     assert os.path.exists(snakefile)
+@@ -254,8 +260,9 @@ def test_persistent_dict():
+         pass
+ 
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_url_include():
+-    run(dpath("test_url_include"), needs_connection=True)
++    run(dpath("test_url_include"))
+ 
+ 
+ def test_touch():
+@@ -444,6 +451,7 @@ def test_spaces_in_fnames():
+ #         pass
+ 
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_remote_ncbi_simple():
+     try:
+         import Bio
+@@ -454,6 +462,7 @@ def test_remote_ncbi_simple():
+     except ImportError:
+         pass
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_remote_ncbi():
+     try:
+         import Bio
+@@ -465,6 +474,7 @@ def test_remote_ncbi():
+         pass
+ 
+ 
++ at pytest.mark.skipif(not is_ci(), reason="not in CI")
+ def test_remote_irods():
+     if os.environ.get("CI") == "true":
+         run(dpath("test_remote_irods"))
+@@ -569,6 +579,8 @@ def test_run_namedlist():
+     run(dpath("test_run_namedlist"))
+ 
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
++ at pytest.mark.skipif(not is_ci(), reason="not in CI")
+ def test_remote_gs():
+     if not "CI" in os.environ:
+         run(dpath("test_remote_gs"))
+@@ -576,13 +588,17 @@ def test_remote_gs():
+         print("skipping test_remove_gs in CI")
+ 
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_remote_log():
+     run(dpath("test_remote_log"), shouldfail=True)
+ 
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_remote_http():
+     run(dpath("test_remote_http"))
+ 
++
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_remote_http_cluster():
+     run(dpath("test_remote_http"), cluster=os.path.abspath(dpath("test14/qsub")))
+ 
+@@ -590,6 +606,7 @@ def test_profile():
+     run(dpath("test_profile"))
+ 
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_singularity():
+     run(dpath("test_singularity"), use_singularity=True)
+ 
+@@ -613,28 +630,52 @@ def test_archive():
+ def test_log_input():
+     run(dpath("test_log_input"))
+ 
+-
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
++ at pytest.mark.skipif(not is_ci(), reason="no in CI")
++ at pytest.mark.skipif(not has_gcloud_service_key(), reason="GCLOUD_SERVICE_KEY undefined")
++ at pytest.mark.skipif(not has_gcloud_cluster(), reason="GCLOUD_CLUSTER undefined")
+ def test_gcloud():
+-    if "CI" in os.environ and "GCLOUD_SERVICE_KEY" in os.environ:
+-        cluster = os.environ["GCLOUD_CLUSTER"]
+-        try:
+-            shell("""
+-            sudo $GCLOUD container clusters create {cluster} --num-nodes 3 --scopes storage-rw --zone us-central1-a --machine-type f1-micro
+-            sudo $GCLOUD container clusters get-credentials {cluster} --zone us-central1-a
+-            """)
+-            run(dpath("test_kubernetes"))
+-            run(dpath("test_kubernetes"), use_conda=True)
+-            run(dpath("test_kubernetes"), use_singularity=True)
+-            run(dpath("test_kubernetes"), use_singularity=True, use_conda=True)
+-        finally:
+-            shell("sudo $GCLOUD container clusters delete {cluster} --zone us-central1-a --quiet")
+-    print("Skipping google cloud test")
++    cluster = os.environ["GCLOUD_CLUSTER"]
++    bucket_name = 'snakemake-testing-{}'.format(cluster)
++
++    def run_kubernetes(**kwargs):
++        run(dpath("test_kubernetes"),
++            kubernetes="default",
++            default_remote_provider="GS",
++            default_remote_prefix=bucket_name,
++            no_tmpdir=True,
++            **kwargs)
++    def reset():
++        shell('$GSUTIL rm -r gs://{}/*'.format(bucket_name))
++ 
++    try:
++        shell("""
++        $GCLOUD container clusters create {cluster} --num-nodes 3 --scopes storage-rw --zone us-central1-a --machine-type f1-micro
++        $GCLOUD container clusters get-credentials {cluster} --zone us-central1-a
++        $GSUTIL mb gs://{bucket_name}
++        """)
++        run_kubernetes()
++        reset()
++        run_kubernetes(use_conda=True)
++        reset()
++        run_kubernetes(use_singularity=True)
++        reset()
++        run_kubernetes(use_singularity=True, use_conda=True)
++        reset()
++    except:
++        shell("for p in `kubectl get pods | grep ^snakejob- | cut -f 1 -d ' '`; do kubectl logs $p; done")
++    finally:
++        shell("""
++        $GCLOUD container clusters delete {cluster} --zone us-central1-a --quiet
++        $GSUTIL rm -r gs://{bucket_name}
++        """)
+ 
+ 
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_cwl():
+     run(dpath("test_cwl"))
+ 
+-
++ at pytest.mark.skipif(not is_connected(), reason="no internet connection")
+ def test_cwl_singularity():
+     run(dpath("test_cwl"), use_singularity=True)
+ 


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,7 @@
 0001-Use-the-inbuild-sphinx.ext.napoleon.patch
 0003-Use-debian-s-mathjax-package.patch
 0003-Compat-fix.patch
-0004-drop_test_symlink_time_handling.patch
+# 0004-drop_test_symlink_time_handling.patch
 # 0005-drop_test_symlink_temp.patch - should be fixed in commit d697f23
 0006-restore-bin.patch
 # 0007-noop-rate-limiter.patch - broken and obsolete with https://bugs.debian.org/880661
@@ -9,3 +9,4 @@
 0009-skip-test-without-google-cloud-sdk.patch
 # 0010-skip-test-without-rmarkdown.patch
 0011-fix-privacy-breach.patch
+0012-skip_test_needing_networ_connection.patch



View it on GitLab: https://salsa.debian.org/med-team/snakemake/compare/1b5e30fad2c562978cfda03691b131c787d54ef6...b6373c551ff8415d0dc6176b674c9ca43a9047bb

-- 
View it on GitLab: https://salsa.debian.org/med-team/snakemake/compare/1b5e30fad2c562978cfda03691b131c787d54ef6...b6373c551ff8415d0dc6176b674c9ca43a9047bb
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/20180709/33a1e901/attachment-0001.html>


More information about the debian-med-commit mailing list