You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "bowenliang123 (via GitHub)" <gi...@apache.org> on 2023/01/30 09:12:29 UTC

[GitHub] [kyuubi] bowenliang123 opened a new pull request, #4212: Show line number and assertion when verifying generated markdown files

bowenliang123 opened a new pull request, #4212:
URL: https://github.com/apache/kyuubi/pull/4212

   …own files
   
   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   - Show line number and assertion when verifying generated markdown files, e.g. `settings.md` from `AllKyuubiConfiguration`, in order to see the place and differences.
   
   <img width="1106" alt="image" src="https://user-images.githubusercontent.com/1935105/215434884-e4aed04d-a2c1-4707-9c1c-40707bd515c7.png">
   
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#discussion_r1090380927


##########
kyuubi-common/src/test/scala/org/apache/kyuubi/TestUtils.scala:
##########
@@ -92,11 +92,13 @@ object TestUtils {
     } else {
       val linesInFile = Files.readAllLines(markdown, StandardCharsets.UTF_8)
       val formatted = formatMarkdown(newOutput)
-      val hint = s"$markdown out of date, please update doc with " +
-        s"KYUUBI_UPDATE=1 build/mvn clean install -Pflink-provided,spark-provided,hive-provided " +
-        s"-DwildcardSuites=$agent"
-      assert(linesInFile.size() === formatted.size, hint)
-      linesInFile.asScala.zip(formatted).foreach { case (out, in) => assert(out === in, hint) }
+      linesInFile.asScala.zipWithIndex.zip(formatted).foreach { case ((str1, index), str2) =>
+        withClue(s"$markdown out of date, as line ${index + 1} is not expected." +
+          s" Please update doc with KYUUBI_UPDATE=1 build/mvn clean install" +
+          s" -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=$agent") {

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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#discussion_r1090365445


##########
kyuubi-common/src/test/scala/org/apache/kyuubi/TestUtils.scala:
##########
@@ -92,11 +92,13 @@ object TestUtils {
     } else {
       val linesInFile = Files.readAllLines(markdown, StandardCharsets.UTF_8)
       val formatted = formatMarkdown(newOutput)
-      val hint = s"$markdown out of date, please update doc with " +
-        s"KYUUBI_UPDATE=1 build/mvn clean install -Pflink-provided,spark-provided,hive-provided " +
-        s"-DwildcardSuites=$agent"
-      assert(linesInFile.size() === formatted.size, hint)
-      linesInFile.asScala.zip(formatted).foreach { case (out, in) => assert(out === in, hint) }
+      linesInFile.asScala.zipWithIndex.zip(formatted).foreach { case ((str1, index), str2) =>
+        withClue(s"$markdown out of date, as line ${index + 1} is not expected." +
+          s" Please update doc with KYUUBI_UPDATE=1 build/mvn clean install" +
+          s" -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=$agent") {

Review Comment:
   The following command should be sufficient and faster
   ```
   KYUUBI_UPDATE=1 build/mvn clean test -Pflink-provided,spark-provided,hive-provided  -pl kyuubi-server -am -DwildcardSuites=org.apache.kyuubi.config.AllKyuubiConfiguration
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#discussion_r1090369258


##########
kyuubi-common/src/test/scala/org/apache/kyuubi/TestUtils.scala:
##########
@@ -92,11 +92,13 @@ object TestUtils {
     } else {
       val linesInFile = Files.readAllLines(markdown, StandardCharsets.UTF_8)
       val formatted = formatMarkdown(newOutput)
-      val hint = s"$markdown out of date, please update doc with " +
-        s"KYUUBI_UPDATE=1 build/mvn clean install -Pflink-provided,spark-provided,hive-provided " +
-        s"-DwildcardSuites=$agent"
-      assert(linesInFile.size() === formatted.size, hint)
-      linesInFile.asScala.zip(formatted).foreach { case (out, in) => assert(out === in, hint) }
+      linesInFile.asScala.zipWithIndex.zip(formatted).foreach { case ((str1, index), str2) =>
+        withClue(s"$markdown out of date, as line ${index + 1} is not expected." +
+          s" Please update doc with KYUUBI_UPDATE=1 build/mvn clean install" +
+          s" -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=$agent") {

Review Comment:
   Addressed.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#discussion_r1090369258


##########
kyuubi-common/src/test/scala/org/apache/kyuubi/TestUtils.scala:
##########
@@ -92,11 +92,13 @@ object TestUtils {
     } else {
       val linesInFile = Files.readAllLines(markdown, StandardCharsets.UTF_8)
       val formatted = formatMarkdown(newOutput)
-      val hint = s"$markdown out of date, please update doc with " +
-        s"KYUUBI_UPDATE=1 build/mvn clean install -Pflink-provided,spark-provided,hive-provided " +
-        s"-DwildcardSuites=$agent"
-      assert(linesInFile.size() === formatted.size, hint)
-      linesInFile.asScala.zip(formatted).foreach { case (out, in) => assert(out === in, hint) }
+      linesInFile.asScala.zipWithIndex.zip(formatted).foreach { case ((str1, index), str2) =>
+        withClue(s"$markdown out of date, as line ${index + 1} is not expected." +
+          s" Please update doc with KYUUBI_UPDATE=1 build/mvn clean install" +
+          s" -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=$agent") {

Review Comment:
   Addressed, and updated the screenshot.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] bowenliang123 commented on pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#issuecomment-1409983217

   Thanks, merged to master.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#discussion_r1090401676


##########
docs/develop_tools/developer.md:
##########
@@ -56,5 +56,5 @@ You can run `dev/reformat` to format all Java and Scala code.
 
 Kyuubi uses settings.md to explain available configurations.
 
-You can run `KYUUBI_UPDATE=1 build/mvn clean install -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=org.apache.kyuubi.config.AllKyuubiConfiguration`
+You can run `KYUUBI_UPDATE=1 build/mvn clean test -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=org.apache.kyuubi.config.AllKyuubiConfiguration`

Review Comment:
   it takes more time w/o `-pl kyuubi-server -am`.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] bowenliang123 closed pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 closed pull request #4212: Show line number and assertion when verifying generated markdown files in lines
URL: https://github.com/apache/kyuubi/pull/4212


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#discussion_r1090371332


##########
kyuubi-common/src/test/scala/org/apache/kyuubi/TestUtils.scala:
##########
@@ -92,11 +92,13 @@ object TestUtils {
     } else {
       val linesInFile = Files.readAllLines(markdown, StandardCharsets.UTF_8)
       val formatted = formatMarkdown(newOutput)
-      val hint = s"$markdown out of date, please update doc with " +
-        s"KYUUBI_UPDATE=1 build/mvn clean install -Pflink-provided,spark-provided,hive-provided " +
-        s"-DwildcardSuites=$agent"
-      assert(linesInFile.size() === formatted.size, hint)
-      linesInFile.asScala.zip(formatted).foreach { case (out, in) => assert(out === in, hint) }
+      linesInFile.asScala.zipWithIndex.zip(formatted).foreach { case ((str1, index), str2) =>
+        withClue(s"$markdown out of date, as line ${index + 1} is not expected." +
+          s" Please update doc with KYUUBI_UPDATE=1 build/mvn clean install" +
+          s" -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=$agent") {

Review Comment:
   Please search "AllKyuubiConfiguration" globally and make sure all places are updated.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4212: Show line number and assertion when verifying generated markdown files in lines

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #4212:
URL: https://github.com/apache/kyuubi/pull/4212#discussion_r1090365445


##########
kyuubi-common/src/test/scala/org/apache/kyuubi/TestUtils.scala:
##########
@@ -92,11 +92,13 @@ object TestUtils {
     } else {
       val linesInFile = Files.readAllLines(markdown, StandardCharsets.UTF_8)
       val formatted = formatMarkdown(newOutput)
-      val hint = s"$markdown out of date, please update doc with " +
-        s"KYUUBI_UPDATE=1 build/mvn clean install -Pflink-provided,spark-provided,hive-provided " +
-        s"-DwildcardSuites=$agent"
-      assert(linesInFile.size() === formatted.size, hint)
-      linesInFile.asScala.zip(formatted).foreach { case (out, in) => assert(out === in, hint) }
+      linesInFile.asScala.zipWithIndex.zip(formatted).foreach { case ((str1, index), str2) =>
+        withClue(s"$markdown out of date, as line ${index + 1} is not expected." +
+          s" Please update doc with KYUUBI_UPDATE=1 build/mvn clean install" +
+          s" -Pflink-provided,spark-provided,hive-provided -DwildcardSuites=$agent") {

Review Comment:
   The following command should be sufficient and faster
   ```
   KYUUBI_UPDATE=1 build/mvn clean test -Pflink-provided,spark-provided,hive-provided -pl kyuubi-server -am -DwildcardSuites=org.apache.kyuubi.config.AllKyuubiConfiguration
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org