Fixed build issues
This commit is contained in:
parent
cca90c246d
commit
ff337763b4
@ -13,13 +13,10 @@ import javax.inject.Provider
|
|||||||
private const val DEFAULT_SSH_PORT = 22
|
private const val DEFAULT_SSH_PORT = 22
|
||||||
|
|
||||||
class GRemoteSession @Inject constructor(
|
class GRemoteSession @Inject constructor(
|
||||||
private val processProvider: Provider<GProcess>,
|
|
||||||
private val processSession: Provider<LibSshSession>,
|
private val processSession: Provider<LibSshSession>,
|
||||||
private val credentialsStateManager: CredentialsStateManager,
|
private val credentialsStateManager: CredentialsStateManager,
|
||||||
) : RemoteSession {
|
) : RemoteSession {
|
||||||
private val client = SshClient.setUpDefaultClient()
|
private val client = SshClient.setUpDefaultClient()
|
||||||
|
|
||||||
private var connectFuture: ConnectFuture? = null
|
|
||||||
private var session: LibSshSession? = null
|
private var session: LibSshSession? = null
|
||||||
|
|
||||||
override fun exec(commandName: String, timeout: Int): Process {
|
override fun exec(commandName: String, timeout: Int): Process {
|
||||||
|
@ -4,6 +4,7 @@ import com.jetpackduba.gitnuro.credentials.*
|
|||||||
import com.jetpackduba.gitnuro.di.factories.HttpCredentialsFactory
|
import com.jetpackduba.gitnuro.di.factories.HttpCredentialsFactory
|
||||||
import com.jetpackduba.gitnuro.git.remote_operations.CloneRepositoryUseCase
|
import com.jetpackduba.gitnuro.git.remote_operations.CloneRepositoryUseCase
|
||||||
import com.jetpackduba.gitnuro.git.remote_operations.HandleTransportUseCase
|
import com.jetpackduba.gitnuro.git.remote_operations.HandleTransportUseCase
|
||||||
|
import com.jetpackduba.gitnuro.ssh.libssh.LibSshSession
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.flow.flowOn
|
import kotlinx.coroutines.flow.flowOn
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
@ -13,6 +14,7 @@ import org.junit.jupiter.api.extension.BeforeAllCallback
|
|||||||
import org.junit.jupiter.api.extension.ExtensionContext
|
import org.junit.jupiter.api.extension.ExtensionContext
|
||||||
import org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL
|
import org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import javax.inject.Provider
|
||||||
import kotlin.io.path.createTempDirectory
|
import kotlin.io.path.createTempDirectory
|
||||||
|
|
||||||
private const val REPO_URL = "https://github.com/JetpackDuba/Gitnuro_TestsRepo.git"
|
private const val REPO_URL = "https://github.com/JetpackDuba/Gitnuro_TestsRepo.git"
|
||||||
@ -33,10 +35,13 @@ class BeforeRepoAllTestsExtension : BeforeAllCallback, AfterAllCallback {
|
|||||||
context.root.getStore(GLOBAL).put("gitnuro_tests", this)
|
context.root.getStore(GLOBAL).put("gitnuro_tests", this)
|
||||||
|
|
||||||
val credentialsStateManager = CredentialsStateManager()
|
val credentialsStateManager = CredentialsStateManager()
|
||||||
|
val ssh = Provider {
|
||||||
|
LibSshSession()
|
||||||
|
}
|
||||||
val cloneRepositoryUseCase =
|
val cloneRepositoryUseCase =
|
||||||
CloneRepositoryUseCase(
|
CloneRepositoryUseCase(
|
||||||
HandleTransportUseCase(
|
HandleTransportUseCase(
|
||||||
sessionManager = GSessionManager { GRemoteSession({ GProcess() }, credentialsStateManager) },
|
sessionManager = GSessionManager { GRemoteSession(ssh, credentialsStateManager) },
|
||||||
httpCredentialsProvider = object : HttpCredentialsFactory {
|
httpCredentialsProvider = object : HttpCredentialsFactory {
|
||||||
override fun create(git: Git?): HttpCredentialsProvider =
|
override fun create(git: Git?): HttpCredentialsProvider =
|
||||||
HttpCredentialsProvider(credentialsStateManager, git)
|
HttpCredentialsProvider(credentialsStateManager, git)
|
||||||
|
Loading…
Reference in New Issue
Block a user