stevedlawrence commented on code in PR #10:
URL: https://github.com/apache/daffodil-sbt/pull/10#discussion_r1463662042


##########
src/sbt-test/sbt-daffodil/common-settings-01/test.script:
##########
@@ -0,0 +1,20 @@
+## 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.
+## 
+
+> compile
+> test

Review Comment:
   Running `sbt scripted` is the way to test SBT plugins (the GitHub actions do 
this too).
   
   From what I gather, that runs `sbt publishLocal` to publish the plugin to 
`~/.ivy/local/`, and then for each directory in `src/sbt-test/`, it copies it 
somewhere to /tmp, cd's to that directory, then runs the commands and checks in 
this file. Here's the syntax for these test.scripts:
   
   
https://www.scala-sbt.org/1.x/docs/Testing-sbt-plugins.html#step+4%3A+write+a+script
   
   You can run any sbt command, but unfortunately what you can check for is 
pretty limited to about a dozen things. For example, there's no way to check 
that actual tests were run by the `test` command, just that the `test` command 
succeeded. So if I messed up this scripted directory in such a way that it 
didn't find any tests, then it would still pass, even though no tests were run. 
So to verify it, I manually ran `sbt publishLocal`, then cd'ed to the directory 
and ran `sbt -Dplugin.version=1.0.0-SNAPSHOT` and then checked that the 
commands worked and tests actually ran.



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

Reply via email to