test: ignore aot test files in ArchUnit

This commit is contained in:
Gauthier Roebroeck 2023-07-14 15:58:59 +08:00
parent f79113f264
commit 5a74244b58
5 changed files with 14 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_USE_JAV
import com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_USE_JODATIME
import org.gotson.komga.Application
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class])
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class, DoNotIncludeAotTests::class])
class CodingRulesTest {
@ArchTest

View File

@ -0,0 +1,10 @@
package org.gotson.komga.architecture
import com.tngtech.archunit.core.importer.ImportOption
import com.tngtech.archunit.core.importer.Location
class DoNotIncludeAotTests : ImportOption {
override fun includes(location: Location): Boolean {
return !location.contains("/aotTest")
}
}

View File

@ -8,7 +8,7 @@ import com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes
import com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses
import org.gotson.komga.Application
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class])
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class, DoNotIncludeAotTests::class])
class DomainDrivenDesignRulesTest {
@ArchTest

View File

@ -10,7 +10,7 @@ import org.gotson.komga.Application
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.RestController
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class])
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class, DoNotIncludeAotTests::class])
class NamingConventionTest {
@ArchTest

View File

@ -7,7 +7,7 @@ import com.tngtech.archunit.lang.ArchRule
import com.tngtech.archunit.library.dependencies.SlicesRuleDefinition.slices
import org.gotson.komga.Application
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class])
@AnalyzeClasses(packagesOf = [Application::class], importOptions = [ImportOption.DoNotIncludeTests::class, DoNotIncludeAotTests::class])
class SlicesIsolationRulesTest {
@ArchTest
val interfaces_should_only_use_their_own_slice: ArchRule =