Tests: Improve rest suite names and generated test names for docs tests

Rest test suites are currently only the directory above the yaml test
file. That is confusing when there are more than one directory level
which contain yaml tests, as there are in generated docs tests. This
change makes rest tests use the full relative path to the rest test root
as the suite name, and also makes the test names for docs tests a little
clearer (that they are testing an example from a specific line number,
instead of just the line number as an opaque test name).
This commit is contained in:
Ryan Ernst 2016-08-30 13:55:44 -07:00
parent 335c020cd7
commit e19f2b6348
2 changed files with 2 additions and 2 deletions

View File

@ -117,7 +117,7 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
if (false == test.continued) { if (false == test.continued) {
current.println('---') current.println('---')
current.println("\"$test.start\":") current.println("\"line_$test.start\":")
} }
if (test.skipTest) { if (test.skipTest) {
current.println(" - skip:") current.println(" - skip:")

View File

@ -155,7 +155,7 @@ public final class FileUtils {
@Override @Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (file.toString().endsWith(fileSuffix)) { if (file.toString().endsWith(fileSuffix)) {
String groupName = file.toAbsolutePath().getParent().getFileName().toString(); String groupName = dir.relativize(file.getParent()).toString();
Set<Path> filesSet = files.get(groupName); Set<Path> filesSet = files.get(groupName);
if (filesSet == null) { if (filesSet == null) {
filesSet = new HashSet<>(); filesSet = new HashSet<>();