Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests on all platforms #208

Draft
wants to merge 5 commits into
base: 1.x
Choose a base branch
from

Conversation

mbargull
Copy link
Member

@mbargull mbargull commented Feb 1, 2024

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

…nda-forge-pinning 2024.02.01.06.13.37

Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@mbargull mbargull force-pushed the 1.x-windows-tests branch 3 times, most recently from ad77bdb to d2fdd96 Compare February 1, 2024 18:40
Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
As of now, one would need to add the conda-forge/label/cf201901 to
install python=2.7 on Windows, see
conda-forge/python-feedstock#637 .
Now in 2024, it should be fine if we just test with another old version.

Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
- cmd /q /c "for /f "delims=" %%f in ('C:\Windows\System32\where mamba.exe') do if "%%~dpf"=="%SCRIPTS%\" (exit 0) else (exit 1)" # [win]

# We need to run with "call" on Windows since "mamba" runs the batch file; make "call" a passthrough function on Unixes.
- call() { "${@}" ; } # [unix]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining this pass-through function here allows us to have the test below uniform on all platform so we can avoid duplication and overall maintenance burden.


# Ensure we run the executable from the prefix and not from the base installation.
- test "$(command -v mamba)" = "${PREFIX}/bin/mamba" # [unix]
- cmd /q /c "for /f "delims=" %%f in ('C:\Windows\System32\where mamba.bat') do if "%%~dpf"=="%LIBRARY_BIN%\" (exit 0) else (exit 1)" # [win]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cryptic Batch nonsense should be equivalent to the POSIX shell test above it and checks that the first entry on PATH with the executable is the one we want to test.
It's wrapped in a cmd /c call since we have an exit 0 in there (to only check the first entry) which would exit the whole test script if it wasn't wrapped in a subprocess.
I tried to use findstr "/C:%PREFIX%" in there, but it turns out that the search strings for findstr are length-limited far below the PREFIX' lengths we use.

# We need to run with "call" on Windows since "mamba" runs the batch file; make "call" a passthrough function on Unixes.
- call() { "${@}" ; } # [unix]
- call mamba --help
- call mamba create -n test_py37 python=3.7 --dry-run
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python=2.7 can't be installed on Windows anymore since vc=9 is on the cf201901 label.
We'd have to use that label (or defaults, I guess) in there to make it work.
But... we could also just not care too much about python=2.7 anymore and use another (by now old) version.

@mbargull mbargull marked this pull request as ready for review February 2, 2024 10:52
@mbargull mbargull marked this pull request as draft February 2, 2024 10:56
@mbargull
Copy link
Member Author

mbargull commented Feb 2, 2024

As reported in mamba-org/mamba#3033 (comment) and mamba-org/mamba#3033 (comment) , this has some problems with only python=3.12 and python=3.11:
https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=868961&view=logs&j=a70f640f-cc53-5cd3-6cdc-236a1aa90802&t=6119ccbe-9301-594f-7c27-f792b80a7fcc&l=13405
https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=868961&view=logs&j=a70f640f-cc53-5cd3-6cdc-236a1aa90802&t=6119ccbe-9301-594f-7c27-f792b80a7fcc&l=17095

TEST START: D:\bld\win-64\mamba-1.5.6-py312h5494d5c_0.conda
[...]
Currently, only install, create, list, search, run, info, clean, remove, update, repoquery, activate and deactivate are supported through mamba.
TEST START: D:\bld\win-64\mamba-1.5.6-py311h8cb466b_0.conda
[...]
Currently, only install, create, list, search, run, info, clean, remove, update, repoquery, activate and deactivate are supported through mamba.

This happens on all tested platforms for the repoquery command, but not for Python 3.8, 3.9, 3.10.
create/clean/install commands seem to work fine.

Unfortunately, it also does not seem to emit non-zero exit codes in the failure cases, which is why the tests in this feedstock didn't catch this.

Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant