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

Convert test-recipes into local noarch packages #12879

Merged
merged 9 commits into from
Jul 17, 2023

Conversation

kenodegard
Copy link
Contributor

@kenodegard kenodegard commented Jul 13, 2023

Description

In our tests we have a number of test recipes, specifically tests/test-recipes. Some of these recipes were built years ago and uploaded to the conda-test channel (e.g. https://anaconda.org/conda-test/b_post_link_package) and the others are built every time the tests runs, e.g.:

conda/tests/conftest.py

Lines 21 to 36 in 70aeb74

def _conda_build_recipe(recipe):
subprocess.run(
["conda-build", str(Path(__file__).resolve().parent / "test-recipes" / recipe)],
check=True,
)
return recipe
@pytest.fixture(scope="session")
def activate_deactivate_package():
return _conda_build_recipe("activate_deactivate_package")
@pytest.fixture(scope="session")
def pre_link_messages_package():
return _conda_build_recipe("pre_link_messages_package")

This is unnecessarily expensive so lets convert the recipes to noarch and add the packages directly to the repo so we don't have to rely on the conda-test channel!

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@kenodegard kenodegard requested a review from a team as a code owner July 13, 2023 01:28
@kenodegard kenodegard self-assigned this Jul 13, 2023
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jul 13, 2023
@kenodegard kenodegard force-pushed the inline-test-packages branch from 94bd72a to cc9a4d6 Compare July 14, 2023 22:35
Comment on lines +768 to +771
# create a temporary conda-bld
conda_bld_sub = tmp_path / context.subdir
conda_bld_sub.mkdir(exist_ok=True)
tar_bld_path = str(conda_bld_sub / tar_path.name)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We move the tarball into a temporary directory to avoid polluting subsequent tests.

Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

Excellent work!

Copy link
Contributor

@travishathaway travishathaway left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jezdez jezdez merged commit d312f32 into conda:main Jul 17, 2023
@kenodegard kenodegard deleted the inline-test-packages branch July 17, 2023 12:22
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jul 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants