From 0e3413a00339d62a930858116f667db16f198f51 Mon Sep 17 00:00:00 2001 From: Fabrizio Sestito Date: Tue, 12 Dec 2023 18:11:47 +0100 Subject: [PATCH] chore: move test_data under tests/data Signed-off-by: Fabrizio Sestito --- src/policy_evaluator/policy_evaluator_builder.rs | 2 +- src/runtimes/rego/context_aware.rs | 2 +- src/runtimes/wapc/runtime.rs | 2 +- {test_data => tests/data}/endless_wasm/.gitignore | 0 {test_data => tests/data}/endless_wasm/Makefile | 0 {test_data => tests/data}/endless_wasm/README.md | 0 {test_data => tests/data}/endless_wasm/wapc_endless_loop.wat | 0 {test_data => tests/data}/endless_wasm/wasm_endless_loop.wat | 0 .../kube_context/deployments/ingress/ingress-nginx.json | 0 .../fixtures/kube_context/deployments/kube-system/coredns.json | 0 .../deployments/kube-system/local-path-provisioner.json | 0 .../data}/fixtures/kube_context/namespaces/cert-manager.json | 0 .../data}/fixtures/kube_context/namespaces/kube-system.json | 0 .../fixtures/kube_context/services/kube-system/kube-dns.json | 0 .../kube_context/services/kube-system/metrics-server.json | 0 15 files changed, 3 insertions(+), 3 deletions(-) rename {test_data => tests/data}/endless_wasm/.gitignore (100%) rename {test_data => tests/data}/endless_wasm/Makefile (100%) rename {test_data => tests/data}/endless_wasm/README.md (100%) rename {test_data => tests/data}/endless_wasm/wapc_endless_loop.wat (100%) rename {test_data => tests/data}/endless_wasm/wasm_endless_loop.wat (100%) rename {test_data => tests/data}/fixtures/kube_context/deployments/ingress/ingress-nginx.json (100%) rename {test_data => tests/data}/fixtures/kube_context/deployments/kube-system/coredns.json (100%) rename {test_data => tests/data}/fixtures/kube_context/deployments/kube-system/local-path-provisioner.json (100%) rename {test_data => tests/data}/fixtures/kube_context/namespaces/cert-manager.json (100%) rename {test_data => tests/data}/fixtures/kube_context/namespaces/kube-system.json (100%) rename {test_data => tests/data}/fixtures/kube_context/services/kube-system/kube-dns.json (100%) rename {test_data => tests/data}/fixtures/kube_context/services/kube-system/metrics-server.json (100%) diff --git a/src/policy_evaluator/policy_evaluator_builder.rs b/src/policy_evaluator/policy_evaluator_builder.rs index d19c9075..dc1a053c 100644 --- a/src/policy_evaluator/policy_evaluator_builder.rs +++ b/src/policy_evaluator/policy_evaluator_builder.rs @@ -241,7 +241,7 @@ mod tests { #[test] fn build_policy_evaluator_pre() { let engine = wasmtime::Engine::default(); - let wat = include_bytes!("../../test_data/endless_wasm/wapc_endless_loop.wat"); + let wat = include_bytes!("../../tests/data/endless_wasm/wapc_endless_loop.wat"); let module = wasmtime::Module::new(&engine, wat).expect("cannot compile WAT to wasm"); let policy_evaluator_builder = PolicyEvaluatorBuilder::new() diff --git a/src/runtimes/rego/context_aware.rs b/src/runtimes/rego/context_aware.rs index 622734d9..2d3d83d9 100644 --- a/src/runtimes/rego/context_aware.rs +++ b/src/runtimes/rego/context_aware.rs @@ -123,7 +123,7 @@ pub(crate) mod tests { namespace: Option<&str>, name: &str, ) -> Result { - let path = Path::new("test_data/fixtures/kube_context") + let path = Path::new("tests/data/fixtures/kube_context") .join(resource_type) .join(namespace.unwrap_or_default()) .join(format!("{name}.json")); diff --git a/src/runtimes/wapc/runtime.rs b/src/runtimes/wapc/runtime.rs index ec870049..6ba4d50d 100644 --- a/src/runtimes/wapc/runtime.rs +++ b/src/runtimes/wapc/runtime.rs @@ -190,7 +190,7 @@ mod tests { engine_conf.epoch_interruption(true); let engine = wasmtime::Engine::new(&engine_conf).expect("cannot create wasmtime engine"); - let wat = include_bytes!("../../../test_data/endless_wasm/wapc_endless_loop.wat"); + let wat = include_bytes!("../../../tests/data/endless_wasm/wapc_endless_loop.wat"); let module = wasmtime::Module::new(&engine, wat).expect("cannot compile WAT to wasm"); // Create the wapc engine, the code will be interrupted after 10 ticks diff --git a/test_data/endless_wasm/.gitignore b/tests/data/endless_wasm/.gitignore similarity index 100% rename from test_data/endless_wasm/.gitignore rename to tests/data/endless_wasm/.gitignore diff --git a/test_data/endless_wasm/Makefile b/tests/data/endless_wasm/Makefile similarity index 100% rename from test_data/endless_wasm/Makefile rename to tests/data/endless_wasm/Makefile diff --git a/test_data/endless_wasm/README.md b/tests/data/endless_wasm/README.md similarity index 100% rename from test_data/endless_wasm/README.md rename to tests/data/endless_wasm/README.md diff --git a/test_data/endless_wasm/wapc_endless_loop.wat b/tests/data/endless_wasm/wapc_endless_loop.wat similarity index 100% rename from test_data/endless_wasm/wapc_endless_loop.wat rename to tests/data/endless_wasm/wapc_endless_loop.wat diff --git a/test_data/endless_wasm/wasm_endless_loop.wat b/tests/data/endless_wasm/wasm_endless_loop.wat similarity index 100% rename from test_data/endless_wasm/wasm_endless_loop.wat rename to tests/data/endless_wasm/wasm_endless_loop.wat diff --git a/test_data/fixtures/kube_context/deployments/ingress/ingress-nginx.json b/tests/data/fixtures/kube_context/deployments/ingress/ingress-nginx.json similarity index 100% rename from test_data/fixtures/kube_context/deployments/ingress/ingress-nginx.json rename to tests/data/fixtures/kube_context/deployments/ingress/ingress-nginx.json diff --git a/test_data/fixtures/kube_context/deployments/kube-system/coredns.json b/tests/data/fixtures/kube_context/deployments/kube-system/coredns.json similarity index 100% rename from test_data/fixtures/kube_context/deployments/kube-system/coredns.json rename to tests/data/fixtures/kube_context/deployments/kube-system/coredns.json diff --git a/test_data/fixtures/kube_context/deployments/kube-system/local-path-provisioner.json b/tests/data/fixtures/kube_context/deployments/kube-system/local-path-provisioner.json similarity index 100% rename from test_data/fixtures/kube_context/deployments/kube-system/local-path-provisioner.json rename to tests/data/fixtures/kube_context/deployments/kube-system/local-path-provisioner.json diff --git a/test_data/fixtures/kube_context/namespaces/cert-manager.json b/tests/data/fixtures/kube_context/namespaces/cert-manager.json similarity index 100% rename from test_data/fixtures/kube_context/namespaces/cert-manager.json rename to tests/data/fixtures/kube_context/namespaces/cert-manager.json diff --git a/test_data/fixtures/kube_context/namespaces/kube-system.json b/tests/data/fixtures/kube_context/namespaces/kube-system.json similarity index 100% rename from test_data/fixtures/kube_context/namespaces/kube-system.json rename to tests/data/fixtures/kube_context/namespaces/kube-system.json diff --git a/test_data/fixtures/kube_context/services/kube-system/kube-dns.json b/tests/data/fixtures/kube_context/services/kube-system/kube-dns.json similarity index 100% rename from test_data/fixtures/kube_context/services/kube-system/kube-dns.json rename to tests/data/fixtures/kube_context/services/kube-system/kube-dns.json diff --git a/test_data/fixtures/kube_context/services/kube-system/metrics-server.json b/tests/data/fixtures/kube_context/services/kube-system/metrics-server.json similarity index 100% rename from test_data/fixtures/kube_context/services/kube-system/metrics-server.json rename to tests/data/fixtures/kube_context/services/kube-system/metrics-server.json