Skip to content

Commit

Permalink
Merge pull request #964 from btovar/taskvine_test_env
Browse files Browse the repository at this point in the history
test: taskvine with remote env
  • Loading branch information
lgray authored Dec 13, 2023
2 parents f9ba071 + f7f8e6c commit dc7c022
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ jobs:
run: |
conda create --yes --prefix ./coffea-conda-test-env -c conda-forge python=${{ matrix.python-version }} ndcctools
conda activate ./coffea-conda-test-env
python -m pip install -e ".[dev,dask]"
python -m pip install .
python -m pip install pytest
- name: Test with pytest
run: |
conda run --prefix ./coffea-conda-test-env pytest tests/test_taskvine.py
Expand Down
23 changes: 5 additions & 18 deletions tests/test_taskvine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
from sys import version_info

import hist.dask as hda
import pytest
Expand Down Expand Up @@ -48,31 +47,19 @@ def test_taskvine_local_env():
assert result.sum() == 40.0


@pytest.mark.skip(reason="need to investigate how to do conda-pack in ci")
@pytest.mark.skipif(
"'CONDA_PREFIX' not in os.environ",
reason="test needs a conda environment with coffea and ndcctools",
)
def test_taskvine_remote_env():
try:
from ndcctools.poncho import package_create
from ndcctools.taskvine import DaskVine, Factory
except ImportError:
print("taskvine is not installed. Omitting test.")
return

py_version = f"{version_info[0]}.{version_info[1]}.{version_info[2]}"

poncho_spec = {
"conda": {
"channels": ["conda-forge"],
"dependencies": [
f"python={py_version}",
"ndcctools",
"pip",
],
},
"pip": ["coffea"],
}

env_filename = "vine-env.tar.gz"
package_create.pack_env_from_dict(poncho_spec, env_filename)
package_create.pack_env(os.environ["CONDA_PREFIX"], env_filename)

m = DaskVine(port=0)
env = m.declare_poncho(env_filename, cache=True)
Expand Down

0 comments on commit dc7c022

Please sign in to comment.