diff --git a/index.js b/index.js index e49304e6..bf0324e0 100644 --- a/index.js +++ b/index.js @@ -145,6 +145,17 @@ function deleteCmd(helm, namespace, release) { return ["delete", "--purge", release]; } +/** + * Makes a test command + * + * @param {string} helm + * @param {string} namespace + * @param {string} release + */ +function testCmd(helm, namespace, release) { + return ["test", "-n", namespace, release, "--logs"]; +} + /** * Run executes the helm deployment. */ @@ -196,6 +207,7 @@ async function run() { chart, "--install", "--wait", + "--create-namespace", `--namespace=${namespace}`, ]; @@ -257,7 +269,10 @@ async function run() { await exec.exec(helm, deleteCmd(helm, namespace, release), { ignoreReturnCode: true }); - } else { + } else if (task === "test") { + await exec.exec(helm, testCmd(helm, namespace, release), { + }); + }else { await exec.exec(helm, args); }