diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Go.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Go.kt index 8eab76b..3da6420 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Go.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/Go.kt @@ -35,6 +35,8 @@ fun Prov.installGo( deleteFile("$target/$filename") configureBashForUser() createFile("~/.bashrc.d/go.sh", "export PATH=\$PATH:/usr/local/go/bin\n") + // check and assert installation + addResult(checkGoVersion(version), info = "Go version $version has been installed.") } else { return@taskWithResult ProvResult(false, err = "Go $version could not be downloaded and installed. " + result.err) } diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt index f4dff7c..d3214cd 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/base/Ssh.kt @@ -2,7 +2,6 @@ package org.domaindrivenarchitecture.provs.framework.ubuntu.keys.base import org.domaindrivenarchitecture.provs.desktop.domain.KnownHost import org.domaindrivenarchitecture.provs.framework.core.Prov -import org.domaindrivenarchitecture.provs.framework.core.ProvResult import org.domaindrivenarchitecture.provs.framework.core.local import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.* import org.domaindrivenarchitecture.provs.framework.ubuntu.keys.SshKeyPair @@ -53,11 +52,9 @@ fun Prov.addKnownHost(knownHost: KnownHost, verifyKeys: Boolean = false) = task val formattedHost = formatHostForKnownHostsFile(hostName, port) addTextToFile("\n$formattedHost $key\n", File(knownHostsFile)) } else { - addResultToEval( - ProvResult( - false, - err = "The following key of host [$hostName] could not be verified successfully: " + key - ) + addResult( + false, + err = "The following key of host [$hostName] could not be verified successfully: " + key ) } } diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GoKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GoKtTest.kt index f6d5df0..580110a 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GoKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/GoKtTest.kt @@ -15,8 +15,6 @@ class GoKtTest { val res = prov.task { installGo() installGo() // check repeatability - // check if installation was successful - cmd("/usr/local/go/bin/go version") } // then diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt index af96248..c592715 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt @@ -532,7 +532,7 @@ internal class ProvTest { } @Test - fun addResultToEval_success() { + fun addResult_success() { // given fun Prov.inner() { addResult(true) @@ -589,7 +589,7 @@ internal class ProvTest { } @Test - fun addResultToEval_failure() { + fun addResult_failure() { // given fun Prov.inner() { addResult(false)