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

Consider using margo for integration tests involving registries. #879

Open
suaviloquence opened this issue Aug 22, 2024 · 1 comment
Open
Labels
C-enhancement Category: raise the bar on expectations

Comments

@suaviloquence
Copy link
Contributor

Describe your use case

As part of the effort to write snapshot tests for cargo-semver-checks edge cases (see #846), we need to use a Cargo registry for some edge cases, for example when the baseline version is yanked as in #275. It is probably not ideal both in terms of stress on crates.io and testing speed to use the official crates.io registry.

Describe the solution you'd like

One alternative registry is margo, which is a tool that creates a (sparse) registry of static files, that can be hosted on any HTTP server. This would be better than using crates.io because it is a sparse registry, so we don't have to download the index, and it can also be hosted locally because it's just static files.

It looks like margo added support for yanking, so it would at least be sufficent for testing that edge case.

Alternatives, if applicable

There may be similar projects/alternative registries. We will also need to determine whether to host a test registry publicly (e.g., on GitHub pages, which would make our tests require internet access), locally (ad-hoc server on test run, which would be more complex), or a mix of the two.

Additional Context

No response

@suaviloquence suaviloquence added the C-enhancement Category: raise the bar on expectations label Aug 22, 2024
@obi1kenobi
Copy link
Owner

Using a GitHub pages test registry in a GitHub Actions CI job would be totally fine. I wouldn't add it in the suite that cargo test runs by default. But we have plenty of dedicated CI jobs that require internet access already and test for various regressions, and it's worked out reasonably so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: raise the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants