Fail generateTests when testData directory is empty
When switching git branches, there might be some empty directories left This causes generateTests to pass locally with no changes and fail on CI
This commit is contained in:
committed by
Space Team
parent
2ee0d6a4c1
commit
2472999242
+7
@@ -114,6 +114,13 @@ class SimpleTestClassModel(
|
||||
if (file.isDirectory && excludeParentDirs && dirHasSubDirs(file)) {
|
||||
continue
|
||||
}
|
||||
if (file.isDirectory && !dirHasFilesInside(file)) {
|
||||
throw IllegalStateException(
|
||||
"testData directory $file is empty. " +
|
||||
"This might be due to git branch switching removed the contents but left directory intact. " +
|
||||
"Consider removing empty directory or revert removing of its' contents."
|
||||
)
|
||||
}
|
||||
result.addAll(
|
||||
methodModelLocator(
|
||||
rootFile, file, filenamePattern,
|
||||
|
||||
Reference in New Issue
Block a user