Skip to content

Commit

Permalink
Debug on repoquery test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed Jan 14, 2025
1 parent e1bb784 commit 70b3e7b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unix_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
run: |
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba
unset CONDARC # Interferes with tests
python -m pytest micromamba/tests/ \
python -m pytest micromamba/tests/test_repoquery.py::test_whoneeds_not_installed_with_channel_no_json \
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }}
verify_pkg_tests:
Expand Down
2 changes: 2 additions & 0 deletions libmamba/src/core/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,10 @@ namespace mamba
std::string depends_qualifier;
for (const auto& dep : pkg.dependencies)
{
std::cout << "dep: " << dep << " args i: " << args[i] << std::endl;
if (util::starts_with(dep, args[i]))
{
std::cout << "Pushing bak dep " << std::endl;
depends_qualifier = dep;
break;
}
Expand Down
39 changes: 26 additions & 13 deletions micromamba/tests/test_repoquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,33 @@ def test_whoneeds_not_installed_with_channel(yaml_env: Path, with_platform):
assert any(x["name"] == "qpot" for x in pkgs)


@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
@pytest.mark.parametrize("spec", ("xtensor", "xtensor=0.24.5"))
def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path, spec):
res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64")
# @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
# @pytest.mark.parametrize("spec", ("xtensor", "xtensor=0.24.5"))
# def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path, spec):
# res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64")
# assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res)
# if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?)
# print(res)
# assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res)
# else:
# print(res)
# assert (
# "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64"
# in helpers.remove_whitespaces(res)
# )


# @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path):
res = helpers.umamba_repoquery(
"whoneeds", "-c", "conda-forge", "xtensor", "--platform", "osx-64"
)
assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res)
if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?)
print(res)
assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res)
else:
print(res)
assert (
"cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64"
in helpers.remove_whitespaces(res)
)

print(res)
assert "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64" in helpers.remove_whitespaces(
res
)


@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
Expand Down

0 comments on commit 70b3e7b

Please sign in to comment.