From c6acb5abec14810606d75c7fe1da3c1668d1199b Mon Sep 17 00:00:00 2001 From: ori-kron-wis Date: Wed, 9 Oct 2024 19:41:53 +0300 Subject: [PATCH] fixed the test workwflow --- .../test_linux_custom_dataloader.yml | 2 +- .../dataloaders/test_czi_custom_dataloader.py | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_linux_custom_dataloader.yml b/.github/workflows/test_linux_custom_dataloader.yml index 53d6de3353..30e2e1d222 100644 --- a/.github/workflows/test_linux_custom_dataloader.yml +++ b/.github/workflows/test_linux_custom_dataloader.yml @@ -66,7 +66,7 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | git config --global url."https://${GH_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/" - git clone --single-branch --branch ebezzi/census-scvi-datamodule https://github.com/chanzuckerberg/cellxgene-census.git + git clone --single-branch --branch ebezzi/census-scvi-datamodule https://github.com/ori-kron-wis/cellxgene-census.git git clone --single-branch --branch main https://github.com/jkobject/scDataLoader.git - name: Run specific custom dataloader pytest diff --git a/tests/dataloaders/test_czi_custom_dataloader.py b/tests/dataloaders/test_czi_custom_dataloader.py index 060b9f6fed..662c6d6166 100644 --- a/tests/dataloaders/test_czi_custom_dataloader.py +++ b/tests/dataloaders/test_czi_custom_dataloader.py @@ -2,20 +2,31 @@ from pprint import pprint -import cellxgene_census import numpy as np import pandas as pd import pytest -import tiledbsoma as soma -from cellxgene_census.experimental.ml import experiment_dataloader -from cellxgene_census.experimental.ml.datamodule import CensusSCVIDataModule import scvi from scvi.data import synthetic_iid @pytest.mark.custom_dataloader -def test_czi_custom_dataloader(save_path="."): +def test_czi_custom_dataloader(save_path): + # local bracnh with fix only for this test + import sys + + # should be ready for importing the cloned branch on a remote machine that runs github action + sys.path.insert( + 0, + "/home/runner/work/scvi-tools/scvi-tools/" + "cellxgene-census/api/python/cellxgene_census/src", + ) + sys.path.insert(0, "src") + import cellxgene_census + import tiledbsoma as soma + from cellxgene_census.experimental.ml import experiment_dataloader + from cellxgene_census.experimental.ml.datamodule import CensusSCVIDataModule + # this test checks the local custom dataloder made by CZI and run several tests with it census = cellxgene_census.open_soma(census_version="stable")