Bug #87936 main.file_contents failing with INFO_SRC not containing git revision id
Submitted: 2 Oct 2017 7:00 Modified: 9 Apr 2018 11:15
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:8.0.3 OS:Any
Assigned to: CPU Architecture:Any

[2 Oct 2017 7:00] Laurynas Biveinis
Description:
The source tree for build has been created by
$ git archive mysql-8.0.3 | tar -x -C ../mysql-8.0.3
in the git repo directory.

Then, in an out-of-source build directory,
$ cmake ../mysql-8.0.3 -DBUILD_CONFIG=mysql_release -DWITH_DEBUG=ON ...
...
$ ./mtr --debug-server file_contents
...
main.file_contents                       [ fail ]
        Test ended at 2017-10-02 09:51:32

CURRENT_TEST: main.file_contents
--- /home/laurynas/mysql-8.0.3/mysql-test/r/file_contents.result	2017-09-19 13:22:09.000000000 +0300
+++ /home/laurynas/obj-mysql-8.0.3-san-debug/mysql-test/var/log/file_contents.reject	2017-10-02 09:51:32.428582000 +0300
@@ -1,6 +1,6 @@
 
 Checking 'INFO_SRC' and 'INFO_BIN'
-INFO_SRC: Found MySQL version number / Found GIT revision id
+INFO_SRC: Found MySQL version number / No line 'revision-id: .....'
 INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line
 
 End of tests

mysqltest: Result length mismatch

How to repeat:
See above
[2 Oct 2017 9:55] MySQL Verification Team
Hello Laurynas,

Thank you for the report and feedback!

Regards,
Umesh
[3 Oct 2017 12:43] Bjørn Munch
When cmake is run on source which is neither a source package (where INFO_SRC already exists) nor a git repo, the commit id is not known and it's impossible to include it in the INFO_SRC file.

This test *should* fail in this case. If it was changed to not fail, then it would not detect if INFO_SRC did not include the commit id for the standard case where it should be there.

The test should not be fixed, but maybe the build could include some dummy commit ID in these cases. But even that is risky, as it would go undetected if this is done when commit id *is* known.
[5 Apr 2018 13:05] Bjørn Munch
Following up on this. There is unfortunately no safe way to modify this test so that it works (or gets skipped) for your case without also making the test less robust for the normal case. We risk not detecting an actual problem with INFO_SRC. Modifying the cmake code that generates INFO_SRC would also not be safe.

This will therefore be closed as Not a Bug. I'm afraid you will have to live with this test failing when building from a *copy* of the pure github archive, as there simply is not enough information to generate a complete INFO_SRC.

Apart from just ignoring this failure (which of course may not be acceptable, especially if your test run is scripted), we can suggest some alternative workarounds:

1. Before running tests, "fix" INFO_SRC by adding a commit ID, either a dummy or copied from github or the official source tarball.

2. Add the test to mysql-test/t/disabled.def

Both 1. and 2. require a small source change. If this is undesired, you can:

3. Add the option --skip-test=file_contents to your MTR command line.
[9 Apr 2018 11:15] Laurynas Biveinis
Thanks Bjørn, this is reasonable, we will implement a workaround