chore: Move all integration tests to a single binary (#8093)

As per
https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html

Before that, there were 91 separate integration tests binary.

(As discussed on Discord — I've done the `uv` crate, there's still a few
more commits coming before this is mergeable, and I want to see how it
performs in CI and locally).
This commit is contained in:
Amos Wenger 2024-10-11 16:41:35 +02:00 committed by GitHub
parent fce7a838e9
commit 715f28fd39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
231 changed files with 15585 additions and 15507 deletions

View file

@ -51,11 +51,11 @@ LOCK_TEMPLATE = TEMPLATES / "lock.mustache"
PACKSE = TOOL_ROOT / "packse-scenarios"
REQUIREMENTS = TOOL_ROOT / "requirements.txt"
PROJECT_ROOT = TOOL_ROOT.parent.parent
TESTS = PROJECT_ROOT / "crates" / "uv" / "tests"
TESTS = PROJECT_ROOT / "crates" / "uv" / "tests" / "it"
INSTALL_TESTS = TESTS / "pip_install_scenarios.rs"
COMPILE_TESTS = TESTS / "pip_compile_scenarios.rs"
LOCK_TESTS = TESTS / "lock_scenarios.rs"
TESTS_COMMON_MOD_RS = TESTS / "common/mod.rs"
TESTS_COMMON_MOD_RS = TESTS / "common" / "mod.rs"
try:
import packse

View file

@ -13,9 +13,7 @@ use assert_cmd::assert::OutputAssertExt;
use assert_fs::fixture::{FileWriteStr, PathChild};
use predicates::prelude::predicate;
use common::{build_vendor_links_url, packse_index_url, python_path_with_versions, get_bin, uv_snapshot, TestContext};
mod common;
use crate::common::{build_vendor_links_url, packse_index_url, python_path_with_versions, get_bin, uv_snapshot, TestContext};
/// Provision python binaries and return a `pip compile` command with options shared across all scenarios.
fn command(context: &TestContext, python_versions: &[&str]) -> Command {

View file

@ -11,11 +11,7 @@ use std::process::Command;
use assert_cmd::assert::Assert;
use assert_cmd::prelude::*;
use common::{venv_to_interpreter};
use crate::common::{build_vendor_links_url, get_bin, packse_index_url, uv_snapshot, TestContext};
mod common;
use crate::common::{venv_to_interpreter, build_vendor_links_url, get_bin, packse_index_url, uv_snapshot, TestContext};
fn assert_command(venv: &Path, command: &str, temp_dir: &Path) -> Assert {

View file

@ -5,15 +5,15 @@
//!
#![cfg(all(feature = "python", feature = "pypi"))]
#![allow(clippy::needless_raw_string_hashes)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::doc_lazy_continuation)]
use anyhow::Result;
use assert_cmd::assert::OutputAssertExt;
use assert_fs::prelude::*;
use insta::assert_snapshot;
use common::{packse_index_url, TestContext, uv_snapshot};
mod common;
use crate::common::{packse_index_url, TestContext, uv_snapshot};
{{#scenarios}}
@ -61,7 +61,7 @@ fn {{module_name}}() -> Result<()> {
);
{{#expected.satisfiable}}
let lock = context.read("uv.lock")();
let lock = context.read("uv.lock");
insta::with_settings!({
filters => filters,
}, {