From 8137419d93cf900618a60daeac3716f03b401e1b Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 18 Nov 2024 10:40:29 +0100 Subject: [PATCH 1/2] Rust: only accept `options.yml` in QL tests --- rust/extractor/src/config.rs | 8 +------- .../qltest/failing_cargo_check/{options => options.yml} | 0 .../extractor-tests/generated/{options => options.yml} | 0 .../library-tests/controlflow/{options => options.yml} | 0 rust/ql/test/{options => options.yml} | 0 .../test/query-tests/diagnostics/{options => options.yml} | 0 6 files changed, 1 insertion(+), 7 deletions(-) rename rust/ql/integration-tests/qltest/failing_cargo_check/{options => options.yml} (100%) rename rust/ql/test/extractor-tests/generated/{options => options.yml} (100%) rename rust/ql/test/library-tests/controlflow/{options => options.yml} (100%) rename rust/ql/test/{options => options.yml} (100%) rename rust/ql/test/query-tests/diagnostics/{options => options.yml} (100%) diff --git a/rust/extractor/src/config.rs b/rust/extractor/src/config.rs index 8520df189304..fda866c24c8d 100644 --- a/rust/extractor/src/config.rs +++ b/rust/extractor/src/config.rs @@ -62,13 +62,7 @@ impl Config { .ancestors() // only travel up while we're within the test pack .take_while_inclusive(|p| !p.join("qlpack.yml").exists()) - .flat_map(|p| { - [ - p.join("options"), - p.join("options.yml"), - p.join("options.yaml"), - ] - }) + .map(|p| p.join("options.yml")) .filter(|p| p.exists()) .collect_vec(); option_files.reverse(); diff --git a/rust/ql/integration-tests/qltest/failing_cargo_check/options b/rust/ql/integration-tests/qltest/failing_cargo_check/options.yml similarity index 100% rename from rust/ql/integration-tests/qltest/failing_cargo_check/options rename to rust/ql/integration-tests/qltest/failing_cargo_check/options.yml diff --git a/rust/ql/test/extractor-tests/generated/options b/rust/ql/test/extractor-tests/generated/options.yml similarity index 100% rename from rust/ql/test/extractor-tests/generated/options rename to rust/ql/test/extractor-tests/generated/options.yml diff --git a/rust/ql/test/library-tests/controlflow/options b/rust/ql/test/library-tests/controlflow/options.yml similarity index 100% rename from rust/ql/test/library-tests/controlflow/options rename to rust/ql/test/library-tests/controlflow/options.yml diff --git a/rust/ql/test/options b/rust/ql/test/options.yml similarity index 100% rename from rust/ql/test/options rename to rust/ql/test/options.yml diff --git a/rust/ql/test/query-tests/diagnostics/options b/rust/ql/test/query-tests/diagnostics/options.yml similarity index 100% rename from rust/ql/test/query-tests/diagnostics/options rename to rust/ql/test/query-tests/diagnostics/options.yml From b11388c49b91a8b787e6e16e5fad8a7061713f61 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 18 Nov 2024 12:06:25 +0100 Subject: [PATCH 2/2] Rust: accept test changes --- rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected | 1 + .../query-tests/diagnostics/LinesOfUserCodeInFiles.expected | 1 + rust/ql/test/query-tests/diagnostics/SummaryStats.expected | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected b/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected index c5ebb7072304..bc8dc8cccf15 100644 --- a/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/ExtractedFiles.expected @@ -5,3 +5,4 @@ | main.rs:0:0:0:0 | main.rs | File successfully extracted. | | my_macro.rs:0:0:0:0 | my_macro.rs | File successfully extracted. | | my_struct.rs:0:0:0:0 | my_struct.rs | File successfully extracted. | +| options.yml:0:0:0:0 | options.yml | File successfully extracted. | diff --git a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected index fe63f68abd8b..b34654710961 100644 --- a/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected +++ b/rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected @@ -5,3 +5,4 @@ | lib.rs:0:0:0:0 | lib.rs | 5 | | does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 | | error.rs:0:0:0:0 | error.rs | 3 | +| options.yml:0:0:0:0 | options.yml | 0 | diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index c8e473840b0f..aeba0ac1ee6c 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -2,9 +2,9 @@ | Elements unextracted | 0 | | Extraction errors | 0 | | Extraction warnings | 7 | -| Files extracted - total | 7 | +| Files extracted - total | 8 | | Files extracted - with errors | 2 | -| Files extracted - without errors | 5 | +| Files extracted - without errors | 6 | | Inconsistencies - AST | 0 | | Inconsistencies - CFG | 0 | | Inconsistencies - data flow | 0 |