@@ -50,6 +50,11 @@ def setUp(self):
5050 ".github/workflows/README.md" : "CI documentation\n " ,
5151 ".github/workflows/spark_sql_test_reusable.yml" : "jobs: {}\n " ,
5252 ".github/workflows/check_pr_title.yml" : "jobs: {}\n " ,
53+ "dev/ci/compute-changes.py" : "# shared native input rules\n " ,
54+ "contrib/delta/native/Cargo.toml" : '[package]\n name = "delta"\n ' ,
55+ "contrib/delta/native/src/lib.rs" : "fn delta() {}\n " ,
56+ "contrib/delta/native/Cargo.lock" : "version = 4\n " ,
57+ "contrib/a/b/native/Cargo.toml" : '[package]\n name = "nested"\n ' ,
5358 "native/core/benches/perf.rs" : "fn benchmark() {}\n " }
5459 for name , content in self .inputs .items ():
5560 self .write (name , content )
@@ -78,6 +83,7 @@ def test_source_and_dependency_changes_invalidate_the_right_keys(self):
7883 """Native/protobuf edits retain the dependency prefix; dependency edits replace it."""
7984 before = self .keys ()
8085 for name in ("native/lib.rs" , "native/proto/expr.proto" , "native/Cargo.toml" , "native/Cargo.lock" ,
86+ "contrib/delta/native/Cargo.toml" , "dev/ci/compute-changes.py" ,
8187 ".github/workflows/spark_sql_test_reusable.yml" ):
8288 with self .subTest (name = name ):
8389 self .write (name , self .inputs [name ] + "changed\n " )
@@ -100,6 +106,9 @@ def test_generated_files_and_unrelated_jvm_edits_preserve_keys(self):
100106 self .write ("README.md" , "updated docs" )
101107 self .write (".github/workflows/README.md" , "updated CI docs" )
102108 self .write (".github/workflows/check_pr_title.yml" , "jobs: {changed: {}}" )
109+ self .write ("contrib/delta/native/src/lib.rs" , "fn changed_delta() {}" )
110+ self .write ("contrib/delta/native/Cargo.lock" , "version = 3\n " )
111+ self .write ("contrib/a/b/native/Cargo.toml" , '[package]\n name = "changed_nested"\n ' )
103112 self .write ("native/core/benches/perf.rs" , "fn changed_benchmark() {}" )
104113 self .assertEqual (before , self .keys ())
105114 self .assertNotEqual (debug ["source-key" ], self .keys ("debug" )["source-key" ])
@@ -109,9 +118,12 @@ def test_every_binary_key_input_has_a_main_cache_warmer(self):
109118 project = Path (__file__ ).resolve ().parents [2 ]
110119 route = runpy .run_path (str (project / "dev/ci/compute-changes.py" ))["compute" ]
111120 _ , sources = CACHE .source_inputs (project )
112- for name in [* sources , ".cargo/config.toml" , "rust-toolchain" , "contrib/new/native/src/lib.rs " ]:
121+ for name in [* sources , ".cargo/config.toml" , "rust-toolchain" , "contrib/new/native/Cargo.toml " ]:
113122 self .assertTrue (route ([name ], {"name" : "push" })["build_linux" ], name )
114- self .assertFalse (route (["contrib/new/native/src/lib.rs" ], {"name" : "pull_request" })["build_linux" ])
123+ for name in ("contrib/delta/native/src/lib.rs" , "contrib/delta/native/Cargo.lock" ,
124+ "contrib/a/b/native/Cargo.toml" , "contrib/a/b/native/x.rs" ):
125+ self .assertFalse (route ([name ], {"name" : "push" })["build_linux" ], name )
126+ self .assertFalse (route (["contrib/new/native/Cargo.toml" ], {"name" : "pull_request" })["build_linux" ])
115127
116128 def test_tools_jdk_flags_and_tracked_build_configuration_invalidate (self ):
117129 """Observed tool/package versions, Java metadata, flags and tracked configs enter keys."""
@@ -122,6 +134,7 @@ def test_tools_jdk_flags_and_tracked_build_configuration_invalidate(self):
122134 self .versions [tool ] += "changed\n "
123135 self .assertNotEqual (before ["source-key" ], self .keys ()["source-key" ])
124136 self .assertNotEqual (before ["binary-key" ], self .keys ()["binary-key" ])
137+ self .assertNotEqual (before ["restore-prefix" ], self .keys ()["restore-prefix" ])
125138 self .versions [tool ] = old
126139 self .write ("jdk/release" , 'JAVA_VERSION="17.0.2"\n ' )
127140 self .assertNotEqual (before ["binary-key" ], self .keys ()["binary-key" ])
0 commit comments