[JS Test] Support RECOMPILE directive in js box tests in new infrastructure
This commit is contained in:
committed by
Ivan Kylchik
parent
13d3b7c0b8
commit
af0e40a0d2
@@ -66,6 +66,13 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
|
||||
if (it.shouldSkipTest()) return
|
||||
}
|
||||
|
||||
runTestPipeline(moduleStructure, services)
|
||||
}
|
||||
|
||||
fun runTestPipeline(
|
||||
moduleStructure: TestModuleStructure,
|
||||
services: TestServices
|
||||
) {
|
||||
val globalMetadataInfoHandler = testConfiguration.testServices.globalMetadataInfoHandler
|
||||
globalMetadataInfoHandler.parseExistingMetadataInfosFromAllSources()
|
||||
|
||||
@@ -103,6 +110,10 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
|
||||
}
|
||||
}
|
||||
|
||||
reportFailures(services)
|
||||
}
|
||||
|
||||
fun reportFailures(services: TestServices) {
|
||||
val filteredFailedAssertions = filterFailedExceptions(allFailedExceptions)
|
||||
filteredFailedAssertions.firstIsInstanceOrNull<WrappedException.FromFacade>()?.let {
|
||||
throw it
|
||||
@@ -113,7 +124,7 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
|
||||
/*
|
||||
* Returns false if next modules should be not processed
|
||||
*/
|
||||
private fun processModule(
|
||||
fun processModule(
|
||||
module: TestModule,
|
||||
dependencyProvider: DependencyProviderImpl
|
||||
): Boolean {
|
||||
|
||||
+14
-1
@@ -12,13 +12,16 @@ abstract class DependencyProvider : TestService {
|
||||
abstract fun getTestModule(name: String): TestModule
|
||||
|
||||
abstract fun <A : ResultingArtifact<A>> getArtifact(module: TestModule, kind: TestArtifactKind<A>): A
|
||||
|
||||
abstract fun unregisterAllArtifacts(module: TestModule)
|
||||
abstract fun copy(): DependencyProvider
|
||||
}
|
||||
|
||||
val TestServices.dependencyProvider: DependencyProvider by TestServices.testServiceAccessor()
|
||||
|
||||
class DependencyProviderImpl(
|
||||
private val testServices: TestServices,
|
||||
testModules: List<TestModule>
|
||||
private val testModules: List<TestModule>
|
||||
) : DependencyProvider() {
|
||||
private val assertions: Assertions
|
||||
get() = testServices.assertions
|
||||
@@ -44,6 +47,16 @@ class DependencyProviderImpl(
|
||||
if (previousValue != null) error("Artifact with kind $kind already registered for module ${module.name}")
|
||||
}
|
||||
|
||||
override fun unregisterAllArtifacts(module: TestModule) {
|
||||
artifactsByModule.remove(module)
|
||||
}
|
||||
|
||||
override fun copy(): DependencyProvider {
|
||||
return DependencyProviderImpl(testServices, testModules).also {
|
||||
artifactsByModule.putAll(artifactsByModule.mapValues { (_, map) -> map.toMutableMap() })
|
||||
}
|
||||
}
|
||||
|
||||
private fun <K, V, R> MutableMap<K, MutableMap<V, R>>.getMap(key: K): MutableMap<V, R> {
|
||||
return getOrPut(key) { mutableMapOf() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user