diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCode.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCode.kt index 8d5827f..03ab519 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCode.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCode.kt @@ -25,7 +25,7 @@ fun Prov.installVSC(vararg options: String) = task { installExtensionsCodium(pythonExtensions) } - provisionAdditionalTools() + provisionAdditionalToolsForVSCode() } @@ -84,7 +84,7 @@ private fun Prov.installExtensionsCodium(extensions: List) = optional { } -internal fun Prov.provisionAdditionalTools() = task { +internal fun Prov.provisionAdditionalToolsForVSCode() = task { // Joker val version = "0.18.0" cmd("curl -Lo joker-${version}-linux-amd64.zip https://github.com/candid82/joker/releases/download/v${version}/joker-${version}-linux-amd64.zip") diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/ProvisionWorkplaceKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/ProvisionWorkplaceKtTest.kt similarity index 86% rename from src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/ProvisionWorkplaceKtTest.kt rename to src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/ProvisionWorkplaceKtTest.kt index 58a3d37..0078676 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/ProvisionWorkplaceKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/ProvisionWorkplaceKtTest.kt @@ -1,7 +1,5 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.workplace +package org.domaindrivenarchitecture.provs.desktop.domain -import org.domaindrivenarchitecture.provs.desktop.domain.DesktopType -import org.domaindrivenarchitecture.provs.desktop.domain.provisionWorkplace import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/FakturamaKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/FakturamaKtTest.kt similarity index 74% rename from src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/FakturamaKtTest.kt rename to src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/FakturamaKtTest.kt index 1cfe016..15635c3 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/FakturamaKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/FakturamaKtTest.kt @@ -1,6 +1,5 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.workplace.base +package org.domaindrivenarchitecture.provs.desktop.infrastructure -import org.domaindrivenarchitecture.provs.desktop.infrastructure.installFakturama import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest import org.junit.jupiter.api.Assertions.assertTrue diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/GopassBridgeKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GopassBridgeKtTest.kt similarity index 89% rename from src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/GopassBridgeKtTest.kt rename to src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GopassBridgeKtTest.kt index 631d94d..c467085 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/GopassBridgeKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GopassBridgeKtTest.kt @@ -1,17 +1,11 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.workplace.base +package org.domaindrivenarchitecture.provs.desktop.infrastructure -import org.domaindrivenarchitecture.provs.desktop.infrastructure.configureGopassBridgeJsonApi -import org.domaindrivenarchitecture.provs.desktop.infrastructure.downloadGopassBridge -import org.domaindrivenarchitecture.provs.desktop.infrastructure.installGopass -import org.domaindrivenarchitecture.provs.desktop.infrastructure.installGopassBridgeJsonApi import org.domaindrivenarchitecture.provs.framework.core.Prov import org.domaindrivenarchitecture.provs.framework.core.ProvResult import org.domaindrivenarchitecture.provs.framework.core.Secret import org.domaindrivenarchitecture.provs.framework.core.docker.exitAndRmContainer import org.domaindrivenarchitecture.provs.framework.core.local import org.domaindrivenarchitecture.provs.framework.core.processors.ContainerStartMode -import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.privateGPGSnakeoilKey -import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.publicGPGSnakeoilKey import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.KeyPair import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.base.configureGpgKeys @@ -19,6 +13,8 @@ import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.tags.ContainerTest import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest import org.domaindrivenarchitecture.provs.test.tags.NonCi +import org.domaindrivenarchitecture.provs.test_keys.privateGPGSnakeoilKey +import org.domaindrivenarchitecture.provs.test_keys.publicGPGSnakeoilKey import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Disabled diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/GopassKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GopassKtTest.kt similarity index 92% rename from src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/GopassKtTest.kt rename to src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GopassKtTest.kt index 4d40f5e..98b0927 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/GopassKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GopassKtTest.kt @@ -1,4 +1,4 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.workplace.base +package org.domaindrivenarchitecture.provs.desktop.infrastructure import org.domaindrivenarchitecture.provs.framework.core.Secret import org.domaindrivenarchitecture.provs.framework.core.remote @@ -12,10 +12,9 @@ import org.domaindrivenarchitecture.provs.framework.ubuntu.secret.secretSources. import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.privateGPGSnakeoilKey -import org.domaindrivenarchitecture.provs.framework.extensions.test_keys.publicGPGSnakeoilKey +import org.domaindrivenarchitecture.provs.test_keys.privateGPGSnakeoilKey +import org.domaindrivenarchitecture.provs.test_keys.publicGPGSnakeoilKey import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.* -import org.domaindrivenarchitecture.provs.desktop.infrastructure.* import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest import org.junit.jupiter.api.Assertions.assertFalse diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCodeKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCodeKtTest.kt index 1d8a575..bead5cd 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCodeKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/VSCodeKtTest.kt @@ -4,6 +4,8 @@ import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInsta import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test internal class VSCodeKtTest { @@ -13,7 +15,21 @@ internal class VSCodeKtTest { defaultTestContainer().aptInstall("curl unzip") // when - val res = defaultTestContainer().provisionAdditionalTools() + val res = defaultTestContainer().provisionAdditionalToolsForVSCode() + + // then + assertTrue(res.success) + } + + @Test + @Disabled("Test currently not working, needs fix. VSC is installed by snapd which is not currently supported to run inside docker") + fun installVSC() { + // given + val a = defaultTestContainer() + a.aptInstall("xvfb libgbm-dev libasound2") + + // when + val res = a.installVSC("python", "clojure") // then assertTrue(res.success) diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/VSCodeKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/VSCodeKtTest.kt deleted file mode 100644 index 26c6220..0000000 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/workplace/base/VSCodeKtTest.kt +++ /dev/null @@ -1,26 +0,0 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.workplace.base - -import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall -import org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test -import org.domaindrivenarchitecture.provs.test.defaultTestContainer -import org.domaindrivenarchitecture.provs.desktop.infrastructure.installVSC - - -internal class VSCodeKtTest { - - @Test - @Disabled("Test currently not working, needs fix. VSC is installed by snapd which is not currently supported to run inside docker") - fun installVSC() { - // given - val a = defaultTestContainer() - a.aptInstall("xvfb libgbm-dev libasound2") - - // when - val res = a.installVSC("python", "clojure") - - // then - assertTrue(res.success) - } -} \ No newline at end of file diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/test_keys/TestKeys.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/test_keys/TestKeys.kt similarity index 99% rename from src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/test_keys/TestKeys.kt rename to src/test/kotlin/org/domaindrivenarchitecture/provs/test_keys/TestKeys.kt index 591f2c5..83e9b0a 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/extensions/test_keys/TestKeys.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/test_keys/TestKeys.kt @@ -1,4 +1,4 @@ -package org.domaindrivenarchitecture.provs.framework.extensions.test_keys +package org.domaindrivenarchitecture.provs.test_keys fun publicGPGSnakeoilKey(): String { @@ -129,10 +129,13 @@ i+XV3Dazj3nq/DxUB0neLU/r1afAEiqZAkI= -----END PGP PRIVATE KEY BLOCK-----""".trimIndent() } + +@Suppress("unused") fun publicSSHSnakeoilKey(): String { return """ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOtQOq8a/Z7SdZVPrh+Icaq5rr+Qg1TZP4IPuRoFgfujUztQ2dy5DfTEbabJ0qHyo+PKwBDQorVohrW7CwvCEVQQh2NLuGgnukBN2ut5Lam7a/fZBoMjAyTvD4bXyEsUr/Bl5CLoBDkKM0elUxsc19ndzSofnDWeGyQjJIWlkNkVk/ybErAnIHVE+D+g3UxwA+emd7BF72RPqdVN39Eu4ntnxYzX0eepc8rkpFolVn6+Ai4CYHE4FaJ7bJ9WGPbwLuDl0pw/Cp3ps17cB+JlQfJ2spOq0tTVk+GcdGnt+mq0WaOnvVeQsGJ2O1HpY3VqQd1AsC2UOyHhAQ00pw7Pi9 snake@oil.com""" } +@Suppress("unused") fun privateSSHSnakeoilKey(): String { return """ -----BEGIN RSA PRIVATE KEY-----