Skip to content

Commit

Permalink
feat: serialize tests to YAML (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Jun 19, 2024
1 parent 48b7e05 commit 4c10a0c
Show file tree
Hide file tree
Showing 21 changed files with 454 additions and 337 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: '(\.patch|\.diff|\.snap|test-data/recipes/test-parsing/.+)$'
exclude: '(\.patch|\.diff|\.snap|\.ambr|test-data/recipes/test-parsing/.+)$'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ platforms = ["linux-64", "win-64", "osx-64", "osx-arm64"]
[tasks]
build = "cargo build --release"
install = "cargo install --path . --locked"
end_to_end_test = "pytest test/end-to-end --snapshot-warn-unused"
end_to_end_test = "pytest test/end-to-end --snapshot-warn-unused --snapshot-details"
test = "cargo test"
lint = "pre-commit run --all"
generate-cli-docs = "cargo run --bin generate-cli-docs --features generate-cli-docs > docs/reference/cli.md"
Expand Down
25 changes: 0 additions & 25 deletions rust-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,31 +463,6 @@ mod tests {
assert!(rattler_build.status.code().unwrap() == 1);
}

#[test]
fn test_noarch_flask() {
let tmp = tmp("test_noarch_flask");
let rattler_build = rattler().build(recipes().join("flask"), tmp.as_dir(), None, None);

assert!(rattler_build.status.success());

let pkg = get_extracted_package(tmp.as_dir(), "flask");
// this is to ensure that the clone happens correctly
let license = pkg.join("info/licenses/LICENSE.rst");
assert!(license.exists());

assert!(pkg.join("info/tests/1/run_test.sh").exists());
assert!(pkg.join("info/tests/1/run_test.bat").exists());
assert!(pkg
.join("info/tests/1/test_time_dependencies.json")
.exists());

assert!(pkg.join("info/tests/0/python_test.json").exists());
// make sure that the entry point does not exist
assert!(!pkg.join("python-scripts/flask").exists());

assert!(pkg.join("info/link.json").exists())
}

#[test]
fn test_files_copy() {
if cfg!(target_os = "windows") {
Expand Down
2 changes: 1 addition & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub async fn run_build(
// We run all the package content tests
for test in output.recipe.tests() {
// TODO we could also run each of the (potentially multiple) test scripts and collect the errors
if let TestType::PackageContents(package_contents) = test {
if let TestType::PackageContents { package_contents } = test {
package_contents
.run_test(&paths_json, &output.build_configuration.target_platform)
.into_diagnostic()?;
Expand Down
Loading

0 comments on commit 4c10a0c

Please sign in to comment.