You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/02/10 21:50:10 UTC

[GitHub] [solr] madrob commented on a change in pull request #619: SOLR-11749 Several test changes

madrob commented on a change in pull request #619:
URL: https://github.com/apache/solr/pull/619#discussion_r804135339



##########
File path: gradle/node.gradle
##########
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+apply plugin: "com.github.node-gradle.node"
+
+ext {
+    rootNodeDir = "$rootDir/.gradle/node"
+}
+
+node {

Review comment:
       realistically, we need to figure out how to only apply this to projects that have an NpmTask, but I'm not sure if that causes a chicken and egg problem? For now, I have the two projects that care source this file directly.

##########
File path: solr/packaging/build.gradle
##########
@@ -160,3 +165,55 @@ distTar {
 distZip.enabled = false
 
 assemble.dependsOn installDist
+
+
+// We use Node to install BATS
+node {
+  // The Node.js project directory location
+  // This is where the package.json file and node_modules directory are located
+  // By default it is at the root of the current project
+  nodeProjectDir = project.ext.nodeProjectDir
+}
+
+task downloadBats(type: NpmTask) {
+  group = 'Build Dependency Download'
+  args = ["install", "bats",
+                     "ztombol/bats-support",
+                     "ztombol/bats-assert",
+  ]
+
+  inputs.files("${project.ext.nodeProjectDir}/package.json")
+  outputs.dir("${project.ext.nodeProjectDir}/node_modules/bats")
+  outputs.dir("${project.ext.nodeProjectDir}/node_modules/bats-support")
+  outputs.dir("${project.ext.nodeProjectDir}/node_modules/bats-assert")
+}
+
+task bats(type: Exec) {
+  dependsOn installDist
+  dependsOn downloadBats
+
+  def testOutput = "$buildDir/bats-output"
+  def solrHome = "$testOutput/solr-home-" + Instant.now().toEpochMilli()

Review comment:
       I don't know if this is a good or bad practice.




-- 
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: issues-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org