You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/06/15 08:12:45 UTC

[GitHub] [calcite] xy2953396112 commented on a change in pull request #2026: [CALCITE-4027] Add -Doverwrite option to DiffRepository

xy2953396112 commented on a change in pull request #2026:
URL: https://github.com/apache/calcite/pull/2026#discussion_r440002413



##########
File path: core/src/test/java/org/apache/calcite/test/DiffRepository.java
##########
@@ -762,6 +764,20 @@ public static DiffRepository lookup(Class<?> clazz,
       DiffRepository baseRepository,
       Filter filter) {
     final Key key = new Key(clazz, baseRepository, filter);
+    final String overwrite = System.getProperty("overwrite");
+    // Not need to add test cases manually when you add VM options.
+    // For example: -Doverwrite=true
+    if (overwrite != null && overwrite.equalsIgnoreCase("true")) {
+      try {
+        URL refFile = findFile(clazz, ".xml");
+        final String refFilePath = Sources.of(refFile).file().getAbsolutePath();
+        final String logFilePath = refFilePath.replace(".xml", "_actual.xml");
+        final File logFile = new File(logFilePath);
+        FileUtils.copyFile(logFile, new File(refFilePath.replace("out", "src")));

Review comment:
       ok




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org