PHILO-HE commented on code in PR #8071: URL: https://github.com/apache/incubator-gluten/pull/8071#discussion_r1861472367
########## gluten-core/src/test/scala/org/apache/gluten/MarkdownBuilder.scala: ########## @@ -0,0 +1,127 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.gluten + +import com.vladsch.flexmark.formatter.Formatter +import com.vladsch.flexmark.parser.{Parser, ParserEmulationProfile, PegdownExtensions} +import com.vladsch.flexmark.profile.pegdown.PegdownOptionsAdapter +import com.vladsch.flexmark.util.data.{MutableDataHolder, MutableDataSet} +import com.vladsch.flexmark.util.sequence.SequenceUtils.EOL + +import scala.collection.mutable.ListBuffer + +class MarkdownBuilder { + private val buffer = new ListBuffer[String] + + /** + * append a single line with replacing EOL to empty string Review Comment: Nit: comment style, capitalize the initial letter and end up with period mark. Please also check other comments. ########## gluten-core/src/test/scala/org/apache/gluten/config/AllGlutenConfiguration.scala: ########## @@ -0,0 +1,260 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.gluten.config + +import org.apache.gluten.GlutenConfig +import org.apache.gluten.MarkdownBuilder + +import org.apache.spark.sql.internal.SQLConfBridge + +import org.scalactic.Prettifier +import org.scalactic.source.Position +import org.scalatest.Assertions._ +import org.scalatest.funsuite.AnyFunSuite + +import java.nio.charset.StandardCharsets +import java.nio.file.{Files, Path, Paths, StandardOpenOption} + +import scala.collection.JavaConverters._ +import scala.collection.Traversable +import scala.io.Source + +/** + * End-to-end test cases for configuration doc file The golden result file is + * "docs/Configuration.md". + * + * To run the entire test suite: + * {{{ + * GLUTEN_UPDATE=0 dev/gen/gen_all_config_docs.sh + * }}} + * + * To re-generate golden files for entire suite, run: + * {{{ + * dev/gen/gen_all_config_docs.sh + * }}} + */ +class AllGlutenConfiguration extends AnyFunSuite { + private val glutenHome: String = + AllGlutenConfiguration.getCodeSourceLocation(this.getClass).split("gluten-core")(0) + private val markdown = Paths.get(glutenHome, "docs", "Configuration.md").toAbsolutePath + + private val veloxBackendIdentify = ".velox." + private val chBackendIdentify = ".ch." + + private def loadConfigs = Array(GlutenConfig) + + test("Check all gluten configs") { + loadConfigs + val builder = MarkdownBuilder(getClass.getName) + + builder ++= + s""" + |--- + |layout: page + |title: Configuration + |nav_order: 3 + |--- + | + |""" + + builder ++= + s""" + |# Spark Configurations for Gluten Plugin + | + |""" += + """There are many configurations could impact the Gluten Plugin performance + | and can be fine-tuned in Spark.""" += + """You can add these configurations into spark-defaults.conf to enable or + | disable the setting.""" + + builder ++= + s""" + |## Gluten configurations + | + | Key | Default | Meaning Review Comment: Suggestion: Meaning -> Description -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
