diff --git a/.github/workflows/aws_tfhe_backward_compat_tests.yml b/.github/workflows/aws_tfhe_backward_compat_tests.yml index c7f0c100f..437d429ac 100644 --- a/.github/workflows/aws_tfhe_backward_compat_tests.yml +++ b/.github/workflows/aws_tfhe_backward_compat_tests.yml @@ -76,7 +76,7 @@ jobs: with: persist-credentials: 'false' repository: zama-ai/tfhe-backward-compat-data - path: tfhe/tfhe-backward-compat-data + path: tests/tfhe-backward-compat-data lfs: 'true' ref: ${{ steps.backward_compat_branch.outputs.branch }} diff --git a/.gitignore b/.gitignore index 9babe2bc8..45aefba0e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,4 @@ node_modules/ package-lock.json # Dir used for backward compatibility test data -tfhe/tfhe-backward-compat-data/ +tests/tfhe-backward-compat-data/ diff --git a/Cargo.toml b/Cargo.toml index dd2856286..909ec56aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,10 +11,11 @@ members = [ "backends/tfhe-cuda-backend", "utils/tfhe-versionable", "utils/tfhe-versionable-derive", + "tests" ] exclude = [ - "tfhe/backward_compatibility_tests", + "tests/backward_compatibility_tests", "utils/cargo-tfhe-lints-inner", "utils/cargo-tfhe-lints" ] diff --git a/Makefile b/Makefile index 7d6a3abb0..8a1b525a6 100644 --- a/Makefile +++ b/Makefile @@ -892,11 +892,11 @@ test_versionable: install_rs_build_toolchain .PHONY: test_backward_compatibility_ci test_backward_compatibility_ci: install_rs_build_toolchain TFHE_BACKWARD_COMPAT_DATA_DIR="$(BACKWARD_COMPAT_DATA_DIR)" RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --profile $(CARGO_PROFILE) \ - --config "patch.'$(BACKWARD_COMPAT_DATA_URL)'.$(BACKWARD_COMPAT_DATA_PROJECT).path=\"tfhe/$(BACKWARD_COMPAT_DATA_DIR)\"" \ - --features=shortint,integer,zk-pok -p $(TFHE_SPEC) test_backward_compatibility -- --nocapture + --config "patch.'$(BACKWARD_COMPAT_DATA_URL)'.$(BACKWARD_COMPAT_DATA_PROJECT).path=\"tests/$(BACKWARD_COMPAT_DATA_DIR)\"" \ + --features=shortint,integer,zk-pok -p tests test_backward_compatibility -- --nocapture .PHONY: test_backward_compatibility # Same as test_backward_compatibility_ci but tries to clone the data repo first if needed -test_backward_compatibility: tfhe/$(BACKWARD_COMPAT_DATA_DIR) test_backward_compatibility_ci +test_backward_compatibility: tests/$(BACKWARD_COMPAT_DATA_DIR) test_backward_compatibility_ci .PHONY: backward_compat_branch # Prints the required backward compatibility branch backward_compat_branch: @@ -1275,9 +1275,9 @@ write_params_to_file: install_rs_check_toolchain .PHONY: clone_backward_compat_data # Clone the data repo needed for backward compatibility tests clone_backward_compat_data: - ./scripts/clone_backward_compat_data.sh $(BACKWARD_COMPAT_DATA_URL) $(BACKWARD_COMPAT_DATA_BRANCH) tfhe/$(BACKWARD_COMPAT_DATA_DIR) + ./scripts/clone_backward_compat_data.sh $(BACKWARD_COMPAT_DATA_URL) $(BACKWARD_COMPAT_DATA_BRANCH) tests/$(BACKWARD_COMPAT_DATA_DIR) -tfhe/$(BACKWARD_COMPAT_DATA_DIR): clone_backward_compat_data +tests/$(BACKWARD_COMPAT_DATA_DIR): clone_backward_compat_data # # Real use case examples diff --git a/tasks/src/check_tfhe_docs_are_tested.rs b/tasks/src/check_tfhe_docs_are_tested.rs index 142add6cb..6b2f998e1 100644 --- a/tasks/src/check_tfhe_docs_are_tested.rs +++ b/tasks/src/check_tfhe_docs_are_tested.rs @@ -7,7 +7,7 @@ const DIR_TO_IGNORE: [&str; 3] = [ ".git", "target", // If the data repo has been cloned, we ignore its README - "tfhe/tfhe-backward-compat-data", + "tests/tfhe-backward-compat-data", ]; const FILES_TO_IGNORE: [&str; 5] = [ diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 000000000..3e48a73eb --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "tests" +version = "0.1.0" +edition = "2021" +publish = false + +[dev-dependencies] +tfhe = { path = "../tfhe" } +tfhe-versionable = { path = "../utils/tfhe-versionable" } +tfhe-backward-compat-data = { git = "https://github.com/zama-ai/tfhe-backward-compat-data.git", branch = "v0.4", default-features = false, features = [ + "load", +] } +ron = "0.8" + + +[[test]] +name = "backward_compatibility_tests" +path = "backward_compatibility_tests.rs" + +[features] +shortint = ["tfhe/shortint"] +integer = ["shortint", "tfhe/integer"] +zk-pok = ["tfhe/zk-pok"] diff --git a/tfhe/tests/backward_compatibility/high_level_api.rs b/tests/backward_compatibility/high_level_api.rs similarity index 100% rename from tfhe/tests/backward_compatibility/high_level_api.rs rename to tests/backward_compatibility/high_level_api.rs diff --git a/tfhe/tests/backward_compatibility/mod.rs b/tests/backward_compatibility/mod.rs similarity index 100% rename from tfhe/tests/backward_compatibility/mod.rs rename to tests/backward_compatibility/mod.rs diff --git a/tfhe/tests/backward_compatibility/shortint.rs b/tests/backward_compatibility/shortint.rs similarity index 100% rename from tfhe/tests/backward_compatibility/shortint.rs rename to tests/backward_compatibility/shortint.rs diff --git a/tfhe/tests/backward_compatibility_tests.rs b/tests/backward_compatibility_tests.rs similarity index 100% rename from tfhe/tests/backward_compatibility_tests.rs rename to tests/backward_compatibility_tests.rs diff --git a/tfhe/Cargo.toml b/tfhe/Cargo.toml index a5038a6a1..748454012 100644 --- a/tfhe/Cargo.toml +++ b/tfhe/Cargo.toml @@ -42,11 +42,6 @@ env_logger = "0.10.0" log = "0.4.19" hex = "0.4.3" # End regex-engine deps -# Used for backward compatibility test metadata -ron = "0.8" -tfhe-backward-compat-data = { git = "https://github.com/zama-ai/tfhe-backward-compat-data.git", branch = "v0.4", default-features = false, features = [ - "load", -] } strum = { version = "0.26", features = ["derive"] } [build-dependencies]