Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.35.0
Description
Discovered by accident on my Windows+IntelliJ environment while I was trying to add new tests on a *.iq file. My new tests did not seem to be executed. I even tried adding syntax errors on purpose into different iq files to force them to fail, but the tests were still successful. The reason seems to be that, at least on my environment (Windows), the test files do not execute any of their statements. This seems caused by the changes introduced in CALCITE-5786.
While debugging, I found this line in QuidemTest.java (that aims to create the inFile and outFile):
protected void checkRun(String path) throws Exception { ... // e.g. path = "sql/agg.iq" // inUrl = "file:/home/fred/calcite/core/build/resources/test/sql/agg.iq" // inFile = "/home/fred/calcite/core/build/resources/test/sql/agg.iq" // outDir = "/home/fred/calcite/core/build/quidem/test/sql" // outFile = "/home/fred/calcite/core/build/quidem/test/sql/agg.iq" inFile = Sources.of(requireNonNull(inUrl, "inUrl")).file(); outFile = replaceDir(inFile, "resources", "quidem"); ... }
But in my case it results on both files being the same, thus when the outFile is created, it actually erases all the tests that were contained inside the inFile, so the test runs nothing.
The reason for that is that the auxiliary method replaceDir:
private static File replaceDir(File file, String target, String replacement) { return new File( file.getAbsolutePath().replace(n2u('/' + target + '/'), n2u('/' + replacement + '/'))); }
is trying to replace "/resources/" with "/quidem/" from the inFile absolute path, but in my case this path does not contain the pattern to be replaced, since it contains backslashes: "C:\...\calcite\core\build\resources\test\sql\agg.iq"; so the replacement operation does nothing.
Attachments
Issue Links
- is caused by
-
CALCITE-5786 QuidemTest and DiffRepository have incremental build issues
- Closed
- links to