Skip to content

Commit aacab63

Browse files
Add a check in test-all to verify the TF versions in different location
The `run-valgrind` script fails silently if its Tensorflow version is not the proper one. The reason is because the `export LD_LIBRARY_PATH` line explicitly uses the TF version in the exported path. If it is wrong (for example if the version defined in variable `tensorflow_version` near the top of the file) then the first call to valgrind will fail. All the output of the call to valgrind is sent to a log file, so the failure is not reported. And since the first line of the script let it abort on error (`set -e`), the script stop on the first call to valgrind. This commit adds a check in the `test-all` script to make sure the version values match where they appear. This should let the CI fail if the TF versioning is wrong in the crates.
1 parent 15a40b0 commit aacab63

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test-all

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
set -e
44

5+
# Make sure the Tensorflow version in the -sys build script matches the one in
6+
# the run-valgrind script.
7+
version_build_script=`grep "const VERSION" tensorflow-sys/build.rs | sed 's|.*"\([0-9\.]*\)";|\1|g'`
8+
version_run_valgrind=`grep "tensorflow_version=" run-valgrind | sed "s|.*=\(.*\)|\1|g"`
9+
if [[ "${version_build_script}" != "${version_run_valgrind}" ]]; then
10+
echo "ERROR: Tensorflow version specified in build script does not match the one in the"
11+
echo " valgrind run script."
12+
echo " tensorflow-sys/build.rs: ${version_build_script}"
13+
echo " run-valgrind: ${version_run_valgrind}"
14+
exit 1
15+
fi
16+
517
cargo test -vv -j 2 --features tensorflow_unstable
618
cargo run --example regression
719
cargo run --features tensorflow_unstable --example expressions

0 commit comments

Comments
 (0)