mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
testFramework [projectStructure]: Fix multiverse project path fixture
The MultiverseFixtureInitializer created a `dirFixture` based on the project base path. The project fixture itself created a `tempPathFixture` for the project directory. This caused the project directory to be deleted twice without a relation. This commit manually creates the `tempPathFixture` and passes it both to the project fixture and to the directory initialization logic. GitOrigin-RevId: 85a23dbc40c201a247747c14f9651277d6dfddb6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0a9f5419ac
commit
d85b5ebc0e
+9
-9
@@ -13,9 +13,9 @@ import com.intellij.testFramework.junit5.fixture.TestFixture
|
||||
import com.intellij.testFramework.junit5.fixture.TestFixtureInitializer
|
||||
import com.intellij.testFramework.junit5.fixture.moduleFixture
|
||||
import com.intellij.testFramework.junit5.fixture.projectFixture
|
||||
import com.intellij.testFramework.junit5.fixture.tempPathFixture
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.Path
|
||||
|
||||
@TestOnly
|
||||
internal class MultiverseFixtureInitializer(
|
||||
@@ -33,22 +33,22 @@ internal class MultiverseFixtureInitializer(
|
||||
): Project {
|
||||
thisLogger().info("Initializing project structure")
|
||||
|
||||
projectFixture = projectFixture(openProjectTask = openProjectTask, openAfterCreation = openAfterCreation)
|
||||
val projectRootFixture = tempPathFixture()
|
||||
projectRootPath = projectRootFixture.init()
|
||||
|
||||
thisLogger().info("Project root directory is created: $projectRootPath")
|
||||
|
||||
projectFixture = projectFixture(pathFixture = projectRootFixture, openProjectTask = openProjectTask, openAfterCreation = openAfterCreation)
|
||||
val project = projectFixture.init()
|
||||
|
||||
projectRootPath = project.basePath?.let { Path(it) } ?: error("Project base path is not available")
|
||||
|
||||
thisLogger().info("base project is created: $projectRootPath")
|
||||
|
||||
val projectRootAsFixture = dirFixture(projectRootPath)
|
||||
projectRootAsFixture.init()
|
||||
thisLogger().info("Project is created")
|
||||
|
||||
val builder = DirectoryBuilderBase("", structure)
|
||||
builder.init()
|
||||
|
||||
thisLogger().info("Project structure has been read")
|
||||
|
||||
initializeChildren(builder, projectRootAsFixture)
|
||||
initializeChildren(builder, projectRootFixture)
|
||||
|
||||
thisLogger().info("Project structure is initialized")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user